Adding test files to test changes.
authorrtrimana <rtrimana@uci.edu>
Thu, 17 May 2018 04:52:42 +0000 (21:52 -0700)
committerrtrimana <rtrimana@uci.edu>
Thu, 17 May 2018 04:52:42 +0000 (21:52 -0700)
version2/src/java/simple_test/Controller.java
version2/src/java/simple_test/Controller2.java [new file with mode: 0644]
version2/src/java/simple_test/Read.java [new file with mode: 0644]
version2/src/java/simple_test/Setup.java
version2/src/java/simple_test/build.bash
version2/src/java/simple_test/run.bash
version2/src/java/simple_test/run2.bash [new file with mode: 0755]
version2/src/java/simple_test/runRead.bash [new file with mode: 0755]

index 78ac1519673bc3539d4b49dd460a30dc58509e8f..6e6a2355513f2429963451c448ddcd85d154a4de 100644 (file)
@@ -4,45 +4,26 @@ class Controller {
     public static void main(String[] args) throws Exception {
 
 
-        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 399, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 260, -1);
         // t1.initTable();
         t1.rebuild();
 
+
         String a = "bulb";
         IoTString ia = new IoTString(a);
-        t1.createNewKey(ia, 399);
+        t1.createNewKey(ia, 260);
 
         t1.update();
 
-
-
         String valueA = "on";
         IoTString iValueA = new IoTString(valueA);
-
-
         IoTString testValA1 = t1.getCommitted(ia);
 
-        if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
-            System.out.println("Is True");
-        } else {
-            System.out.println("Is False or Null");
-        }
-
-
-
         t1.startTransaction();
         t1.addKV(ia, iValueA);
         t1.commitTransaction();
-
+        
         t1.update();
-        testValA1 = t1.getCommitted(ia);
-
-        if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
-            System.out.println("Is True");
-        } else {
-            System.out.println("Is False or Null");
-        }
-
     }
 
-}
\ No newline at end of file
+}
diff --git a/version2/src/java/simple_test/Controller2.java b/version2/src/java/simple_test/Controller2.java
new file mode 100644 (file)
index 0000000..ed12871
--- /dev/null
@@ -0,0 +1,28 @@
+import iotcloud.*;
+
+class Controller2 {
+    public static void main(String[] args) throws Exception {
+
+
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 260, -1);
+        // t1.initTable();
+        t1.rebuild();
+
+        String a = "bulb";
+        IoTString ia = new IoTString(a);
+        t1.createNewKey(ia, 260);
+
+        t1.update();
+
+        String valueB = "off";
+        IoTString iValueB = new IoTString(valueB);
+
+        t1.startTransaction();
+        t1.addKV(ia, iValueB);
+        t1.commitTransaction();
+        
+
+        t1.update();
+    }
+
+}
diff --git a/version2/src/java/simple_test/Read.java b/version2/src/java/simple_test/Read.java
new file mode 100644 (file)
index 0000000..b0adbb5
--- /dev/null
@@ -0,0 +1,22 @@
+import iotcloud.*;
+import java.util.Set;
+import java.util.HashSet;
+
+class Read {
+    public static void main(String[] args) throws Exception {
+
+
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 41567, -1);
+        // t1.initTable();
+        t1.rebuild();
+
+               Set<IoTString> keySet = t1.getKeys();
+               int i = 1;
+               for(IoTString key : keySet) {
+                       System.out.print(i + "- Key: " + key.toString() + " -> ");
+               IoTString val = t1.getCommitted(key);
+                       System.out.println("Value: " + val.toString());
+                       i = i + 1;
+               }
+    }
+}
index f32c70a62a698477de54840ac911f8359f459fdc..897ed62bbd71b7c49b59a821d4f0497842a3eca6 100644 (file)
@@ -5,72 +5,22 @@ class Setup {
 
     public static void main(String[] args) throws Exception {
 
-        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 400, -1);
         t1.initTable();
 
+               String a = "bulb";
+        IoTString ia = new IoTString(a);
 
-        // for ( int i = 0; i < 150; i++) {
-            
-        //     System.out.println(i);
+        t1.createNewKey(ia, 400);
 
-        //     String a1 = "bulb" + i;
-        //     IoTString ia1 = new IoTString(a1);
-        //     t1.createNewKey(ia1, 321);
-        //     t1.update();
-
-
-        //     // t1.update();
-        //     // t1.startTransaction();
-        //     // t1.addKV(ia1, ia1);
-        //     // t1.commitTransaction();
-
-        // }
-
-
-        String a1 = "bulb1";
-        String a2 = "bulb2";
-        String a3 = "bulb3";
-        IoTString ia1 = new IoTString(a1);
-        IoTString ia2 = new IoTString(a2);
-        IoTString ia3 = new IoTString(a3);
-
-
-
-        String b1 = "wemo1";
-        String b2 = "wemo2";
-        IoTString ib1 = new IoTString(b1);
-        IoTString ib2 = new IoTString(b2);
-
-
-        String c1 = "sensor";
-        IoTString ic1 = new IoTString(c1);
-
-
-        String pingTimerKey = "bulbController";
-        IoTString ipingTimerKey = new IoTString(pingTimerKey);
-
-
-        String pingTimerKey2 = "wemoController";
-        IoTString ipingTimerKey2 = new IoTString(pingTimerKey2);
-
-
-        String pingTimerKey3 = "sensorController";
-        IoTString ipingTimerKey3 = new IoTString(pingTimerKey3);
-
-
-        t1.createNewKey(ia1, 321);
-        t1.createNewKey(ia2, 321);
-        t1.createNewKey(ia3, 321);
-        t1.createNewKey(ipingTimerKey, 321);
-
-        t1.createNewKey(ib1, 351);
-        t1.createNewKey(ib2, 351);
-        t1.createNewKey(ipingTimerKey2, 351);
-
-
-        t1.createNewKey(ic1, 361);
-        t1.createNewKey(ipingTimerKey3, 361);
+        String valueA = "on";
+        IoTString iValueA = new IoTString(valueA);
+        IoTString testValA1 = t1.getCommitted(ia);
+        
+        t1.startTransaction();
+        t1.addKV(ia, iValueA);
+        t1.commitTransaction();
 
         t1.update();
     }
-}
\ No newline at end of file
+}
index dbce68163f58ff2a5263daba13bcbb7799d16638..d2b564211849ce8538337107a775f0cd425f5fdc 100755 (executable)
@@ -1 +1 @@
-javac -cp .:/Users/Ali/Desktop/iotcloud/version2/src/java/iotcloud/bin *.java
\ No newline at end of file
+javac -cp .:../iotcloud/bin *.java
index 33c4eded385c3bc82bda1611f0f653705bedda5d..567d51911f547088c3c32a413a5f08018c882ce6 100755 (executable)
@@ -1 +1 @@
-java -cp .:/Users/Ali/Desktop/iotcloud/version2/src/java/iotcloud/bin Controller
\ No newline at end of file
+java -cp .:../iotcloud/bin Controller
diff --git a/version2/src/java/simple_test/run2.bash b/version2/src/java/simple_test/run2.bash
new file mode 100755 (executable)
index 0000000..a186984
--- /dev/null
@@ -0,0 +1 @@
+java -cp .:../iotcloud/bin Controller2
diff --git a/version2/src/java/simple_test/runRead.bash b/version2/src/java/simple_test/runRead.bash
new file mode 100755 (executable)
index 0000000..a44d55f
--- /dev/null
@@ -0,0 +1 @@
+java -cp .:../iotcloud/bin Read