#define BOOST_TEST_MODULE TestIceTray #include #include "testIceTrayServiceI.h" #include #include #include #include #include #include #include class Service : public IceTray::DryIce, DB::PluginMock { public: Service() : DB::PluginMock("icetraydb", {rootDir / "testIceTrayService.sql"}, "user=postgres dbname=postgres") { } }; BOOST_GLOBAL_FIXTURE(Service); class Client : public IceTray::DryIceClient { public: Client() : p(getProxy("test")) { } TestIceTray::TestIceTrayServicePrxPtr p; }; BOOST_FIXTURE_TEST_SUITE(client, Client); BOOST_AUTO_TEST_CASE(services) { BOOST_REQUIRE(p); BOOST_REQUIRE(IceTray::Service::getCurrent()); p->ice_ping(); p->method1(); p->method2(1, "test"); } BOOST_AUTO_TEST_CASE(cube_services_proxy) { auto prx = IceTray::Cube::get(); BOOST_REQUIRE(prx); prx->ice_ping(); prx->method1(); prx->method2(1, "test"); } BOOST_AUTO_TEST_CASE(cube_services_local) { auto ptr = IceTray::Cube::get(); BOOST_REQUIRE(ptr); ptr->method1(); ptr->method2(1, "test"); } BOOST_AUTO_TEST_CASE(getIceComponents) { BOOST_REQUIRE(getService()); BOOST_REQUIRE(getAdapter()); } BOOST_AUTO_TEST_SUITE_END(); BOOST_AUTO_TEST_CASE(sqlModify) { auto db = DB::MockDatabase::openConnectionTo("icetraydb"); BOOST_REQUIRE(db); BOOST_REQUIRE(TestIceTray::sql::testIceTrayServiceTestSql.modify(db.get())); }