Fixing initialization to just create a table on the cloud side.
[iotcloud.git] / version2 / src / java / simple_test / Controller.java
1 import iotcloud.*;
2
3 class Controller {
4     public static void main(String[] args) throws Exception {
5
6
7         Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 399, -1);
8         // t1.initTable();
9         t1.rebuild();
10
11         String a = "bulb";
12         IoTString ia = new IoTString(a);
13         t1.createNewKey(ia, 399);
14
15         t1.update();
16
17
18
19         String valueA = "on";
20         IoTString iValueA = new IoTString(valueA);
21
22
23         IoTString testValA1 = t1.getCommitted(ia);
24
25         if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
26             System.out.println("Is True");
27         } else {
28             System.out.println("Is False or Null");
29         }
30
31
32
33         t1.startTransaction();
34         t1.addKV(ia, iValueA);
35         t1.commitTransaction();
36
37         t1.update();
38         testValA1 = t1.getCommitted(ia);
39
40         if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
41             System.out.println("Is True");
42         } else {
43             System.out.println("Is False or Null");
44         }
45
46     }
47
48 }