diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-09 14:14:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 08:04:40 +0000 |
commit | 60b1c95cc47831246f097ee13dda8bcd71c57eb4 (patch) | |
tree | 8f8ede597a247c78f3742fa46ba9777b66edb76e /sw | |
parent | 50336412f775af154509d67b1ebbdb4b5feb147b (diff) |
Extract Directories from BootstrapFixtureBase
(as some tests derive from the latter only for the Directories part, not for the
setUp/tearDown overrides: those tests will be cleaned up next)
Change-Id: Ib6b78eea868b8bc21d4cc6e8fd9e1d025deca05f
Reviewed-on: https://gerrit.libreoffice.org/23078
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/filters-test.cxx | 26 | ||||
-rw-r--r-- | sw/qa/core/macros-test.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/globalfilter/globalfilter.cxx | 20 | ||||
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/mailmerge/mailmerge.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 6 |
8 files changed, 33 insertions, 33 deletions
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 4e484ea8322f..be2e774e712c 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -134,54 +134,54 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, void SwFiltersTest::testCVEs() { testDir("StarOffice XML (Writer)", - getURLFromSrc("/sw/qa/core/data/xml/"), + m_directories.getURLFromSrc("/sw/qa/core/data/xml/"), FILTER_XML, SfxFilterFlags::IMPORT | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT, isstorage, SOFFICE_FILEFORMAT_CURRENT); testDir("writer8", - getURLFromSrc("/sw/qa/core/data/odt/"), + m_directories.getURLFromSrc("/sw/qa/core/data/odt/"), FILTER_XML, SfxFilterFlags::IMPORT | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT, isstorage, SOFFICE_FILEFORMAT_CURRENT); testDir("MS Word 97", - getURLFromSrc("/sw/qa/core/data/ww8/"), + m_directories.getURLFromSrc("/sw/qa/core/data/ww8/"), FILTER_WW8); testDir("MS WinWord 6.0", - getURLFromSrc("/sw/qa/core/data/ww6/"), + m_directories.getURLFromSrc("/sw/qa/core/data/ww6/"), sWW6); testDir("MS WinWord 5", - getURLFromSrc("/sw/qa/core/data/ww5/"), + m_directories.getURLFromSrc("/sw/qa/core/data/ww5/"), sWW5); testDir("Text (encoded)", - getURLFromSrc("/sw/qa/core/data/txt/"), + m_directories.getURLFromSrc("/sw/qa/core/data/txt/"), FILTER_TEXT_DLG); testDir("MS Word 2007 XML", - getURLFromSrc("/sw/qa/core/data/ooxml/"), + m_directories.getURLFromSrc("/sw/qa/core/data/ooxml/"), OUString(), SfxFilterFlags::STARONEFILTER); testDir("Rich Text Format", - getURLFromSrc("/sw/qa/core/data/rtf/"), + m_directories.getURLFromSrc("/sw/qa/core/data/rtf/"), OUString(), SfxFilterFlags::STARONEFILTER); testDir("HTML", - getURLFromSrc("/sw/qa/core/data/html/"), + m_directories.getURLFromSrc("/sw/qa/core/data/html/"), sHTML); testDir("T602Document", - getURLFromSrc("/sw/qa/core/data/602/"), + m_directories.getURLFromSrc("/sw/qa/core/data/602/"), OUString(), SfxFilterFlags::STARONEFILTER); testDir("Rich Text Format", - getURLFromSrc("/sw/qa/core/exportdata/rtf/"), + m_directories.getURLFromSrc("/sw/qa/core/exportdata/rtf/"), OUString(), SfxFilterFlags::STARONEFILTER, SotClipboardFormatId::NONE, @@ -189,7 +189,7 @@ void SwFiltersTest::testCVEs() /*bExport=*/true); testDir("HTML", - getURLFromSrc("/sw/qa/core/exportdata/html/"), + m_directories.getURLFromSrc("/sw/qa/core/exportdata/html/"), sHTML, SfxFilterFlags::NONE, SotClipboardFormatId::NONE, @@ -197,7 +197,7 @@ void SwFiltersTest::testCVEs() /*bExport=*/true); testDir("MS Word 2007 XML", - getURLFromSrc("/sw/qa/core/exportdata/ooxml/"), + m_directories.getURLFromSrc("/sw/qa/core/exportdata/ooxml/"), OUString(), SfxFilterFlags::STARONEFILTER, SotClipboardFormatId::NONE, diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 3a5453aa6e06..8b465c5a24cd 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -116,7 +116,7 @@ private: void SwMacrosTest::createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath) { OUString aSep("/"); - OUStringBuffer aBuffer( getSrcRootURL() ); + OUStringBuffer aBuffer( m_directories.getSrcRootURL() ); aBuffer.append(m_aBaseString).append(aSep).append(aFileExtension); aBuffer.append(aSep).append(aFileBase).append(aFileExtension); rFilePath = aBuffer.makeStringAndClear(); diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 54f2c1518ae8..2ac43bf6a26e 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -73,7 +73,7 @@ void Test::testSwappedOutImageExport() if (mxComponent.is()) mxComponent->dispose(); - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/document_with_two_images.odt"), "com.sun.star.text.TextDocument"); + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/document_with_two_images.odt"), "com.sun.star.text.TextDocument"); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -149,7 +149,7 @@ void Test::testLinkedGraphicRT() { if (mxComponent.is()) mxComponent->dispose(); - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/document_with_linked_graphic.odt"), "com.sun.star.text.TextDocument"); + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/document_with_linked_graphic.odt"), "com.sun.star.text.TextDocument"); const OString sFailedMessage = OString("Failed on filter: ") + OUStringToOString(aFilterNames[nFilter], RTL_TEXTENCODING_ASCII_US); @@ -219,7 +219,7 @@ void Test::testImageWithSpecialID() { if (mxComponent.is()) mxComponent->dispose(); - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/images_with_special_IDs.odt"), "com.sun.star.text.TextDocument"); + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/images_with_special_IDs.odt"), "com.sun.star.text.TextDocument"); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -300,7 +300,7 @@ void Test::testGraphicShape() { if (mxComponent.is()) mxComponent->dispose(); - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/graphic_shape.odt"), "com.sun.star.text.TextDocument"); + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/graphic_shape.odt"), "com.sun.star.text.TextDocument"); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -382,7 +382,7 @@ void Test::testCharHighlightBody() { if (mxComponent.is()) mxComponent->dispose(); - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/char_highlight.docx"), + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/char_highlight.docx"), "com.sun.star.text.TextDocument"); const OString sFailedMessage = OString("Failed on filter: ") + aFilterNames[nFilter]; @@ -477,7 +477,7 @@ void Test::testCharHighlight() void Test::testCharHighlightODF() { - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/char_background_editing.docx"), + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/char_background_editing.docx"), "com.sun.star.text.TextDocument"); // don't check import, testMSCharBackgroundEditing already does that @@ -570,7 +570,7 @@ void Test::testMSCharBackgroundEditing() if (mxComponent.is()) mxComponent->dispose(); - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/char_background_editing.docx"), + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/char_background_editing.docx"), "com.sun.star.text.TextDocument"); const OString sFailedMessage = OString("Failed on filter: ") + aFilterNames[nFilter]; @@ -683,7 +683,7 @@ void Test::testCharBackgroundToHighlighting() { if (mxComponent.is()) mxComponent->dispose(); - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/globalfilter/data/char_background.odt"), + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("/sw/qa/extras/globalfilter/data/char_background.odt"), "com.sun.star.text.TextDocument"); OString sFailedMessage = OString("Failed on filter: ") + aFilterNames[nFilter]; @@ -768,10 +768,10 @@ void Test::testSkipImages() args[0].Handle = -1; args[0].Value <<= OUString::createFromAscii(aFilterNames[nFilter][1]); args[0].State = beans::PropertyState_DIRECT_VALUE; - mxComponent = loadFromDesktop(getURLFromSrc(aFilterNames[nFilter][0]), "com.sun.star.text.TextDocument", args); + mxComponent = loadFromDesktop(m_directories.getURLFromSrc(aFilterNames[nFilter][0]), "com.sun.star.text.TextDocument", args); sFailedMessage = sFailedMessage + " - " + aFilterNames[nFilter][1]; } else - mxComponent = loadFromDesktop(getURLFromSrc(aFilterNames[nFilter][0]), "com.sun.star.text.TextDocument"); + mxComponent = loadFromDesktop(m_directories.getURLFromSrc(aFilterNames[nFilter][0]), "com.sun.star.text.TextDocument"); // Check shapes (images, textboxes, custom shapes) uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 424f03e078c7..c92a125570a1 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -609,7 +609,7 @@ protected: void load(const char* pDir, const char* pName) { - return loadURL(getURLFromSrc(pDir) + OUString::createFromAscii(pName), pName); + return loadURL(m_directories.getURLFromSrc(pDir) + OUString::createFromAscii(pName), pName); } void loadURL(OUString const& rURL, const char* pName) diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index c74115950e7b..c54998afe182 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -74,7 +74,7 @@ public: utl::TempFile aTempDir(nullptr, true); const OUString aWorkDir = aTempDir.GetURL(); - const OUString aURI( getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(datasource) ); + const OUString aURI( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(datasource) ); OUString aDBName = registerDBsource( aURI, aWorkDir ); initMailMergeJobAndArgs( filename, tablename, aDBName, "LOMM_", aWorkDir, file ); @@ -118,7 +118,7 @@ public: seq_id = 0; mSeqMailMergeArgs[ seq_id++ ] = beans::NamedValue( OUString( UNO_NAME_OUTPUT_TYPE ), uno::Any( file ? text::MailMergeType::FILE : text::MailMergeType::SHELL ) ); mSeqMailMergeArgs[ seq_id++ ] = beans::NamedValue( OUString( UNO_NAME_DOCUMENT_URL ), uno::Any( - ( OUString(getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)) ) ) ); + ( OUString(m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)) ) ) ); mSeqMailMergeArgs[ seq_id++ ] = beans::NamedValue( OUString( UNO_NAME_DATA_SOURCE_NAME ), uno::Any( aDBName ) ); mSeqMailMergeArgs[ seq_id++ ] = beans::NamedValue( OUString( UNO_NAME_OUTPUT_URL ), uno::Any( aWorkDir ) ); mSeqMailMergeArgs[ seq_id++ ] = beans::NamedValue( OUString( UNO_NAME_FILE_NAME_PREFIX ), uno::Any( aPrefix )); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f7be78bdef8a..0ac923ba6ea3 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -112,7 +112,7 @@ protected: uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance("com.sun.star.comp.Writer.WriterFilter"), uno::UNO_QUERY_THROW); uno::Reference<document::XImporter> xImporter(xFilter, uno::UNO_QUERY_THROW); xImporter->setTargetDocument(mxComponent); - SvStream* pStream = utl::UcbStreamHelper::CreateStream(getURLFromSrc("/sw/qa/extras/ooxmlimport/data/") + rFilename, StreamMode::READ); + SvStream* pStream = utl::UcbStreamHelper::CreateStream(m_directories.getURLFromSrc("/sw/qa/extras/ooxmlimport/data/") + rFilename, StreamMode::READ); uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence( { @@ -138,7 +138,7 @@ public: std::cout << filename << ","; mnStartTime = osl_getGlobalTimer(); { - OUString aURL(getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)); + OUString aURL(m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)); CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is()); uno::Reference<frame::XComponentLoader> xLoader(mxDesktop, uno::UNO_QUERY); CPPUNIT_ASSERT_MESSAGE("no loader", xLoader.is()); diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index d98b9b9ccd62..f8193cdef6b0 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -105,7 +105,7 @@ protected: xImporter->setTargetDocument(mxComponent); uno::Sequence<beans::PropertyValue> aDescriptor(xTextRange.is() ? 3 : 2); aDescriptor[0].Name = "InputStream"; - SvStream* pStream = utl::UcbStreamHelper::CreateStream(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + aFilename, StreamMode::WRITE); + SvStream* pStream = utl::UcbStreamHelper::CreateStream(m_directories.getURLFromSrc("/sw/qa/extras/rtfimport/data/") + aFilename, StreamMode::WRITE); uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); aDescriptor[0].Value <<= xStream; aDescriptor[1].Name = "InsertMode"; diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index fced549e4585..69a78276ce23 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -989,7 +989,7 @@ void SwUiWriterTest::testMergeDoc() SwDoc* const pDoc1(createDoc("merge-change1.odt")); auto xDoc2Component(loadFromDesktop( - getURLFromSrc(DATA_DIRECTORY) + "merge-change2.odt", + m_directories.getURLFromSrc(DATA_DIRECTORY) + "merge-change2.odt", "com.sun.star.text.TextDocument")); auto pxDoc2Document( dynamic_cast<SwXTextDocument *>(xDoc2Component.get())); @@ -1707,7 +1707,7 @@ void SwUiWriterTest::testTdf69282WithMirror() void SwUiWriterTest::testTdf78742() { //testing with service type and any .ods file - OUString path = getURLFromSrc(DATA_DIRECTORY) + "calc-data-source.ods"; + OUString path = m_directories.getURLFromSrc(DATA_DIRECTORY) + "calc-data-source.ods"; SfxMedium aMedium(path, StreamMode::READ | StreamMode::SHARE_DENYWRITE); SfxFilterMatcher aMatcher(OUString("com.sun.star.text.TextDocument")); const SfxFilter* pFilter = nullptr; @@ -1724,7 +1724,7 @@ void SwUiWriterTest::testTdf78742() //Filter should be returned with proper Name CPPUNIT_ASSERT_EQUAL(OUString("calc8"), pFilter2->GetFilterName()); //testing with service type and any .odt file - OUString path2 = getURLFromSrc(DATA_DIRECTORY) + "fdo69893.odt"; + OUString path2 = m_directories.getURLFromSrc(DATA_DIRECTORY) + "fdo69893.odt"; SfxMedium aMedium3(path2, StreamMode::READ | StreamMode::SHARE_DENYWRITE); SfxFilterMatcher aMatcher3(OUString("com.sun.star.text.TextDocument")); const SfxFilter* pFilter3 = nullptr; |