TestXrdClient.cc

Go to the documentation of this file.
00001 //       $Id: TestXrdClient.cc 30949 2009-11-02 16:37:58Z ganis $
00002 
00003 //const char *TestClientCVSID = "$Id: TestXrdClient.cc 30949 2009-11-02 16:37:58Z ganis $";
00004 // Simple keleton for simple tests of Xrdclient and XrdClientAdmin
00005 //
00006 
00007 #include "XrdClient/XrdClient.hh"
00008 #include "XrdClient/XrdClientAdmin.hh"
00009 #include "XrdClient/XrdClientEnv.hh"
00010 #include "XrdSys/XrdSysHeaders.hh"
00011 
00012 int main(int argc, char **argv) {
00013 
00014 //    EnvPutInt(NAME_DEBUG, 3);
00015   //EnvPutInt(NAME_READCACHESIZE, 100000000);
00016 
00017 
00018 //   XrdClient *x = new XrdClient(argv[1]);
00019 //   XrdClient *y = new XrdClient(argv[2]);
00020 //   x->Open(0, 0);
00021     
00022 //      for (int i = 0; i < 1000; i++)
00023 //        x->Copy("/tmp/testcopy");
00024   
00025 //   x->Close();
00026 
00027 //   delete x;
00028 //   x = 0;
00029    
00030 //   y->Open(0, 0);
00031   
00032 //      for (int i = 0; i < 1000; i++)
00033 //        x->Copy("/tmp/testcopy");
00034   
00035 //   y->Close();
00036   
00037 //   delete y;
00038 
00039   XrdClientUrlInfo u;
00040   XrdClientAdmin *adm = new XrdClientAdmin(argv[1]);
00041 
00042   adm->Connect();
00043 
00044    string s;
00045    int i = 0;
00046    XrdClientLocate_Info loc;
00047    while (!cin.eof()) {
00048      cin >> s;
00049 
00050      if (!s.size()) continue;
00051 
00052      if (!adm->Locate((kXR_char*)s.c_str(), loc)) {
00053        cout << endl <<
00054          " The server complained for file:" << endl <<
00055          s.c_str() << endl << endl;
00056      }
00057 
00058      if (!(i % 100)) cout << i << "...";
00059      i++;
00060 //     if (i == 9000) break;
00061    }
00062 
00063 //  vecString vs;
00064 //  XrdOucString os;
00065 // string s;
00066 //  int i = 0;
00067 //  while (!cin.eof()) {
00068 //    cin >> s;
00069 
00070 //    if (!s.size()) continue;
00071 
00072 //    os = s.c_str();
00073 //    vs.Push_back(os);
00074 
00075 //    if (!(i % 200)) {
00076 //      cout << i << "...";
00077 //      adm->Prepare(vs, kXR_stage, 0);
00078 //      vs.Clear();
00079 //    }
00080 
00081 //    i++;
00082 
00083 //  }
00084 
00085 
00086 
00087 //  adm->Prepare(vs, 0, 0);
00088 //  cout << endl << endl;
00089 
00090   delete adm;
00091 
00092       
00093 
00094 
00095 }

Generated on Tue Jul 5 14:46:16 2011 for ROOT_528-00b_version by  doxygen 1.5.1