edits
[iotcloud.git] / src / java / iotcloud / Test.java
index 97057dd11cc802f0b267c51e8ee76fe6069e0abc..101ca77983c555a97f7ea054edcb50429d656e07 100644 (file)
@@ -2,12 +2,38 @@ package iotcloud;
 
 public class Test {
        public static void main(String[] args) {
+               if (args[0].equals("1"))
+                       test1();
+               else if(args[0].equals("2"))
+                       test2();
+
+       }
+
+       static void test2() {
+               Table t1=new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 321);
+               t1.initTable();
+               Table t2=new Table("http://127.0.0.1/test.iotcloud/", "reallysecret", 351);
+               t2.update();
+               for(int i=0; i<600; i++) {
+                       String a="STR"+i;
+                       String b="ABR"+i;
+                       IoTString ia=new IoTString(a);
+                       IoTString ib=new IoTString(b);
+                       t1.put(ia, ia);
+                       t2.put(ib, ib);
+                       t1.update();
+                       System.out.println(ib+"->"+t1.get(ib));
+                       System.out.println(ia+"->"+t2.get(ia));
+               }
+       }
+
+       static void test1() {
                TestCloudComm cc=new TestCloudComm();
                Table t1=new Table(cc, 6513);
                t1.initTable();
                Table t2=new Table(cc, 6512);
                t2.update();
-               for(int i=0;i<100;i++) {
+               for(int i=0; i<600; i++) {
                        String a="STR"+i;
                        String b="ABR"+i;
                        IoTString ia=new IoTString(a);
@@ -18,5 +44,16 @@ public class Test {
                        System.out.println(ib+"->"+t1.get(ib));
                        System.out.println(ia+"->"+t2.get(ia));
                }
+               for(int i=0; i<600; i++) {
+                       String a="STR"+i;
+                       String b="ABR"+i;
+                       IoTString ia=new IoTString(a);
+                       IoTString ib=new IoTString(b);
+                       System.out.println(ib+"->"+t1.get(ib));
+                       System.out.println(ia+"->"+t2.get(ia));
+                       System.out.println(ib+"->"+t2.get(ib));
+                       System.out.println(ia+"->"+t1.get(ia));
+               }
+
        }
 }