4 import java.util.ArrayList;
14 public static final int NUMBER_OF_TESTS = 2;
16 public static void main(String[] args) throws ServerException {
17 if (args[0].equals("2")) {
19 } else if (args[0].equals("3")) {
21 } else if (args[0].equals("4")) {
23 } else if (args[0].equals("5")) {
25 } else if (args[0].equals("6")) {
27 } else if (args[0].equals("7")) {
29 } else if (args[0].equals("8")) {
31 } else if (args[0].equals("9")) {
33 } else if (args[0].equals("10")) {
35 } else if (args[0].equals("11")) {
37 } else if (args[0].equals("12")) {
39 } else if (args[0].equals("13")) {
43 else if (args[0].equals("14")) {
49 static void test14() throws ServerException {
50 TimingSingleton timer = TimingSingleton.getInstance();
52 boolean foundError = false;
55 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
57 // Setup the 2 clients
58 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
60 System.out.println("T1 Ready");
62 long initTimeNet = timer.getTime();
65 System.out.println("Setting up keys");
66 startTime = System.nanoTime();
67 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
68 System.out.println(i);
70 IoTString ia = new IoTString(a);
71 t1.createNewKey(ia, 321);
73 endTime = System.nanoTime();
74 long keysDt = endTime - startTime;
75 long keysNet = timer.getTime() - initTimeNet;
77 System.out.println("Total Key Create Time: " + keysDt / 1000000);
78 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
79 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
87 static void test13() throws ServerException {
88 TimingSingleton timer = TimingSingleton.getInstance();
90 boolean foundError = false;
93 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
95 // Setup the 2 clients
96 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
98 System.out.println("T1 Ready");
100 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
102 System.out.println("T2 Ready");
106 long initTimeNet = timer.getTime();
110 System.out.println("Setting up keys");
111 startTime = System.nanoTime();
112 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
113 System.out.println(i);
118 IoTString ia = new IoTString(a);
119 IoTString ib = new IoTString(b);
120 IoTString ic = new IoTString(c);
121 IoTString id = new IoTString(d);
122 t1.createNewKey(ia, 351);
123 t1.createNewKey(ib, 351);
124 t2.createNewKey(ic, 321);
125 t2.createNewKey(id, 321);
127 endTime = System.nanoTime();
128 long keysDt = endTime - startTime;
129 long keysNet = timer.getTime() - initTimeNet;
131 // Do Updates for the keys
132 System.out.println("Setting Key-Values...");
133 startTime = System.nanoTime();
134 for (int t = 0; t < 1; t++) {
135 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
136 System.out.println(i);
137 String keyA = "a" + i;
138 String keyB = "b" + i;
139 String keyC = "c" + i;
140 String keyD = "d" + i;
141 String valueA = "a" + i;
142 String valueB = "b" + i;
143 String valueC = "c" + i;
144 String valueD = "d" + i;
146 IoTString iKeyA = new IoTString(keyA);
147 IoTString iKeyB = new IoTString(keyB);
148 IoTString iKeyC = new IoTString(keyC);
149 IoTString iKeyD = new IoTString(keyD);
150 IoTString iValueA = new IoTString(valueA);
151 IoTString iValueB = new IoTString(valueB);
152 IoTString iValueC = new IoTString(valueC);
153 IoTString iValueD = new IoTString(valueD);
156 t1.startTransaction();
157 t1.addKV(iKeyA, iValueA);
158 transStatusList.add(t1.commitTransaction());
160 t1.startTransaction();
161 t1.addKV(iKeyB, iValueB);
162 transStatusList.add(t1.commitTransaction());
164 t2.startTransaction();
165 t2.addKV(iKeyC, iValueC);
166 transStatusList.add(t2.commitTransaction());
168 t2.startTransaction();
169 t2.addKV(iKeyD, iValueD);
170 transStatusList.add(t2.commitTransaction());
174 endTime = System.nanoTime();
175 long writesDt = endTime - startTime;
176 long writesNet = timer.getTime() - keysNet - initTimeNet;
178 System.out.println("Updating Clients...");
179 startTime = System.nanoTime();
182 endTime = System.nanoTime();
183 long updatesDt = endTime - startTime;
184 long updatesNet = timer.getTime() - keysNet - writesNet - initTimeNet;
187 System.out.println("Total Key Create Time: " + keysDt / 1000000);
188 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
189 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
190 System.out.println();
191 System.out.println("Total write Time: " + writesDt / 1000000);
192 System.out.println("Total write Time Network: " + writesNet / 1000000);
193 System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
194 System.out.println();
195 System.out.println("Total updates Time: " + updatesDt / 1000000);
196 System.out.println("Total updates Time Network: " + updatesNet / 1000000);
197 System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
201 static void test12() throws ServerException {
202 TimingSingleton timer = TimingSingleton.getInstance();
204 boolean foundError = false;
207 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
209 // Setup the 2 clients
210 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
212 System.out.println("T1 Ready");
214 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
216 System.out.println("T2 Ready");
219 long initTimeNet = timer.getTime();
223 System.out.println("Setting up keys");
224 startTime = System.nanoTime();
225 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
226 System.out.println(i);
231 IoTString ia = new IoTString(a);
232 IoTString ib = new IoTString(b);
233 IoTString ic = new IoTString(c);
234 IoTString id = new IoTString(d);
235 t1.createNewKey(ia, 321);
236 t1.createNewKey(ib, 321);
237 t2.createNewKey(ic, 351);
238 t2.createNewKey(id, 351);
240 endTime = System.nanoTime();
241 long keysDt = endTime - startTime;
242 long keysNet = timer.getTime() - initTimeNet;
244 // Do Updates for the keys
245 System.out.println("Setting Key-Values...");
246 startTime = System.nanoTime();
247 for (int t = 0; t < 3; t++) {
248 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
249 System.out.println(i);
250 String keyA = "a" + i;
251 String keyB = "b" + i;
252 String keyC = "c" + i;
253 String keyD = "d" + i;
254 String valueA = "a" + i;
255 String valueB = "b" + i;
256 String valueC = "c" + i;
257 String valueD = "d" + i;
259 IoTString iKeyA = new IoTString(keyA);
260 IoTString iKeyB = new IoTString(keyB);
261 IoTString iKeyC = new IoTString(keyC);
262 IoTString iKeyD = new IoTString(keyD);
263 IoTString iValueA = new IoTString(valueA);
264 IoTString iValueB = new IoTString(valueB);
265 IoTString iValueC = new IoTString(valueC);
266 IoTString iValueD = new IoTString(valueD);
269 t1.startTransaction();
270 t1.addKV(iKeyA, iValueA);
271 transStatusList.add(t1.commitTransaction());
273 t1.startTransaction();
274 t1.addKV(iKeyB, iValueB);
275 transStatusList.add(t1.commitTransaction());
277 t2.startTransaction();
278 t2.addKV(iKeyC, iValueC);
279 transStatusList.add(t2.commitTransaction());
281 t2.startTransaction();
282 t2.addKV(iKeyD, iValueD);
283 transStatusList.add(t2.commitTransaction());
287 endTime = System.nanoTime();
288 long writesDt = endTime - startTime;
289 long writesNet = timer.getTime() - keysNet - initTimeNet;
291 System.out.println("Updating Clients...");
292 startTime = System.nanoTime();
295 endTime = System.nanoTime();
296 long updatesDt = endTime - startTime;
297 long updatesNet = timer.getTime() - keysNet - writesNet - initTimeNet;
300 System.out.println("Total Key Create Time: " + keysDt / 1000000);
301 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
302 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
303 System.out.println();
304 System.out.println("Total write Time: " + writesDt / 1000000);
305 System.out.println("Total write Time Network: " + writesNet / 1000000);
306 System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
307 System.out.println();
308 System.out.println("Total updates Time: " + updatesDt / 1000000);
309 System.out.println("Total updates Time Network: " + updatesNet / 1000000);
310 System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
314 static void test11() {
316 boolean foundError = false;
317 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
319 // Setup the 2 clients
320 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
322 System.out.println("Init Table t1s");
328 } catch (Exception e) { }
332 System.out.println("Update Table t2");
333 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
334 while (t2.update() == false) {}
337 System.out.println("Setting up keys");
338 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
339 System.out.println(i);
345 IoTString ia = new IoTString(a);
346 IoTString ib = new IoTString(b);
347 IoTString ic = new IoTString(c);
348 IoTString id = new IoTString(d);
352 t1.createNewKey(ia, 321);
354 } catch (Exception e) { }
359 t1.createNewKey(ib, 351);
361 } catch (Exception e) { }
366 t2.createNewKey(ic, 321);
368 } catch (Exception e) { }
373 t2.createNewKey(id, 351);
375 } catch (Exception e) { }
379 // Do Updates for the keys
380 System.out.println("Setting Key-Values...");
381 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
382 System.out.println(i);
383 String keyA = "a" + i;
384 String keyB = "b" + i;
385 String keyC = "c" + i;
386 String keyD = "d" + i;
387 String valueA = "a" + i;
388 String valueB = "b" + i;
389 String valueC = "c" + i;
390 String valueD = "d" + i;
392 IoTString iKeyA = new IoTString(keyA);
393 IoTString iKeyB = new IoTString(keyB);
394 IoTString iKeyC = new IoTString(keyC);
395 IoTString iKeyD = new IoTString(keyD);
396 IoTString iValueA = new IoTString(valueA);
397 IoTString iValueB = new IoTString(valueB);
398 IoTString iValueC = new IoTString(valueC);
399 IoTString iValueD = new IoTString(valueD);
402 String keyAPrev = "a" + (i - 1);
403 String keyBPrev = "b" + (i - 1);
404 String keyCPrev = "c" + (i - 1);
405 String keyDPrev = "d" + (i - 1);
406 String valueAPrev = "a" + (i - 1);
407 String valueBPrev = "b" + (i - 1);
408 String valueCPrev = "c" + (i - 1);
409 String valueDPrev = "d" + (i - 1);
411 IoTString iKeyAPrev = new IoTString(keyAPrev);
412 IoTString iKeyBPrev = new IoTString(keyBPrev);
413 IoTString iKeyCPrev = new IoTString(keyCPrev);
414 IoTString iKeyDPrev = new IoTString(keyDPrev);
415 IoTString iValueAPrev = new IoTString(valueAPrev);
416 IoTString iValueBPrev = new IoTString(valueBPrev);
417 IoTString iValueCPrev = new IoTString(valueCPrev);
418 IoTString iValueDPrev = new IoTString(valueDPrev);
421 System.out.println("t1 A");
422 t1.startTransaction();
423 t1.addKV(iKeyA, iValueA);
424 transStatusList.add(t1.commitTransaction());
426 System.out.println("t1 B");
427 t1.startTransaction();
428 t1.addKV(iKeyB, iValueB);
429 transStatusList.add(t1.commitTransaction());
431 System.out.println("t2 C");
432 t2.startTransaction();
433 t2.addKV(iKeyC, iValueC);
434 transStatusList.add(t2.commitTransaction());
436 System.out.println("t2 D");
437 t2.startTransaction();
438 t2.addKV(iKeyD, iValueD);
439 transStatusList.add(t2.commitTransaction());
442 System.out.println("Updating...");
443 while (t1.update() == false) {}
444 while (t2.update() == false) {}
445 while (t1.update() == false) {}
446 while (t2.update() == false) {}
448 System.out.println("Checking Key-Values...");
449 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
451 String keyA = "a" + i;
452 String keyB = "b" + i;
453 String keyC = "c" + i;
454 String keyD = "d" + i;
455 String valueA = "a" + i;
456 String valueB = "b" + i;
457 String valueC = "c" + i;
458 String valueD = "d" + i;
460 IoTString iKeyA = new IoTString(keyA);
461 IoTString iKeyB = new IoTString(keyB);
462 IoTString iKeyC = new IoTString(keyC);
463 IoTString iKeyD = new IoTString(keyD);
464 IoTString iValueA = new IoTString(valueA);
465 IoTString iValueB = new IoTString(valueB);
466 IoTString iValueC = new IoTString(valueC);
467 IoTString iValueD = new IoTString(valueD);
470 IoTString testValA1 = t1.getCommitted(iKeyA);
471 IoTString testValB1 = t1.getCommitted(iKeyB);
472 IoTString testValC1 = t1.getCommitted(iKeyC);
473 IoTString testValD1 = t1.getCommitted(iKeyD);
475 IoTString testValA2 = t2.getCommitted(iKeyA);
476 IoTString testValB2 = t2.getCommitted(iKeyB);
477 IoTString testValC2 = t2.getCommitted(iKeyC);
478 IoTString testValD2 = t2.getCommitted(iKeyD);
480 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
481 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
485 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
486 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
490 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
491 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
495 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
496 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
501 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
502 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
506 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
507 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
511 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
512 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
516 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
517 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
522 for (TransactionStatus status : transStatusList) {
523 if (status.getStatus() != TransactionStatus.StatusCommitted) {
529 System.out.println("Found Errors...");
531 System.out.println("No Errors Found...");
538 static void test10() {
540 boolean foundError = false;
541 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
543 // Setup the 2 clients
544 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
545 System.out.println("Init Table t1s");
550 } catch (Exception e) { }
552 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
553 while (t2.update() == false) {}
555 t1.addLocalCommunication(351, "127.0.0.1", 6001);
556 t2.addLocalCommunication(321, "127.0.0.1", 6000);
560 System.out.println("Setting up keys");
561 for (int i = 0; i < 4; i++) {
566 IoTString ia = new IoTString(a);
567 IoTString ib = new IoTString(b);
568 IoTString ic = new IoTString(c);
569 IoTString id = new IoTString(d);
572 t1.createNewKey(ia, 321);
574 } catch (Exception e) { }
579 t1.createNewKey(ib, 351);
581 } catch (Exception e) { }
586 t2.createNewKey(ic, 321);
588 } catch (Exception e) { }
593 t2.createNewKey(id, 351);
595 } catch (Exception e) { }
600 // Do Updates for the keys
601 System.out.println("B========================");
602 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
603 for (int i = 0; i < 4; i++) {
605 System.out.println(i);
607 String keyB = "b" + i;
608 String valueB = "b" + (i + t);
610 IoTString iKeyB = new IoTString(keyB);
611 IoTString iValueB = new IoTString(valueB);
613 t1.startTransaction();
614 System.out.println(t1.getSpeculativeAtomic(iKeyB));
615 t1.addKV(iKeyB, iValueB);
616 transStatusList.add(t1.commitTransaction());
619 System.out.println();
622 System.out.println("C========================");
623 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
624 for (int i = 0; i < 4; i++) {
625 System.out.println(i);
627 String keyC = "c" + i;
628 String valueC = "c" + (i + t);
630 IoTString iKeyC = new IoTString(keyC);
631 IoTString iValueC = new IoTString(valueC);
633 t2.startTransaction();
634 System.out.println(t2.getSpeculativeAtomic(iKeyC));
635 t2.addKV(iKeyC, iValueC);
636 transStatusList.add(t2.commitTransaction());
639 System.out.println();
642 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
643 for (int i = 0; i < 4; i++) {
644 String keyA = "a" + i;
645 String keyD = "d" + i;
646 String valueA = "a" + (i + t);
647 String valueD = "d" + (i + t);
649 IoTString iKeyA = new IoTString(keyA);
650 IoTString iKeyD = new IoTString(keyD);
651 IoTString iValueA = new IoTString(valueA);
652 IoTString iValueD = new IoTString(valueD);
655 t1.startTransaction();
656 t1.addKV(iKeyA, iValueA);
657 transStatusList.add(t1.commitTransaction());
660 t2.startTransaction();
661 t2.addKV(iKeyD, iValueD);
662 transStatusList.add(t2.commitTransaction());
663 System.out.println();
666 System.out.println();
668 System.out.println("Updating...");
669 System.out.println("t1 -=-=-=-=-=-=-=-");
670 while (t1.update() == false) {}
671 System.out.println("t2 -=-=-=-=-=-=-=-");
672 while (t2.update() == false) {}
673 System.out.println("t1 -=-=-=-=-=-=-=-");
674 while (t1.update() == false) {}
675 System.out.println("t2 -=-=-=-=-=-=-=-");
676 while (t2.update() == false) {}
679 System.out.println("Checking Key-Values...");
680 for (int i = 0; i < 4; i++) {
682 String keyA = "a" + i;
683 String keyB = "b" + i;
684 String keyC = "c" + i;
685 String keyD = "d" + i;
686 String valueA = "a" + (i + NUMBER_OF_TESTS - 1);
687 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
688 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
689 String valueD = "d" + (i + NUMBER_OF_TESTS - 1);
691 IoTString iKeyA = new IoTString(keyA);
692 IoTString iKeyB = new IoTString(keyB);
693 IoTString iKeyC = new IoTString(keyC);
694 IoTString iKeyD = new IoTString(keyD);
695 IoTString iValueA = new IoTString(valueA);
696 IoTString iValueB = new IoTString(valueB);
697 IoTString iValueC = new IoTString(valueC);
698 IoTString iValueD = new IoTString(valueD);
701 IoTString testValA1 = t1.getCommitted(iKeyA);
702 IoTString testValB1 = t1.getCommitted(iKeyB);
703 IoTString testValC1 = t1.getCommitted(iKeyC);
704 IoTString testValD1 = t1.getCommitted(iKeyD);
706 IoTString testValA2 = t2.getCommitted(iKeyA);
707 IoTString testValB2 = t2.getCommitted(iKeyB);
708 IoTString testValC2 = t2.getCommitted(iKeyC);
709 IoTString testValD2 = t2.getCommitted(iKeyD);
711 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
712 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
716 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
717 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
721 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
722 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
726 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
727 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
731 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
732 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
736 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
737 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
741 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
742 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
746 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
747 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
753 for (TransactionStatus status : transStatusList) {
754 if (status.getStatus() != TransactionStatus.StatusCommitted) {
756 System.out.println(counter + " Status: " + status.getStatus());
762 System.out.println("Found Errors...");
764 System.out.println("No Errors Found...");
771 static void test9() {
773 boolean foundError = false;
774 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
776 // Setup the 2 clients
777 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
779 System.out.println("Init Table t1s");
784 } catch (Exception e) { }
788 System.out.println("Update Table t2");
789 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
790 while (t2.update() == false) {}
792 t1.addLocalCommunication(351, "127.0.0.1", 6001);
793 t2.addLocalCommunication(321, "127.0.0.1", 6000);
796 System.out.println("Setting up keys");
797 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
798 System.out.println(i);
804 IoTString ia = new IoTString(a);
805 IoTString ib = new IoTString(b);
806 IoTString ic = new IoTString(c);
807 IoTString id = new IoTString(d);
811 t1.createNewKey(ia, 321);
813 } catch (Exception e) { }
818 t1.createNewKey(ib, 351);
820 } catch (Exception e) { }
825 t2.createNewKey(ic, 321);
827 } catch (Exception e) { }
832 t2.createNewKey(id, 351);
834 } catch (Exception e) { }
838 System.out.println("A, D...");
839 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
840 String keyA = "a" + i;
841 String keyD = "d" + i;
842 String valueA = "a" + i;
843 String valueD = "d" + i;
845 IoTString iKeyA = new IoTString(keyA);
846 IoTString iKeyD = new IoTString(keyD);
847 IoTString iValueA = new IoTString(valueA);
848 IoTString iValueD = new IoTString(valueD);
850 t1.startTransaction();
851 t1.addKV(iKeyA, iValueA);
852 transStatusList.add(t1.commitTransaction());
854 t2.startTransaction();
855 t2.addKV(iKeyD, iValueD);
856 transStatusList.add(t2.commitTransaction());
859 // while (t1.updateFromLocal(351) == false) {}
860 // while (t2.updateFromLocal(321) == false) {}
863 System.out.println("Updating...");
864 System.out.println("Checking Key-Values...");
866 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
868 String keyA = "a" + i;
869 String keyD = "d" + i;
870 String valueA = "a" + i;
871 String valueD = "d" + i;
874 IoTString iKeyA = new IoTString(keyA);
875 IoTString iKeyD = new IoTString(keyD);
876 IoTString iValueA = new IoTString(valueA);
877 IoTString iValueD = new IoTString(valueD);
880 IoTString testValA1 = t1.getCommitted(iKeyA);
881 IoTString testValD1 = t1.getCommitted(iKeyD);
882 IoTString testValA2 = t2.getCommitted(iKeyA);
883 IoTString testValD2 = t2.getCommitted(iKeyD);
886 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
887 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
891 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
892 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
897 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
898 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
902 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
903 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
908 for (TransactionStatus status : transStatusList) {
909 if (status.getStatus() != TransactionStatus.StatusCommitted) {
915 System.out.println("Found Errors...");
917 System.out.println("No Errors Found...");
924 static void test8() {
925 TimingSingleton timer = TimingSingleton.getInstance();
929 boolean foundError = false;
930 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
932 // Setup the 2 clients
933 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, 6000);
935 System.out.println("Init Table t1s");
941 } catch (Exception e) { }
945 System.out.println("Update Table t2");
946 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, 6001);
947 while (t2.update() == false) {}
949 t1.addLocalCommunication(351, "127.0.0.1", 6001);
950 t2.addLocalCommunication(321, "127.0.0.1", 6000);
953 System.out.println("Setting up keys");
954 startTime = System.nanoTime();
955 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
956 System.out.println(i);
962 IoTString ia = new IoTString(a);
963 IoTString ib = new IoTString(b);
964 IoTString ic = new IoTString(c);
965 IoTString id = new IoTString(d);
969 t1.createNewKey(ia, 321);
971 } catch (Exception e) { }
976 t1.createNewKey(ib, 351);
978 } catch (Exception e) { }
983 t2.createNewKey(ic, 321);
985 } catch (Exception e) { }
990 t2.createNewKey(id, 351);
992 } catch (Exception e) { }
995 endTime = System.nanoTime();
996 long keysDt = endTime - startTime;
997 long keysNet = timer.getTime();
1000 // Do Updates for the keys
1001 startTime = System.nanoTime();
1002 System.out.println("Setting Key-Values...");
1003 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1004 System.out.println(i);
1005 String keyA = "a" + i;
1006 String keyB = "b" + i;
1007 String keyC = "c" + i;
1008 String keyD = "d" + i;
1009 String valueA = "a" + i;
1010 String valueB = "b" + i;
1011 String valueC = "c" + i;
1012 String valueD = "d" + i;
1014 IoTString iKeyA = new IoTString(keyA);
1015 IoTString iKeyB = new IoTString(keyB);
1016 IoTString iKeyC = new IoTString(keyC);
1017 IoTString iKeyD = new IoTString(keyD);
1018 IoTString iValueA = new IoTString(valueA);
1019 IoTString iValueB = new IoTString(valueB);
1020 IoTString iValueC = new IoTString(valueC);
1021 IoTString iValueD = new IoTString(valueD);
1024 String keyAPrev = "a" + (i - 1);
1025 String keyBPrev = "b" + (i - 1);
1026 String keyCPrev = "c" + (i - 1);
1027 String keyDPrev = "d" + (i - 1);
1028 String valueAPrev = "a" + (i - 1);
1029 String valueBPrev = "b" + (i - 1);
1030 String valueCPrev = "c" + (i - 1);
1031 String valueDPrev = "d" + (i - 1);
1033 IoTString iKeyAPrev = new IoTString(keyAPrev);
1034 IoTString iKeyBPrev = new IoTString(keyBPrev);
1035 IoTString iKeyCPrev = new IoTString(keyCPrev);
1036 IoTString iKeyDPrev = new IoTString(keyDPrev);
1037 IoTString iValueAPrev = new IoTString(valueAPrev);
1038 IoTString iValueBPrev = new IoTString(valueBPrev);
1039 IoTString iValueCPrev = new IoTString(valueCPrev);
1040 IoTString iValueDPrev = new IoTString(valueDPrev);
1042 t1.startTransaction();
1043 t1.addKV(iKeyA, iValueA);
1044 transStatusList.add(t1.commitTransaction());
1046 t1.startTransaction();
1047 t1.addKV(iKeyB, iValueB);
1048 transStatusList.add(t1.commitTransaction());
1050 t2.startTransaction();
1051 t2.addKV(iKeyC, iValueC);
1052 transStatusList.add(t2.commitTransaction());
1054 t2.startTransaction();
1055 t2.addKV(iKeyD, iValueD);
1056 transStatusList.add(t2.commitTransaction());
1058 endTime = System.nanoTime();
1059 long writesDt = endTime - startTime;
1060 long writesNet = timer.getTime() - keysNet;
1064 System.out.println("Updating...");
1065 startTime = System.nanoTime();
1066 while (t1.update() == false) {}
1067 while (t2.update() == false) {}
1068 while (t1.update() == false) {}
1069 while (t2.update() == false) {}
1070 endTime = System.nanoTime();
1071 long updatesDt = endTime - startTime;
1072 long updatesNet = timer.getTime() - keysNet - writesNet;
1075 System.out.println("Total Key Create Time: " + keysDt / 1000000);
1076 System.out.println("Total Key Create Time Network: " + keysNet / 1000000);
1077 System.out.println("Total Key Create Time no Network: " + (keysDt - keysNet) / 1000000);
1078 System.out.println();
1079 System.out.println("Total write Time: " + writesDt / 1000000);
1080 System.out.println("Total write Time Network: " + writesNet / 1000000);
1081 System.out.println("Total write Time no Network: " + (writesDt - writesNet) / 1000000);
1082 System.out.println();
1083 System.out.println("Total updates Time: " + updatesDt / 1000000);
1084 System.out.println("Total updates Time Network: " + updatesNet / 1000000);
1085 System.out.println("Total updates Time no Network: " + (updatesDt - updatesNet) / 1000000);
1090 // System.out.println("Checking Key-Values...");
1091 // for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1093 // String keyA = "a" + i;
1094 // String keyB = "b" + i;
1095 // String keyC = "c" + i;
1096 // String keyD = "d" + i;
1097 // String valueA = "a" + i;
1098 // String valueB = "b" + i;
1099 // String valueC = "c" + i;
1100 // String valueD = "d" + i;
1102 // IoTString iKeyA = new IoTString(keyA);
1103 // IoTString iKeyB = new IoTString(keyB);
1104 // IoTString iKeyC = new IoTString(keyC);
1105 // IoTString iKeyD = new IoTString(keyD);
1106 // IoTString iValueA = new IoTString(valueA);
1107 // IoTString iValueB = new IoTString(valueB);
1108 // IoTString iValueC = new IoTString(valueC);
1109 // IoTString iValueD = new IoTString(valueD);
1112 // IoTString testValA1 = t1.getCommitted(iKeyA);
1113 // IoTString testValB1 = t1.getCommitted(iKeyB);
1114 // IoTString testValC1 = t1.getCommitted(iKeyC);
1115 // IoTString testValD1 = t1.getCommitted(iKeyD);
1117 // IoTString testValA2 = t2.getCommitted(iKeyA);
1118 // IoTString testValB2 = t2.getCommitted(iKeyB);
1119 // IoTString testValC2 = t2.getCommitted(iKeyC);
1120 // IoTString testValD2 = t2.getCommitted(iKeyD);
1122 // if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1123 // System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
1124 // foundError = true;
1127 // if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1128 // System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1129 // foundError = true;
1132 // if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1133 // System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1134 // foundError = true;
1137 // if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1138 // System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
1139 // foundError = true;
1143 // if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1144 // System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1145 // foundError = true;
1148 // if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1149 // System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1150 // foundError = true;
1153 // if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1154 // System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1155 // foundError = true;
1158 // if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1159 // System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1160 // foundError = true;
1164 // for (TransactionStatus status : transStatusList) {
1165 // if (status.getStatus() != TransactionStatus.StatusCommitted) {
1166 // foundError = true;
1170 // if (foundError) {
1171 // System.out.println("Found Errors...");
1173 // System.out.println("No Errors Found...");
1179 // System.out.println();
1180 // System.out.println();
1183 // System.out.println();
1184 // System.out.println();
1188 static void test7() throws ServerException {
1190 boolean foundError = false;
1191 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1193 // Setup the 2 clients
1194 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1196 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1200 System.out.println("Setting up keys");
1201 for (int i = 0; i < 4; i++) {
1206 IoTString ia = new IoTString(a);
1207 IoTString ib = new IoTString(b);
1208 IoTString ic = new IoTString(c);
1209 IoTString id = new IoTString(d);
1210 t1.createNewKey(ia, 321);
1211 t1.createNewKey(ib, 351);
1212 t2.createNewKey(ic, 321);
1213 t2.createNewKey(id, 351);
1216 // Do Updates for the keys
1217 System.out.println("Setting Key-Values...");
1219 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1220 for (int i = 0; i < 4; i++) {
1221 String keyB = "b" + i;
1222 String valueB = "b" + (i + t);
1224 IoTString iKeyB = new IoTString(keyB);
1225 IoTString iValueB = new IoTString(valueB);
1227 t1.startTransaction();
1228 t1.getSpeculativeAtomic(iKeyB);
1229 t1.addKV(iKeyB, iValueB);
1230 transStatusList.add(t1.commitTransaction());
1234 for (int i = 0; i < 4; i++) {
1236 String keyB = "b" + i;
1237 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1238 IoTString iKeyB = new IoTString(keyB);
1239 IoTString iValueB = new IoTString(valueB);
1241 IoTString testValB1 = t1.getSpeculative(iKeyB);
1242 IoTString testValB2 = t2.getSpeculative(iKeyB);
1244 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1245 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1249 if ((testValB2 != null)) {
1250 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1255 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1256 for (int i = 0; i < 4; i++) {
1257 String keyC = "c" + i;
1258 String valueC = "c" + (i + t);
1260 IoTString iKeyC = new IoTString(keyC);
1261 IoTString iValueC = new IoTString(valueC);
1263 t2.startTransaction();
1264 t2.getSpeculativeAtomic(iKeyC);
1265 t2.addKV(iKeyC, iValueC);
1266 transStatusList.add(t2.commitTransaction());
1270 for (int i = 0; i < 4; i++) {
1271 String keyC = "c" + i;
1272 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1273 IoTString iKeyC = new IoTString(keyC);
1274 IoTString iValueC = new IoTString(valueC);
1276 IoTString testValC1 = t1.getSpeculative(iKeyC);
1277 IoTString testValC2 = t2.getSpeculative(iKeyC);
1279 if ((testValC1 != null)) {
1280 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1284 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1285 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1290 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1291 for (int i = 0; i < 4; i++) {
1292 String keyA = "a" + i;
1293 String keyD = "d" + i;
1294 String valueA = "a" + (i + t);
1295 String valueD = "d" + (i + t);
1297 IoTString iKeyA = new IoTString(keyA);
1298 IoTString iKeyD = new IoTString(keyD);
1299 IoTString iValueA = new IoTString(valueA);
1300 IoTString iValueD = new IoTString(valueD);
1302 t1.startTransaction();
1303 t1.addKV(iKeyA, iValueA);
1304 transStatusList.add(t1.commitTransaction());
1306 t2.startTransaction();
1307 t2.addKV(iKeyD, iValueD);
1308 transStatusList.add(t2.commitTransaction());
1312 System.out.println("Updating Clients...");
1318 System.out.println("Checking Key-Values...");
1319 for (int i = 0; i < 4; i++) {
1321 String keyA = "a" + i;
1322 String keyB = "b" + i;
1323 String keyC = "c" + i;
1324 String keyD = "d" + i;
1325 String valueA = "a" + (i + NUMBER_OF_TESTS - 1);
1326 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1327 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1328 String valueD = "d" + (i + NUMBER_OF_TESTS - 1);
1330 IoTString iKeyA = new IoTString(keyA);
1331 IoTString iKeyB = new IoTString(keyB);
1332 IoTString iKeyC = new IoTString(keyC);
1333 IoTString iKeyD = new IoTString(keyD);
1334 IoTString iValueA = new IoTString(valueA);
1335 IoTString iValueB = new IoTString(valueB);
1336 IoTString iValueC = new IoTString(valueC);
1337 IoTString iValueD = new IoTString(valueD);
1340 IoTString testValA1 = t1.getCommitted(iKeyA);
1341 IoTString testValB1 = t1.getCommitted(iKeyB);
1342 IoTString testValC1 = t1.getCommitted(iKeyC);
1343 IoTString testValD1 = t1.getCommitted(iKeyD);
1345 IoTString testValA2 = t2.getCommitted(iKeyA);
1346 IoTString testValB2 = t2.getCommitted(iKeyB);
1347 IoTString testValC2 = t2.getCommitted(iKeyC);
1348 IoTString testValD2 = t2.getCommitted(iKeyD);
1350 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1351 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
1355 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1356 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1360 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1361 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1365 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1366 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
1370 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1371 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1375 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1376 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1380 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1381 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1385 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1386 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1391 for (TransactionStatus status : transStatusList) {
1392 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1398 System.out.println("Found Errors...");
1400 System.out.println("No Errors Found...");
1404 static void test6() throws ServerException {
1406 boolean foundError = false;
1407 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1409 // Setup the 2 clients
1410 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1412 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1416 System.out.println("Setting up keys");
1417 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1422 IoTString ia = new IoTString(a);
1423 IoTString ib = new IoTString(b);
1424 IoTString ic = new IoTString(c);
1425 IoTString id = new IoTString(d);
1426 t1.createNewKey(ia, 321);
1427 t1.createNewKey(ib, 351);
1428 t2.createNewKey(ic, 321);
1429 t2.createNewKey(id, 351);
1432 // Do Updates for the keys
1433 System.out.println("Setting Key-Values...");
1434 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1435 String keyA = "a" + i;
1436 String keyB = "b" + i;
1437 String keyC = "c" + i;
1438 String keyD = "d" + i;
1439 String valueA = "a" + i;
1440 String valueB = "b" + i;
1441 String valueC = "c" + i;
1442 String valueD = "d" + i;
1444 IoTString iKeyA = new IoTString(keyA);
1445 IoTString iKeyB = new IoTString(keyB);
1446 IoTString iKeyC = new IoTString(keyC);
1447 IoTString iKeyD = new IoTString(keyD);
1448 IoTString iValueA = new IoTString(valueA);
1449 IoTString iValueB = new IoTString(valueB);
1450 IoTString iValueC = new IoTString(valueC);
1451 IoTString iValueD = new IoTString(valueD);
1453 t1.startTransaction();
1454 t1.getCommittedAtomic(iKeyA);
1455 t1.addKV(iKeyA, iValueA);
1456 transStatusList.add(t1.commitTransaction());
1458 t1.startTransaction();
1459 t1.getCommittedAtomic(iKeyB);
1460 t1.addKV(iKeyB, iValueB);
1461 transStatusList.add(t1.commitTransaction());
1463 t2.startTransaction();
1464 t2.getCommittedAtomic(iKeyC);
1465 t2.addKV(iKeyC, iValueC);
1466 transStatusList.add(t2.commitTransaction());
1468 t2.startTransaction();
1469 t2.getCommittedAtomic(iKeyD);
1470 t2.addKV(iKeyD, iValueD);
1471 transStatusList.add(t2.commitTransaction());
1474 System.out.println("Updating Clients...");
1478 System.out.println("Checking Key-Values...");
1479 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1481 String keyA = "a" + i;
1482 String keyB = "b" + i;
1483 String keyC = "c" + i;
1484 String keyD = "d" + i;
1485 String valueA = "a" + i;
1486 String valueB = "b" + i;
1487 String valueC = "c" + i;
1488 String valueD = "d" + i;
1490 IoTString iKeyA = new IoTString(keyA);
1491 IoTString iKeyB = new IoTString(keyB);
1492 IoTString iKeyC = new IoTString(keyC);
1493 IoTString iKeyD = new IoTString(keyD);
1494 IoTString iValueA = new IoTString(valueA);
1495 IoTString iValueB = new IoTString(valueB);
1496 IoTString iValueC = new IoTString(valueC);
1497 IoTString iValueD = new IoTString(valueD);
1500 IoTString testValA1 = t1.getCommitted(iKeyA);
1501 IoTString testValB1 = t1.getCommitted(iKeyB);
1502 IoTString testValC1 = t1.getCommitted(iKeyC);
1503 IoTString testValD1 = t1.getCommitted(iKeyD);
1505 IoTString testValA2 = t2.getCommitted(iKeyA);
1506 IoTString testValB2 = t2.getCommitted(iKeyB);
1507 IoTString testValC2 = t2.getCommitted(iKeyC);
1508 IoTString testValD2 = t2.getCommitted(iKeyD);
1510 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1511 System.out.println("Key-Value t1 incorrect: " + keyA);
1515 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1516 System.out.println("Key-Value t1 incorrect: " + keyB);
1520 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1521 System.out.println("Key-Value t1 incorrect: " + keyC);
1525 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1526 System.out.println("Key-Value t1 incorrect: " + keyD);
1531 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1532 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1536 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1537 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1541 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1542 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1546 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1547 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1552 for (TransactionStatus status : transStatusList) {
1553 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1559 System.out.println("Found Errors...");
1561 System.out.println("No Errors Found...");
1565 static void test5() throws ServerException {
1567 boolean foundError = false;
1568 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1570 // Setup the 2 clients
1571 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1573 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1578 System.out.println("Setting up keys");
1579 for (int i = 0; i < 4; i++) {
1584 IoTString ia = new IoTString(a);
1585 IoTString ib = new IoTString(b);
1586 IoTString ic = new IoTString(c);
1587 IoTString id = new IoTString(d);
1588 t1.createNewKey(ia, 321);
1589 t1.createNewKey(ib, 351);
1590 t2.createNewKey(ic, 321);
1591 t2.createNewKey(id, 351);
1594 // Do Updates for the keys
1595 System.out.println("Setting Key-Values...");
1597 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1598 for (int i = 0; i < 4; i++) {
1599 String keyB = "b" + i;
1600 String valueB = "b" + (i + t);
1602 IoTString iKeyB = new IoTString(keyB);
1603 IoTString iValueB = new IoTString(valueB);
1605 t1.startTransaction();
1606 t1.addKV(iKeyB, iValueB);
1607 transStatusList.add(t1.commitTransaction());
1611 for (int i = 0; i < 4; i++) {
1613 String keyB = "b" + i;
1614 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1615 IoTString iKeyB = new IoTString(keyB);
1616 IoTString iValueB = new IoTString(valueB);
1618 IoTString testValB1 = t1.getSpeculative(iKeyB);
1619 IoTString testValB2 = t2.getSpeculative(iKeyB);
1621 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1622 System.out.println("Key-Value t1 incorrect: " + keyB);
1626 if ((testValB2 != null)) {
1627 System.out.println("Key-Value t2 incorrect: " + keyB);
1632 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1633 for (int i = 0; i < 4; i++) {
1634 String keyC = "c" + i;
1635 String valueC = "c" + (i + t);
1637 IoTString iKeyC = new IoTString(keyC);
1638 IoTString iValueC = new IoTString(valueC);
1640 t2.startTransaction();
1641 t2.addKV(iKeyC, iValueC);
1642 transStatusList.add(t2.commitTransaction());
1646 for (int i = 0; i < 4; i++) {
1647 String keyC = "c" + i;
1648 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1649 IoTString iKeyC = new IoTString(keyC);
1650 IoTString iValueC = new IoTString(valueC);
1652 IoTString testValC1 = t1.getSpeculative(iKeyC);
1653 IoTString testValC2 = t2.getSpeculative(iKeyC);
1655 if ((testValC1 != null)) {
1656 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1660 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1661 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1666 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1667 for (int i = 0; i < 4; i++) {
1668 String keyA = "a" + i;
1669 String keyD = "d" + i;
1670 String valueA = "a" + (i + t);
1671 String valueD = "d" + (i + t);
1673 IoTString iKeyA = new IoTString(keyA);
1674 IoTString iKeyD = new IoTString(keyD);
1675 IoTString iValueA = new IoTString(valueA);
1676 IoTString iValueD = new IoTString(valueD);
1678 t1.startTransaction();
1679 t1.addKV(iKeyA, iValueA);
1680 transStatusList.add(t1.commitTransaction());
1682 t2.startTransaction();
1683 t2.addKV(iKeyD, iValueD);
1684 transStatusList.add(t2.commitTransaction());
1688 System.out.println("Updating Clients...");
1693 System.out.println("Checking Key-Values...");
1694 for (int i = 0; i < 4; i++) {
1696 String keyA = "a" + i;
1697 String keyB = "b" + i;
1698 String keyC = "c" + i;
1699 String keyD = "d" + i;
1700 String valueA = "a" + (i + NUMBER_OF_TESTS - 1);
1701 String valueB = "b" + (i + NUMBER_OF_TESTS - 1);
1702 String valueC = "c" + (i + NUMBER_OF_TESTS - 1);
1703 String valueD = "d" + (i + NUMBER_OF_TESTS - 1);
1705 IoTString iKeyA = new IoTString(keyA);
1706 IoTString iKeyB = new IoTString(keyB);
1707 IoTString iKeyC = new IoTString(keyC);
1708 IoTString iKeyD = new IoTString(keyD);
1709 IoTString iValueA = new IoTString(valueA);
1710 IoTString iValueB = new IoTString(valueB);
1711 IoTString iValueC = new IoTString(valueC);
1712 IoTString iValueD = new IoTString(valueD);
1715 IoTString testValA1 = t1.getCommitted(iKeyA);
1716 IoTString testValB1 = t1.getCommitted(iKeyB);
1717 IoTString testValC1 = t1.getCommitted(iKeyC);
1718 IoTString testValD1 = t1.getCommitted(iKeyD);
1720 IoTString testValA2 = t2.getCommitted(iKeyA);
1721 IoTString testValB2 = t2.getCommitted(iKeyB);
1722 IoTString testValC2 = t2.getCommitted(iKeyC);
1723 IoTString testValD2 = t2.getCommitted(iKeyD);
1725 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1726 System.out.println("Key-Value t1 incorrect: " + keyA + " " + testValA1);
1730 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1731 System.out.println("Key-Value t1 incorrect: " + keyB + " " + testValB1);
1735 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1736 System.out.println("Key-Value t1 incorrect: " + keyC + " " + testValC1);
1740 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1741 System.out.println("Key-Value t1 incorrect: " + keyD + " " + testValD1);
1746 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1747 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1751 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1752 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1756 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1757 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1761 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1762 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1767 for (TransactionStatus status : transStatusList) {
1768 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1774 System.out.println("Found Errors...");
1776 System.out.println("No Errors Found...");
1780 static void test4() throws ServerException {
1782 boolean foundError = false;
1785 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1787 // Setup the 2 clients
1788 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1790 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1794 System.out.println("Setting up keys");
1795 startTime = System.currentTimeMillis();
1796 for (int i = 0; i < 4; i++) {
1801 IoTString ia = new IoTString(a);
1802 IoTString ib = new IoTString(b);
1803 IoTString ic = new IoTString(c);
1804 IoTString id = new IoTString(d);
1805 t1.createNewKey(ia, 321);
1806 t1.createNewKey(ib, 351);
1807 t2.createNewKey(ic, 321);
1808 t2.createNewKey(id, 351);
1810 endTime = System.currentTimeMillis();
1811 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
1812 System.out.println("Time Taken Per Key: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4)) );
1813 System.out.println();
1816 // Do Updates for the keys
1817 System.out.println("Setting Key-Values...");
1818 startTime = System.currentTimeMillis();
1819 for (int t = 0; t < NUMBER_OF_TESTS; t++) {
1820 for (int i = 0; i < 4; i++) {
1821 String keyA = "a" + i;
1822 String keyB = "b" + i;
1823 String keyC = "c" + i;
1824 String keyD = "d" + i;
1825 String valueA = "a" + i;
1826 String valueB = "b" + i;
1827 String valueC = "c" + i;
1828 String valueD = "d" + i;
1830 IoTString iKeyA = new IoTString(keyA);
1831 IoTString iKeyB = new IoTString(keyB);
1832 IoTString iKeyC = new IoTString(keyC);
1833 IoTString iKeyD = new IoTString(keyD);
1834 IoTString iValueA = new IoTString(valueA);
1835 IoTString iValueB = new IoTString(valueB);
1836 IoTString iValueC = new IoTString(valueC);
1837 IoTString iValueD = new IoTString(valueD);
1839 t1.startTransaction();
1840 t1.addKV(iKeyA, iValueA);
1841 transStatusList.add(t1.commitTransaction());
1843 t1.startTransaction();
1844 t1.addKV(iKeyB, iValueB);
1845 transStatusList.add(t1.commitTransaction());
1847 t2.startTransaction();
1848 t2.addKV(iKeyC, iValueC);
1849 transStatusList.add(t2.commitTransaction());
1851 t2.startTransaction();
1852 t2.addKV(iKeyD, iValueD);
1853 transStatusList.add(t2.commitTransaction());
1856 endTime = System.currentTimeMillis();
1857 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
1858 System.out.println("Time Taken Per Update: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 16)) );
1859 System.out.println();
1862 System.out.println("Updating Clients...");
1867 System.out.println("Checking Key-Values...");
1868 for (int i = 0; i < 4; i++) {
1870 String keyA = "a" + i;
1871 String keyB = "b" + i;
1872 String keyC = "c" + i;
1873 String keyD = "d" + i;
1874 String valueA = "a" + i;
1875 String valueB = "b" + i;
1876 String valueC = "c" + i;
1877 String valueD = "d" + i;
1879 IoTString iKeyA = new IoTString(keyA);
1880 IoTString iKeyB = new IoTString(keyB);
1881 IoTString iKeyC = new IoTString(keyC);
1882 IoTString iKeyD = new IoTString(keyD);
1883 IoTString iValueA = new IoTString(valueA);
1884 IoTString iValueB = new IoTString(valueB);
1885 IoTString iValueC = new IoTString(valueC);
1886 IoTString iValueD = new IoTString(valueD);
1889 IoTString testValA1 = t1.getCommitted(iKeyA);
1890 IoTString testValB1 = t1.getCommitted(iKeyB);
1891 IoTString testValC1 = t1.getCommitted(iKeyC);
1892 IoTString testValD1 = t1.getCommitted(iKeyD);
1894 IoTString testValA2 = t2.getCommitted(iKeyA);
1895 IoTString testValB2 = t2.getCommitted(iKeyB);
1896 IoTString testValC2 = t2.getCommitted(iKeyC);
1897 IoTString testValD2 = t2.getCommitted(iKeyD);
1899 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
1900 System.out.println("Key-Value t1 incorrect: " + keyA);
1904 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
1905 System.out.println("Key-Value t1 incorrect: " + keyB);
1909 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
1910 System.out.println("Key-Value t1 incorrect: " + keyC);
1914 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
1915 System.out.println("Key-Value t1 incorrect: " + keyD);
1920 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
1921 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
1925 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
1926 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
1930 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
1931 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
1935 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
1936 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
1941 for (TransactionStatus status : transStatusList) {
1942 if (status.getStatus() != TransactionStatus.StatusCommitted) {
1948 System.out.println("Found Errors...");
1950 System.out.println("No Errors Found...");
1954 static void test3() throws ServerException {
1958 boolean foundError = false;
1960 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
1962 // Setup the 2 clients
1963 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
1965 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
1970 System.out.println("Setting up keys");
1971 startTime = System.currentTimeMillis();
1972 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1977 IoTString ia = new IoTString(a);
1978 IoTString ib = new IoTString(b);
1979 IoTString ic = new IoTString(c);
1980 IoTString id = new IoTString(d);
1981 t1.createNewKey(ia, 321);
1982 t1.createNewKey(ib, 351);
1983 t2.createNewKey(ic, 321);
1984 t2.createNewKey(id, 351);
1986 endTime = System.currentTimeMillis();
1987 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
1988 System.out.println("Time Taken Per Key: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4)) );
1989 System.out.println();
1992 // Do Updates for the keys
1993 System.out.println("Setting Key-Values...");
1994 startTime = System.currentTimeMillis();
1996 System.out.println("B...");
1997 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
1998 String keyB = "b" + i;
1999 String valueB = "b" + i;
2001 IoTString iKeyB = new IoTString(keyB);
2002 IoTString iValueB = new IoTString(valueB);
2004 t1.startTransaction();
2005 t1.addKV(iKeyB, iValueB);
2006 transStatusList.add(t1.commitTransaction());
2009 System.out.println("C...");
2010 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2011 String keyC = "c" + i;
2012 String valueC = "c" + i;
2014 IoTString iKeyC = new IoTString(keyC);
2015 IoTString iValueC = new IoTString(valueC);
2017 t2.startTransaction();
2018 t2.addKV(iKeyC, iValueC);
2019 transStatusList.add(t2.commitTransaction());
2022 System.out.println("A, D...");
2023 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2024 String keyA = "a" + i;
2025 String keyD = "d" + i;
2026 String valueA = "a" + i;
2027 String valueD = "d" + i;
2029 IoTString iKeyA = new IoTString(keyA);
2030 IoTString iKeyD = new IoTString(keyD);
2031 IoTString iValueA = new IoTString(valueA);
2032 IoTString iValueD = new IoTString(valueD);
2034 t1.startTransaction();
2035 t1.addKV(iKeyA, iValueA);
2036 transStatusList.add(t1.commitTransaction());
2038 t2.startTransaction();
2039 t2.addKV(iKeyD, iValueD);
2040 transStatusList.add(t2.commitTransaction());
2042 endTime = System.currentTimeMillis();
2043 System.out.println("Time Taken: " + (double) ((endTime - startTime) / 1000.0) );
2044 System.out.println("Time Taken Per Update: " + (double) (((endTime - startTime) / 1000.0) / (NUMBER_OF_TESTS * 4)) );
2045 System.out.println();
2048 System.out.println("Updating Clients...");
2053 System.out.println("Checking Key-Values...");
2054 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2056 String keyA = "a" + i;
2057 String keyB = "b" + i;
2058 String keyC = "c" + i;
2059 String keyD = "d" + i;
2060 String valueA = "a" + i;
2061 String valueB = "b" + i;
2062 String valueC = "c" + i;
2063 String valueD = "d" + i;
2065 IoTString iKeyA = new IoTString(keyA);
2066 IoTString iKeyB = new IoTString(keyB);
2067 IoTString iKeyC = new IoTString(keyC);
2068 IoTString iKeyD = new IoTString(keyD);
2069 IoTString iValueA = new IoTString(valueA);
2070 IoTString iValueB = new IoTString(valueB);
2071 IoTString iValueC = new IoTString(valueC);
2072 IoTString iValueD = new IoTString(valueD);
2075 IoTString testValA1 = t1.getCommitted(iKeyA);
2076 IoTString testValB1 = t1.getCommitted(iKeyB);
2077 IoTString testValC1 = t1.getCommitted(iKeyC);
2078 IoTString testValD1 = t1.getCommitted(iKeyD);
2080 IoTString testValA2 = t2.getCommitted(iKeyA);
2081 IoTString testValB2 = t2.getCommitted(iKeyB);
2082 IoTString testValC2 = t2.getCommitted(iKeyC);
2083 IoTString testValD2 = t2.getCommitted(iKeyD);
2085 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
2086 System.out.println("Key-Value t1 incorrect: " + keyA);
2090 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
2091 System.out.println("Key-Value t1 incorrect: " + keyB);
2095 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
2096 System.out.println("Key-Value t1 incorrect: " + keyC);
2100 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
2101 System.out.println("Key-Value t1 incorrect: " + keyD);
2106 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
2107 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
2111 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
2112 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
2116 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
2117 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
2121 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
2122 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
2127 for (TransactionStatus status : transStatusList) {
2128 if (status.getStatus() != TransactionStatus.StatusCommitted) {
2134 System.out.println("Found Errors...");
2136 System.out.println("No Errors Found...");
2140 static void test2() throws ServerException {
2141 TimingSingleton timer = TimingSingleton.getInstance();
2143 boolean foundError = false;
2144 List<TransactionStatus> transStatusList = new ArrayList<TransactionStatus>();
2146 // Setup the 2 clients
2147 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
2149 System.out.println("T1 Ready");
2151 Table t2 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
2153 System.out.println("T2 Ready");
2156 System.out.println("Setting up keys");
2157 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2158 System.out.println(i);
2163 IoTString ia = new IoTString(a);
2164 IoTString ib = new IoTString(b);
2165 IoTString ic = new IoTString(c);
2166 IoTString id = new IoTString(d);
2167 t1.createNewKey(ia, 321);
2168 t1.createNewKey(ib, 351);
2169 t2.createNewKey(ic, 321);
2170 t2.createNewKey(id, 351);
2173 // Do Updates for the keys
2174 System.out.println("Setting Key-Values...");
2175 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2176 System.out.println(i);
2177 String keyA = "a" + i;
2178 String keyB = "b" + i;
2179 String keyC = "c" + i;
2180 String keyD = "d" + i;
2181 String valueA = "a" + i;
2182 String valueB = "b" + i;
2183 String valueC = "c" + i;
2184 String valueD = "d" + i;
2186 IoTString iKeyA = new IoTString(keyA);
2187 IoTString iKeyB = new IoTString(keyB);
2188 IoTString iKeyC = new IoTString(keyC);
2189 IoTString iKeyD = new IoTString(keyD);
2190 IoTString iValueA = new IoTString(valueA);
2191 IoTString iValueB = new IoTString(valueB);
2192 IoTString iValueC = new IoTString(valueC);
2193 IoTString iValueD = new IoTString(valueD);
2196 t1.startTransaction();
2197 t1.addKV(iKeyA, iValueA);
2198 transStatusList.add(t1.commitTransaction());
2199 t1.startTransaction();
2200 t1.addKV(iKeyB, iValueB);
2201 transStatusList.add(t1.commitTransaction());
2203 t2.startTransaction();
2204 t2.addKV(iKeyC, iValueC);
2205 transStatusList.add(t2.commitTransaction());
2207 t2.startTransaction();
2208 t2.addKV(iKeyD, iValueD);
2209 transStatusList.add(t2.commitTransaction());
2213 System.out.println("Updating Clients...");
2220 System.out.println("Checking Key-Values...");
2221 for (int i = 0; i < NUMBER_OF_TESTS; i++) {
2223 String keyA = "a" + i;
2224 String keyB = "b" + i;
2225 String keyC = "c" + i;
2226 String keyD = "d" + i;
2227 String valueA = "a" + i;
2228 String valueB = "b" + i;
2229 String valueC = "c" + i;
2230 String valueD = "d" + i;
2232 IoTString iKeyA = new IoTString(keyA);
2233 IoTString iKeyB = new IoTString(keyB);
2234 IoTString iKeyC = new IoTString(keyC);
2235 IoTString iKeyD = new IoTString(keyD);
2236 IoTString iValueA = new IoTString(valueA);
2237 IoTString iValueB = new IoTString(valueB);
2238 IoTString iValueC = new IoTString(valueC);
2239 IoTString iValueD = new IoTString(valueD);
2242 IoTString testValA1 = t1.getCommitted(iKeyA);
2243 IoTString testValB1 = t1.getCommitted(iKeyB);
2244 IoTString testValC1 = t1.getCommitted(iKeyC);
2245 IoTString testValD1 = t1.getCommitted(iKeyD);
2247 IoTString testValA2 = t2.getCommitted(iKeyA);
2248 IoTString testValB2 = t2.getCommitted(iKeyB);
2249 IoTString testValC2 = t2.getCommitted(iKeyC);
2250 IoTString testValD2 = t2.getCommitted(iKeyD);
2252 if ((testValA1 == null) || (testValA1.equals(iValueA) == false)) {
2253 System.out.println("Key-Value t1 incorrect: " + keyA);
2257 if ((testValB1 == null) || (testValB1.equals(iValueB) == false)) {
2258 System.out.println("Key-Value t1 incorrect: " + keyB);
2262 if ((testValC1 == null) || (testValC1.equals(iValueC) == false)) {
2263 System.out.println("Key-Value t1 incorrect: " + keyC);
2267 if ((testValD1 == null) || (testValD1.equals(iValueD) == false)) {
2268 System.out.println("Key-Value t1 incorrect: " + keyD);
2273 if ((testValA2 == null) || (testValA2.equals(iValueA) == false)) {
2274 System.out.println("Key-Value t2 incorrect: " + keyA + " " + testValA2);
2278 if ((testValB2 == null) || (testValB2.equals(iValueB) == false)) {
2279 System.out.println("Key-Value t2 incorrect: " + keyB + " " + testValB2);
2283 if ((testValC2 == null) || (testValC2.equals(iValueC) == false)) {
2284 System.out.println("Key-Value t2 incorrect: " + keyC + " " + testValC2);
2288 if ((testValD2 == null) || (testValD2.equals(iValueD) == false)) {
2289 System.out.println("Key-Value t2 incorrect: " + keyD + " " + testValD2);
2294 for (TransactionStatus status : transStatusList) {
2295 if (status.getStatus() != TransactionStatus.StatusCommitted) {
2297 System.out.println(status.getStatus());
2302 System.out.println("Found Errors...");
2304 System.out.println("No Errors Found...");
2307 // System.out.println();
2308 // System.out.println();
2311 // System.out.println();
2312 // System.out.println();