Test.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include "Test.h"
  2. #include <iostream>
  3. #include "../../TestWalker/MSClient.h"
  4. ConnectTest::ConnectTest()
  5. {
  6. ok = 0;
  7. }
  8. void ConnectTest::init()
  9. {
  10. std::cout << "starting connection Test\n";
  11. }
  12. void ConnectTest::run()
  13. {/*
  14. bool ok = 1;
  15. MSClient msc;
  16. std::cout << "\x1...Main Server...\x1\n";
  17. if( !msc.registerSSL() )
  18. {
  19. ok = 0;
  20. std::cerr << "client registration failed " __FILE__ ":" << __LINE__ << "\n";
  21. return;
  22. }
  23. std::cout << "\x1...Erhaltung Server...\x1\n";
  24. ESClient *esc = msc.createErhaltungServerClient();
  25. if( !esc )
  26. {
  27. ok = 0;
  28. std::cerr << "no Erhaltung Server available " __FILE__ ":" << __LINE__ << "\n";
  29. }
  30. else
  31. {
  32. if( !esc->verbinden() )
  33. {
  34. ok = 0;
  35. std::cerr << "no connection to Erhaltung Server " __FILE__ ":" << __LINE__ << "\n";
  36. }
  37. }
  38. std::cout << "\x1...Patch Server...\x1\n";
  39. PSClient *psc = msc.createPatchServerClient();
  40. if( !psc )
  41. {
  42. ok = 0;
  43. std::cerr << "no Patch Server available " __FILE__ ":" << __LINE__ << "\n";
  44. }
  45. else
  46. {
  47. if( !psc->verbinde() )
  48. {
  49. ok = 0;
  50. std::cerr << "no connection to Patch Server " __FILE__ ":" << __LINE__ << "\n";
  51. }
  52. }
  53. // TODO
  54. std::cout << "\x1...Abmeldung beim Server...\x1\n";
  55. if( psc )
  56. {
  57. if( !psc->trenne( 1 ) )
  58. {
  59. ok = 0;
  60. std::cerr << "unable to close connection to Patch Server " __FILE__ ":" << __LINE__ << "\n";
  61. }
  62. psc->release();
  63. }
  64. if( esc )
  65. esc->release();
  66. if( !msc.unregister() )
  67. {
  68. ok = 0;
  69. std::cerr << "client unregistration failed " __FILE__ ":" << __LINE__ << "\n";
  70. }
  71. this->ok = ok;*/
  72. Network::SSLKlient *c = new Network::SSLKlient();
  73. c->release();
  74. Network::SSLKlient *c2 = new Network::SSLKlient();
  75. c2->release();
  76. }
  77. bool ConnectTest::failed()
  78. {
  79. return !ok;
  80. }
  81. void ConnectTest::destroy()
  82. {
  83. delete this;
  84. }