// // Copyright (c) ZeroC, Inc. All rights reserved. // #ifndef TEST_CONTROLLER_H #define TEST_CONTROLLER_H #include #include #include #include struct SessionTuple { std::shared_ptr session; std::shared_ptr sessionControl; bool configured = false; SessionTuple() = default; SessionTuple(std::shared_ptr s, std::shared_ptr control): session(move(s)), sessionControl(move(control)), configured(false) { } SessionTuple(const SessionTuple&) = delete; SessionTuple& operator=(const SessionTuple&) = default; SessionTuple(SessionTuple&&) = default; }; /* * The test controller manipulates the router's filter tables for this session. */ struct TestCase { std::string proxy; bool expectedResult; TestCase(const std::string& s, const bool b) : proxy(s), expectedResult(b) {} }; struct TestConfiguration { std::string description; std::vector cases; std::vector categoryFiltersAccept; std::vector adapterIdFiltersAccept; std::vector objectIdFiltersAccept; }; // // The test controller acts like a test server of sorts. It manages the // configuration of the test's session and provides the client with test // cases and expected outcomes. // class TestControllerI final : public Test::TestController { public: TestControllerI(const std::string&); void step(std::shared_ptr currentSession, Test::TestToken currentState, Test::TestToken& newState, const Ice::Current&) override; void shutdown(const Ice::Current&) override; // // Internal methods. // void addSession(SessionTuple&&); void notifyDestroy(const std::shared_ptr&); private: std::vector _sessions; std::vector _configurations; }; #endif