Author: damjan Date: Wed Feb 24 01:11:29 2016 New Revision: 1731999 URL: http://svn.apache.org/viewvc?rev=1731999&view=rev Log: Merge r1409433 from branches/gbuild: writerfilter10: make JUnitTest run
BUILDS, but the test doesn't compile/run though (org.openoffice.test.OfficeConnection missing) Build updates by: me Modified: openoffice/branches/gbuild-reintegration/ (props changed) openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/LoadDocuments.java openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/makefile.mk Propchange: openoffice/branches/gbuild-reintegration/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Feb 24 01:11:29 2016 @@ -1,4 +1,4 @@ -/incubator/ooo/branches/gbuild:1409313-1409425,1409428,1409432,1409470 +/incubator/ooo/branches/gbuild:1409313-1409425,1409428,1409432-1409433,1409470 /openoffice/branches/AOO400:1503684 /openoffice/branches/AOO410:1572480,1573601,1583349,1583635,1583666 /openoffice/branches/alg_writerframes:1556289-1579189 Modified: openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/LoadDocuments.java URL: http://svn.apache.org/viewvc/openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/LoadDocuments.java?rev=1731999&r1=1731998&r2=1731999&view=diff ============================================================================== --- openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/LoadDocuments.java (original) +++ openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/LoadDocuments.java Wed Feb 24 01:11:29 2016 @@ -21,10 +21,20 @@ package complex.ooxml; + +import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; import complexlib.ComplexTestCase; import java.io.File; -import com.sun.star.text.XTextDocument; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.Argument; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; /* * To change this template, choose Tools | Templates @@ -35,38 +45,54 @@ import com.sun.star.text.XTextDocument; * * @author hb137859 */ -public class LoadDocuments extends ComplexTestCase { - private XMultiServiceFactory m_xMSF; - - @Override - public String[] getTestMethodNames() { - return new String [] { - "test1" - }; - } - - public void before() throws Exception { - m_xMSF = (XMultiServiceFactory) param.getMSF(); - } - - public void test1() { - String testDocumentsPath = util.utils.getFullTestDocName(""); - log.println("Test documents in:" + testDocumentsPath); +public class LoadDocuments { + @Test public void test1() { + String testDocumentsPath = Argument.get("tdoc"); + System.out.println("Test documents in:" + testDocumentsPath); File dir = new File(testDocumentsPath); String [] files = dir.list(); - if (files != null) { - for (int i = 0; i < files.length; ++i) { - log.println(files[i]); - String url = util.utils.getFullTestURL(files[i]); - log.println(url); - - XTextDocument xDoc = util.WriterTools.loadTextDoc(m_xMSF, url); - util.DesktopTools.closeDoc(xDoc); + try { + if (files != null) { + for (int i = 0; i < files.length; ++i) { + System.out.println(files[i]); + String url = TestDocument.getUrl(files[i]); + System.out.println(url); + + XComponent xDoc = util.DesktopTools.loadDoc(getMSF(), url, null); + System.out.println("loaded."); + util.DesktopTools.closeDoc(xDoc); + System.out.println("done."); + } + } else { + fail("Files not found"); } - } else { - failed(); } + catch (Exception e) { + System.out.println(e); + fail("failed"); + } + } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception + { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); } + private static final OfficeConnection connection = new OfficeConnection(); } Modified: openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/makefile.mk?rev=1731999&r1=1731998&r2=1731999&view=diff ============================================================================== --- openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/makefile.mk (original) +++ openoffice/branches/gbuild-reintegration/main/writerfilter/qa/complex/ooxml/makefile.mk Wed Feb 24 01:11:29 2016 @@ -33,6 +33,7 @@ PACKAGE = complex$/ooxml #----- compile .java files ----------------------------------------- JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) JAVAFILES = LoadDocuments.java JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)