ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/DBS/Servers/AppServer/test/ClientTest.cpp
Revision: 1.1.1.1 (vendor branch)
Committed: Mon Oct 31 22:10:36 2005 UTC (19 years, 6 months ago) by afaq
Branch: v00, MAIN
CVS Tags: DBS_0_0_3a, DBS_0_0_3, DBS_0_0_2, DBS_0_0_1, pre_DBS_0_0_1, post_dict_type_checking_merge, post_MiniPythonAPI_merged_to_trunk, pre_MiniPythonAPI_merge_to_trunk, DBS_0_0_0, vs20060320, AfterJan2006SchemaChanges_v01_00_01, AfterJan2006SchemaChanges_v01_00_00, AfterJan2006SchemaChanges, BeforeJan2006SchemaChanges, before_message_removal, preXOverChanges, start, HEAD
Branch point for: BranchForCPPWebServiceTesting
Changes since 1.1: +0 -0 lines
Error occurred while calculating annotation data.
Log Message:
Adding Server code to the repository

File Contents

# Content
1 #include <iostream>
2 #include "DBSClient.hpp"
3 #include <exception>
4 #include "ClientAPIData.hpp"
5 using namespace std;
6
7 int main() {
8 DBSClient* dbsclient = new DBSClient();
9 vector<Evcollview_ClientAPIData*>
10 Evcollview_ClientAPIData::Evcollview_ClientAPIData(){
11
12 Schema.insert(Entry("status", "INTEGER"));
13 Schema.insert(Entry("validation_status", "INTEGER"));
14 Schema.insert(Entry("modified_by", "INTEGER"));
15 Schema.insert(Entry("name", "STRING"));
16 Schema.insert(Entry("processed_dataset", "INTEGER"));
17 Schema.insert(Entry("created_at", "FLOAT"));
18 Schema.insert(Entry("modified_at", "FLOAT"));
19 Schema.insert(Entry("created_by", "INTEGER"));
20 Schema.insert(Entry("events", "INTEGER"));
21 Schema.insert(Entry("collection_index", "INTEGER"));
22 Schema.insert(Entry("event_collection", "INTEGER"));
23 Schema.insert(Entry("id", "INTEGER"));
24 Schema.insert(Entry("estimated_luminosity", "STRING"));
25
26 }
27
28 int main() {
29 DBSClient* dbsclient = new DBSClient();
30 vector<Primarydataset_ClientAPIData*> primaryDatasetInfo;
31 typedef vector<Primarydataset_ClientAPIData*>::iterator PrimaryDatasetInfoIter;
32 try {
33 dbsclient->readPrimaryDataset(primaryDatasetInfo);
34 } catch (exception &ex) {
35 cout << ex.what() << endl;
36 }
37 delete dbsclient;
38 cout<<"Total number of structs returned "<<primaryDatasetInfo.size()<<endl;
39 for(PrimaryDatasetInfoIter i = primaryDatasetInfo.begin(); i != primaryDatasetInfo.end(); ++i) {
40 cout<<"\n********************************************************************************"<<endl;
41 cout<<"mcchanneldescription "<<(*i)->mcchanneldescription.getValue()<<endl;
42 cout<<"abstractdatasetannotation "<<(*i)->abstractdatasetannotation.getValue()<<endl;
43 cout<<"triggerdescriptionid "<<(*i)->triggerdescriptionid.getValue()<<endl;
44 cout<<"mcproduction "<<(*i)->mcproduction.getValue()<<endl;
45 cout<<"abstractdatasetdescriptionid "<<(*i)->abstractdatasetdescriptionid.getValue()<<endl;
46 cout<<"streamid "<<(*i)->streamid.getValue()<<endl;
47 cout<<"triggerpathdescriptionid "<<(*i)->triggerpathdescriptionid.getValue()<<endl;
48 //cout<<"startdate "<<(*i)->startdate.getValue()<<endl;
49 cout<<"mcdescriptionid "<<(*i)->mcdescriptionid.getValue()<<endl;
50 cout<<"cobradatasetname "<<(*i)->cobradatasetname.getValue()<<endl;
51 cout<<"mcchanneldescriptionid "<<(*i)->mcchanneldescriptionid.getValue()<<endl;
52 cout<<"mcdecaychain "<<(*i)->mcdecaychain.getValue()<<endl;
53 cout<<"streamannotation "<<(*i)->streamannotation.getValue()<<endl;
54 cout<<"primarydatasetid "<<(*i)->primarydatasetid.getValue()<<endl;
55 //cout<<"physicsgroupconvener "<<(*i)->physicsgroupconvener.getValue()<<endl;
56 cout<<"physicsgroupid "<<(*i)->physicsgroupid.getValue()<<endl;
57 cout<<"openforwriting "<<(*i)->openforwriting.getValue()<<endl;
58 cout<<"triggerpathdescription "<<(*i)->triggerpathdescription.getValue()<<endl;
59 //cout<<"enddate "<<(*i)->enddate.getValue()<<endl;
60 cout<<"streamname "<<(*i)->streamname.getValue()<<endl;
61 cout<<"mcdataset "<<(*i)->mcdataset.getValue()<<endl;
62 cout<<"physicsgroupname "<<(*i)->physicsgroupname.getValue()<<endl;
63 cout<<"abstractdatasetname "<<(*i)->abstractdatasetname.getValue()<<endl;
64 cout<<"********************************************************************************\n"<<endl;
65 delete *i;
66 }
67
68
69 }
70
71
72 int maina() {
73
74 cout << "Client test" << endl;
75 DBSClient* dbsclient = new DBSClient();
76 Primarydataset_ClientAPIData primaryDatasetInfo;
77
78
79 primaryDatasetInfo.mcchanneldescription = (string)"Some Description pata nahee";
80 primaryDatasetInfo.mcdecaychain = (string)"Some Decay pata nahee";
81 primaryDatasetInfo.mcproduction = (string)"Who knows pata nahee";
82 primaryDatasetInfo.triggerpathdescription = (string)"kia aur kioun pata nahee";
83 primaryDatasetInfo.streamannotation = (string)"No comments please pata nahee";
84 primaryDatasetInfo.cobradatasetname = (string)"AnacondaPataNahee";
85 primaryDatasetInfo.abstractdatasetannotation = (string)"Annotation what ? Pata Nahee";
86 primaryDatasetInfo.physicsgroupname = (string)"GroupOfItsOwnPataNahee";
87 primaryDatasetInfo.streamname = (string)"StreamingLivePataNahee";
88 primaryDatasetInfo.abstractdatasetname = (string)"MyFirstPrimaryDatasetPataNahee";
89 primaryDatasetInfo.mcdataset = 'y';
90
91 try {
92 dbsclient->createPrimaryDataset((string)"MyFirstPrimaryDatasetPataNahee", primaryDatasetInfo);
93 } catch (exception &ex) {
94 cout << ex.what() << endl;
95 }
96 delete dbsclient;
97
98
99 }