#define BOOST_TEST_MODULE TestIceTray #include #include #include #include "testIceTrayServiceI.h" #include #include #include #include #include class Service : public IceTray::DryIce, PQ::Mock { public: Service() : PQ::Mock("user=postgres dbname=postgres", "icetraydb", { rootDir / "testIceTrayService.sql" }) { } }; BOOST_GLOBAL_FIXTURE( Service ); class Client : public IceTray::DryIceClient { public: Client() : p(getProxy("test")) { } TestIceTray::TestIceTrayServicePrx 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_SUITE_END(); BOOST_AUTO_TEST_CASE( sqlModify ) { auto db = DB::MockDatabase::openConnectionTo("icetraydb"); BOOST_REQUIRE(db); BOOST_REQUIRE(TestIceTray::sql::testIceTrayServiceTestSql.modify(db)); delete db; }