Dynamic lib selection and deployment
[anna.git] / example / diameter / launcher / testing / TestCase.hpp
index ab8e4a3..b55abd7 100644 (file)
@@ -31,7 +31,7 @@ namespace anna {
   }
 }
 
-class RealmNode;
+class OriginHost;
 
 
 class TestCase {
@@ -57,7 +57,7 @@ public:
     anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
   };
 
-  TestCase(unsigned int id) : a_id(id), a_state(State::Initialized), a_startTime(0), a_interactiveAmount(-1) { /*a_stepsIt = a_steps.end()*/;}
+  TestCase(unsigned int id);
   ~TestCase();
 
   struct State { enum _v { Initialized, InProgress, Failed, Success }; };
@@ -83,8 +83,8 @@ public:
 
   // Step type & information
   void addTimeout(const anna::Millisecond &timeout) throw(anna::RuntimeException);
-  void addSendxml2e(const anna::DataBlock &db, RealmNode *realm, int stepNumber) throw(anna::RuntimeException);
-  void addSendxml2c(const anna::DataBlock &db, RealmNode *realm, int stepNumber) throw(anna::RuntimeException);
+  void addSendxml2e(const anna::DataBlock &db, OriginHost *host, int stepNumber) throw(anna::RuntimeException);
+  void addSendxml2c(const anna::DataBlock &db, OriginHost *host, int stepNumber) throw(anna::RuntimeException);
   void addDelay(const anna::Millisecond &delay) throw(anna::RuntimeException);
   void addWait(bool fromEntity,
                 const std::string &code, const std::string &bitR, const std::string &hopByHop, const std::string &applicationId,
@@ -109,7 +109,7 @@ public:
 
   //helpers
   int steps() const throw() { return a_steps.size(); }
-  void addStep(TestStep *step) throw() { a_steps[1+steps()] = step; }
+  void addStep(TestStep *step) throw() { a_steps.push_back(step); }
 
   TestStepWait *searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) throw();
       // When a message arrives, we identify the test case by mean the Session-Id. Then, from the current step iterator (included),
@@ -123,8 +123,8 @@ public:
 private:
   // private members:
   unsigned int a_id;
-  std::map<int/* step number*/, TestStep*> a_steps;
-  std::map<int/* step number*/, TestStep*>::const_iterator a_stepsIt;
+  std::vector<TestStep*> a_steps;
+  std::vector<TestStep*>::const_iterator a_stepsIt;
   std::map<anna::diameter::HopByHop, TestStep*> a_hopByHops; // for wait-answer
   State::_v a_state;
   anna::Millisecond a_startTime;