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, "humid0");
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... ");
40 sprintf(buffer, "tempF0");
41 IoTString * iKeyB = new IoTString(buffer);
42 IoTString * testValB1 = t1->getCommitted(iKeyB);
44 if (testValA1 == NULL) {
45 printf("\n\nKEY-VALUE B is NULL!\n\n");
48 printf("Printing value... ");
54 testValA1->releaseRef();
56 testValB1->releaseRef();
58 for (uint i = 0; i < transStatusList->size(); i++) {
59 TransactionStatus * status = transStatusList->get(i);
60 if (status->getStatus() != TransactionStatus_StatusCommitted) {
62 printf("Status error\n");
68 printf("Found Errors...\n");
70 printf("No Errors Found...\n");
73 delete transStatusList;