3 #include "TimingSingleton.h"
4 #include "TransactionStatus.h"
6 #define NUMBER_OF_TESTS 1
9 int main(int numargs, char ** args) {
10 TimingSingleton * timer = TimingSingleton_getInstance();
12 bool foundError = false;
13 Vector<TransactionStatus *> * transStatusList = new Vector<TransactionStatus *>();
15 // Setup the 2 clients
16 IoTString *baseurl = new IoTString("http://dc-6.calit2.uci.edu/test.iotcloud/");
17 IoTString * password = new IoTString("reallysecret");
18 Table * t1 = new Table(baseurl, password, MACHINE_ID, -1);
23 baseurl->releaseRef();
24 password->releaseRef();
26 printf("Checking Key-Values...\n");
28 sprintf(buffer, "sensor0");
29 IoTString * iKeyA = new IoTString(buffer);
30 IoTString *testValA1 = t1->getCommitted(iKeyA);
32 if (testValA1 == NULL) {
33 printf("\n\nKEY-VALUE A is NULL!\n\n");
36 printf("Printing value... ");
42 testValA1->releaseRef();
44 for (uint i = 0; i < transStatusList->size(); i++) {
45 TransactionStatus * status = transStatusList->get(i);
46 if (status->getStatus() != TransactionStatus_StatusCommitted) {
48 printf("Status error\n");
54 printf("Found Errors...\n");
56 printf("No Errors Found...\n");
59 delete transStatusList;