diff --git a/framework/CppunitTest_framework_dispatch.mk b/framework/CppunitTest_framework_dispatch.mk index 2a239030d6d2..b9571ebe3ad4 100644 --- a/framework/CppunitTest_framework_dispatch.mk +++ b/framework/CppunitTest_framework_dispatch.mk @@ -21,6 +21,9 @@ $(eval $(call gb_CppunitTest_use_libraries,framework_dispatch, \ cppuhelper \ fwk \ sal \ + subsequenttest \ + utl \ + tl \ test \ unotest \ )) diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx index b0d873e61bbf..f45f0da5bf0e 100644 --- a/framework/qa/cppunit/dispatchtest.cxx +++ b/framework/qa/cppunit/dispatchtest.cxx @@ -8,8 +8,7 @@ */ #include -#include -#include +#include #include #include @@ -133,31 +132,15 @@ uno::Reference MyInterceptor::queryDispatch(const util::URL& r } /// Tests how InterceptionHelper invokes a registered interceptor. -class DispatchTest : public test::BootstrapFixture, public unotest::MacrosTest +class DispatchTest : public UnoApiTest { -protected: - uno::Reference mxComponent; - public: - virtual void setUp() override; - virtual void tearDown() override; + DispatchTest() + : UnoApiTest("/framework/qa/cppunit/data/") + { + } }; -void DispatchTest::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(mxComponentContext)); -} - -void DispatchTest::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception) { mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); @@ -180,13 +163,10 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception) CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected()); } -constexpr OUStringLiteral DATA_DIRECTORY = u"/framework/qa/cppunit/data/"; - CPPUNIT_TEST_FIXTURE(DispatchTest, testSfxOfficeDispatchDispose) { // this test doesn't work with a new document because of aURL.Main check in SfxBaseController::dispatch() - mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.fodp", - "com.sun.star.presentation.PresentationDocument"); + loadFromURL(u"empty.fodp"); uno::Reference xModel(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xModel.is()); uno::Reference xController(xModel->getCurrentController());