From 151a532470b9535fee7927d5895da90c33e1e979 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Fri, 18 Jun 2010 10:04:37 +0200 Subject: sb123:#i111449# cleanups in reportdesign qa/complex tests --- reportdesign/qa/complex/RPTCalcTests.odb | Bin 6715 -> 0 bytes reportdesign/qa/complex/RPTWriterTests.odb | Bin 5886 -> 0 bytes reportdesign/qa/complex/ReportDesignerTest.java | 608 ------------------- reportdesign/qa/complex/makefile.mk | 58 -- reportdesign/qa/complex/mysql-connector-exists.pl | 9 - reportdesign/qa/complex/reportdesign/FileURL.java | 62 ++ .../complex/reportdesign/ReportDesignerTest.java | 651 +++++++++++++++++++++ .../qa/complex/reportdesign/TestDocument.java | 41 ++ reportdesign/qa/complex/reportdesign/makefile.mk | 66 +++ .../complex/reportdesign/mysql-connector-exists.pl | 9 + reportdesign/qa/complex/reportdesign/runner.props | 22 + .../reportdesign/test_documents/RPTCalcTests.odb | Bin 0 -> 6715 bytes .../reportdesign/test_documents/RPTWriterTests.odb | Bin 0 -> 5762 bytes reportdesign/qa/complex/runner.props | 22 - 14 files changed, 851 insertions(+), 697 deletions(-) delete mode 100755 reportdesign/qa/complex/RPTCalcTests.odb delete mode 100755 reportdesign/qa/complex/RPTWriterTests.odb delete mode 100755 reportdesign/qa/complex/ReportDesignerTest.java delete mode 100755 reportdesign/qa/complex/makefile.mk delete mode 100644 reportdesign/qa/complex/mysql-connector-exists.pl create mode 100644 reportdesign/qa/complex/reportdesign/FileURL.java create mode 100755 reportdesign/qa/complex/reportdesign/ReportDesignerTest.java create mode 100644 reportdesign/qa/complex/reportdesign/TestDocument.java create mode 100755 reportdesign/qa/complex/reportdesign/makefile.mk create mode 100644 reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl create mode 100755 reportdesign/qa/complex/reportdesign/runner.props create mode 100755 reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb create mode 100755 reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb delete mode 100755 reportdesign/qa/complex/runner.props (limited to 'reportdesign/qa') diff --git a/reportdesign/qa/complex/RPTCalcTests.odb b/reportdesign/qa/complex/RPTCalcTests.odb deleted file mode 100755 index 0e91d633d4e7..000000000000 Binary files a/reportdesign/qa/complex/RPTCalcTests.odb and /dev/null differ diff --git a/reportdesign/qa/complex/RPTWriterTests.odb b/reportdesign/qa/complex/RPTWriterTests.odb deleted file mode 100755 index 86228f457f0b..000000000000 Binary files a/reportdesign/qa/complex/RPTWriterTests.odb and /dev/null differ diff --git a/reportdesign/qa/complex/ReportDesignerTest.java b/reportdesign/qa/complex/ReportDesignerTest.java deleted file mode 100755 index 3bbb9a42fe26..000000000000 --- a/reportdesign/qa/complex/ReportDesignerTest.java +++ /dev/null @@ -1,608 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex; - -import java.io.File; -import java.util.ArrayList; - -import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.XPropertySet; -import com.sun.star.container.XNameAccess; -import com.sun.star.frame.XComponentLoader; -import com.sun.star.frame.XDesktop; -import com.sun.star.frame.XModel; -import com.sun.star.frame.XStorable; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.sdb.XDocumentDataSource; -import com.sun.star.sdb.XOfficeDatabaseDocument; -import com.sun.star.sdb.XReportDocumentsSupplier; -import com.sun.star.sdb.application.XDatabaseDocumentUI; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import com.sun.star.util.XCloseable; - -// import util.BasicMacroTools; -// import util.DesktopTools; -// import util.dbg; -import complexlib.ComplexTestCase; -import util.utils; -import helper.OfficeProvider; -import helper.URLHelper; -import helper.OfficeWatcher; - -import convwatch.DB; - -// import java.util.Date; -// import java.text.SimpleDateFormat; -// import java.text.ParsePosition; -// import java.sql.Time; -// -// import java.io.BufferedReader; -// import java.io.File; -// import java.io.FileReader; -// import java.io.IOException; -// import java.io.FilenameFilter; -// -// import java.util.Vector; -// -// import helper.AppProvider; -// import java.text.DecimalFormat; -// import util.DynamicClassLoader; -// import java.util.StringTokenizer; - - - - -class PropertySetHelper -{ - XPropertySet m_xPropertySet; - public PropertySetHelper(Object _aObj) - { - m_xPropertySet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, _aObj); - } - - /** - get a property and don't convert it - @param _sName the string name of the property - @return the object value of the property without any conversion - */ - public Object getPropertyValueAsObject(String _sName) - { - Object aObject = null; - - if (m_xPropertySet != null) - { - try - { - aObject = m_xPropertySet.getPropertyValue(_sName); - } - catch (com.sun.star.beans.UnknownPropertyException e) - { - System.out.println("ERROR: UnknownPropertyException caught. '" + _sName + "'"); - System.out.println("Message: " + e.getMessage()); - } - catch (com.sun.star.lang.WrappedTargetException e) - { - System.out.println("ERROR: WrappedTargetException caught."); - System.out.println("Message: " + e.getMessage()); - } - } - return aObject; - } -} - -class PropertyHelper -{ - /** - Create a PropertyValue[] from a ArrayList - @param _aArrayList - @return a PropertyValue[] - */ - public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList _aPropertyList) - { - // copy the whole PropertyValue List to an PropertyValue Array - PropertyValue[] aSaveProperties = null; - - if (_aPropertyList == null) - { - aSaveProperties = new PropertyValue[0]; - } - else - { - if (_aPropertyList.size() > 0) - { - aSaveProperties = new PropertyValue[_aPropertyList.size()]; - for (int i = 0;i<_aPropertyList.size(); i++) - { - aSaveProperties[i] = (PropertyValue) _aPropertyList.get(i); - } - } - else - { - aSaveProperties = new PropertyValue[0]; - } - } - return aSaveProperties; - } -} - -public class ReportDesignerTest extends ComplexTestCase { - - String mTestDocumentPath; - - public String[] getTestMethodNames() - { - return new String[] {"firsttest"}; - } - - private void checkIfOfficeExists(String _sOfficePathWithTrash) - { - String sOfficePath = ""; - int nIndex = _sOfficePathWithTrash.indexOf("soffice.exe"); - if (nIndex > 0) - { - sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 11); - } - else - { - nIndex = _sOfficePathWithTrash.indexOf("soffice"); - if (nIndex > 0) - { - sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 7); - } - } - - log.println(sOfficePath); - File sOffice = new File(sOfficePath); - if (! sOffice.exists()) - { - log.println("ERROR: There exists no office installation at given path: '" + sOfficePath + "'"); - System.exit(0); - } - } - - - private static XDesktop m_xDesktop = null; - public static XDesktop getXDesktop() - { - - if (m_xDesktop == null) - { - try - { - XInterface xInterface = (XInterface) m_xXMultiServiceFactory.createInstance( "com.sun.star.frame.Desktop" ); - m_xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xInterface); - } - catch (com.sun.star.uno.Exception e) - { - log.println("ERROR: uno.Exception caught"); - log.println("Message: " + e.getMessage()); - } - } - return m_xDesktop; - } - - private void showElements(XNameAccess _xNameAccess) - { - if (_xNameAccess != null) - { - String[] sElementNames = _xNameAccess.getElementNames(); - for(int i=0;i -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME = reportdesign -PACKAGE = complex -TARGET = rptdesigntest - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -JARFILES = ridl.jar jurt.jar unoil.jar juh.jar OOoRunner.jar - -JAVAFILES = ReportDesignerTest.java - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -# JAVADEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8502,suspend=y -JAVADEBUG= - -MYSQL_CONNECTOR=$(PWD)$/mysql-connector-java-5.0.6-bin.jar -CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(MYSQL_CONNECTOR) - -run: ALLTAR - $(PERL) mysql-connector-exists.pl $(MYSQL_CONNECTOR) -# @echo $(CLASSPATH) -# @echo $(VCSID) - @java $(JAVADEBUG) -cp $(CLASSPATH) -DVCSID=$(VCSID) -DCWS_WORK_STAMP=$(CWS_WORK_STAMP) -DUPDMINOR=$(UPDMINOR) org.openoffice.Runner -ini runner.props diff --git a/reportdesign/qa/complex/mysql-connector-exists.pl b/reportdesign/qa/complex/mysql-connector-exists.pl deleted file mode 100644 index 6eefe2bb0639..000000000000 --- a/reportdesign/qa/complex/mysql-connector-exists.pl +++ /dev/null @@ -1,9 +0,0 @@ -eval 'exec perl -wS $0 ${1+\"$@\"}' - if 0; - -my $sMySQLConnector = $ARGV[0]; -if (! -e $sMySQLConnector) -{ - exit 1; -} -exit 0; diff --git a/reportdesign/qa/complex/reportdesign/FileURL.java b/reportdesign/qa/complex/reportdesign/FileURL.java new file mode 100644 index 000000000000..9d2cdb89bd0e --- /dev/null +++ b/reportdesign/qa/complex/reportdesign/FileURL.java @@ -0,0 +1,62 @@ +/* + * ************************************************************************ + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + * ************************************************************************ + */ + +package complex.reportdesign; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * + * @author ll93751 + */ +public class FileURL +{ + String m_sFileURL; + + public FileURL(String _sFileURL) + { + m_sFileURL = _sFileURL; + } + public boolean exists() + { + try + { + final URI aURI = new URI(m_sFileURL); + final File aFile = new File(aURI); + return aFile.exists(); + } + catch (URISyntaxException ex) + { + System.out.println("Error: URI is wrong. '" + m_sFileURL + "': " + ex.getMessage()); + } + return false; + } +} diff --git a/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java new file mode 100755 index 000000000000..d84675a64004 --- /dev/null +++ b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java @@ -0,0 +1,651 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.reportdesign; + +import java.io.File; +import java.util.ArrayList; + +import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.XPropertySet; +import com.sun.star.container.XNameAccess; +import com.sun.star.frame.XComponentLoader; +import com.sun.star.frame.XDesktop; +import com.sun.star.frame.XModel; +import com.sun.star.frame.XStorable; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.sdb.XDocumentDataSource; +import com.sun.star.sdb.XOfficeDatabaseDocument; +import com.sun.star.sdb.XReportDocumentsSupplier; +import com.sun.star.sdb.application.XDatabaseDocumentUI; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; +import com.sun.star.util.XCloseable; + +// import util.BasicMacroTools; +// import util.DesktopTools; +// import util.dbg; +// import complexlib.ComplexTestCase; +// import util.utils; +import helper.OfficeProvider; +import helper.URLHelper; +// import helper.OfficeWatcher; + +import convwatch.DB; + +// import java.util.Date; +// import java.text.SimpleDateFormat; +// import java.text.ParsePosition; +// import java.sql.Time; +// +// import java.io.BufferedReader; +// import java.io.File; +// import java.io.FileReader; +// import java.io.IOException; +// import java.io.FilenameFilter; +// +// import java.util.Vector; +// +// import helper.AppProvider; +// import java.text.DecimalFormat; +// import util.DynamicClassLoader; +// import java.util.StringTokenizer; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + + +class PropertySetHelper +{ + XPropertySet m_xPropertySet; + public PropertySetHelper(Object _aObj) + { + m_xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, _aObj); + } + + /** + get a property and don't convert it + @param _sName the string name of the property + @return the object value of the property without any conversion + */ + public Object getPropertyValueAsObject(String _sName) + { + Object aObject = null; + + if (m_xPropertySet != null) + { + try + { + aObject = m_xPropertySet.getPropertyValue(_sName); + } + catch (com.sun.star.beans.UnknownPropertyException e) + { + System.out.println("ERROR: UnknownPropertyException caught. '" + _sName + "'"); + System.out.println("Message: " + e.getMessage()); + } + catch (com.sun.star.lang.WrappedTargetException e) + { + System.out.println("ERROR: WrappedTargetException caught."); + System.out.println("Message: " + e.getMessage()); + } + } + return aObject; + } +} + +class PropertyHelper +{ + /** + Create a PropertyValue[] from a ArrayList + @param _aArrayList + @return a PropertyValue[] + */ + public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList _aPropertyList) + { + // copy the whole PropertyValue List to an PropertyValue Array + PropertyValue[] aSaveProperties = null; + + if (_aPropertyList == null) + { + aSaveProperties = new PropertyValue[0]; + } + else + { + if (_aPropertyList.size() > 0) + { + aSaveProperties = new PropertyValue[_aPropertyList.size()]; + for (int i = 0;i<_aPropertyList.size(); i++) + { + aSaveProperties[i] = (PropertyValue) _aPropertyList.get(i); + } + } + else + { + aSaveProperties = new PropertyValue[0]; + } + } + return aSaveProperties; + } +} + +public class ReportDesignerTest +{ + + String mTestDocumentPath; + +// public String[] getTestMethodNames() +// { +// return new String[] {"firsttest"}; +// } + + @Before public void before() + { + System.out.println("before"); + // String tempdir = System.getProperty("java.io.tmpdir"); + // + int dummy = 0; + // m_xXMultiServiceFactory = getMSF(); + } + + @After public void after() + { + System.out.println("after"); + } + +// private void checkIfOfficeExists(String _sOfficePathWithTrash) +// { +// String sOfficePath = ""; +// int nIndex = _sOfficePathWithTrash.indexOf("soffice.exe"); +// if (nIndex > 0) +// { +// sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 11); +// } +// else +// { +// nIndex = _sOfficePathWithTrash.indexOf("soffice"); +// if (nIndex > 0) +// { +// sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 7); +// } +// } +// +// System.out.println(sOfficePath); +// File sOffice = new File(sOfficePath); +// if (! sOffice.exists()) +// { +// System.out.println("ERROR: There exists no office installation at given path: '" + sOfficePath + "'"); +// System.exit(0); +// } +// } + + + private XDesktop m_xDesktop = null; + public XDesktop getXDesktop() + { + + if (m_xDesktop == null) + { + try + { + XInterface xInterface = (XInterface) getMSF().createInstance( "com.sun.star.frame.Desktop" ); + m_xDesktop = UnoRuntime.queryInterface(XDesktop.class, xInterface); + assertNotNull("Can't get XDesktop", m_xDesktop); + } + catch (com.sun.star.uno.Exception e) + { + System.out.println("ERROR: uno.Exception caught"); + System.out.println("Message: " + e.getMessage()); + } + } + return m_xDesktop; + } + + private void showElements(XNameAccess _xNameAccess) + { + if (_xNameAccess != null) + { + String[] sElementNames = _xNameAccess.getElementNames(); + for(int i=0;i aPropertyList = new ArrayList(); + + PropertyValue aActiveConnection = new PropertyValue(); + aActiveConnection.Name = "ActiveConnection"; + aActiveConnection.Value = aActiveConnectionObj; + aPropertyList.add(aActiveConnection); + + loadAndStoreReports(xNameAccess, aPropertyList, _nType); + createDBEntry(_nType); + } + catch(com.sun.star.uno.Exception e) + { + fail("ERROR: Exception caught" + e.getMessage()); + } + + // String mTestDocumentPath = (String) param.get("TestDocumentPath"); + // System.out.println("mTestDocumentPath: '" + mTestDocumentPath + "'"); + // // workaround for issue using deprecated "DOCPTH" prop + // System.setProperty("DOCPTH", mTestDocumentPath); + + // Close the document + closeComponent(xDocComponent); + } + + private String getDocumentPoolName(int _nType) + { + return getFileFormat(_nType); + } + +// ----------------------------------------------------------------------------- + private void createDBEntry(int _nType) + { + // try to connect the database + String sDBConnection = ""; // (String)param.get( convwatch.PropertyName.DB_CONNECTION_STRING ); + System.out.println("DBConnection: " + sDBConnection); + DB.init(sDBConnection); + String sDestinationVersion = m_sCWS_WORK_STAMP; + if (sDestinationVersion.length() == 0) + { + sDestinationVersion = m_sUPDMinor; + } + String sDestinationName = ""; + String sDestinationCreatorType = ""; + String sDocumentPoolDir = getOutputPath(_nType); + String sDocumentPoolName = getDocumentPoolName(_nType); + String sSpecial = ""; + + String sFixRefSubDirectory = "ReportDesign_qa_complex_" + getFileFormat(_nType); +// DB.insertinto_documentcompare(sFixRefSubDirectory, "", "fixref", +// sDestinationVersion, sDestinationName, sDestinationCreatorType, +// sDocumentPoolDir, sDocumentPoolName, m_sMailAddress, +// sSpecial); + // DB.test(); + // System.exit(1); + } + + private void loadAndStoreReports(XNameAccess _xNameAccess, ArrayList _aPropertyList, int _nType) + { + if (_xNameAccess != null) + { + String[] sElementNames = _xNameAccess.getElementNames(); + for(int i=0;i aPropertyList = new ArrayList(); // set some properties for storeAsURL + + PropertyValue aFileFormat = new PropertyValue(); + aFileFormat.Name = "FilterName"; + aFileFormat.Value = getFileFormat(_nType); + aPropertyList.add(aFileFormat); + + PropertyValue aOverwrite = new PropertyValue(); // always overwrite already exist files + aOverwrite.Name = "Overwrite"; + aOverwrite.Value = Boolean.TRUE; + aPropertyList.add(aOverwrite); + + // store the document in an other directory + XStorable aStorable = UnoRuntime.queryInterface(XStorable.class, _xComponent); + if (aStorable != null) + { + System.out.println("store document as URL: '" + sOutputURL + "'"); + try + { + aStorable.storeAsURL(sOutputURL, PropertyHelper.createPropertyValueArrayFormArrayList(aPropertyList)); + } + catch (com.sun.star.io.IOException e) + { + System.out.println("ERROR: Exception caught"); + System.out.println("Can't write document URL: '" + sOutputURL + "'"); + System.out.println("Message: " + e.getMessage()); + } + } + } + + private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList) + { + XComponent xDocComponent = null; + XComponentLoader xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, _xComponent); + + try + { + PropertyValue[] aLoadProperties = PropertyHelper.createPropertyValueArrayFormArrayList(_aPropertyList); + System.out.println("Load component: '" + _sName + "'"); + xDocComponent = xComponentLoader.loadComponentFromURL(_sName, "_blank", 0, aLoadProperties); + } + catch (com.sun.star.io.IOException e) + { + System.out.println("ERROR: Exception caught"); + System.out.println("Can't load document '" + _sName + "'"); + System.out.println("Message: " + e.getMessage()); + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + System.out.println("ERROR: Exception caught"); + System.out.println("Illegal Arguments given to loadComponentFromURL."); + System.out.println("Message: " + e.getMessage()); + } + return xDocComponent; + } + + private void closeComponent(XComponent _xDoc) + { + // Close the document + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, _xDoc); + try + { + xCloseable.close(true); + } + catch (com.sun.star.util.CloseVetoException e) + { + System.out.println("ERROR: CloseVetoException caught"); + System.out.println("CloseVetoException occured Can't close document."); + System.out.println("Message: " + e.getMessage()); + } + } + + + 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(); + +} diff --git a/reportdesign/qa/complex/reportdesign/TestDocument.java b/reportdesign/qa/complex/reportdesign/TestDocument.java new file mode 100644 index 000000000000..a6e294d4d3ec --- /dev/null +++ b/reportdesign/qa/complex/reportdesign/TestDocument.java @@ -0,0 +1,41 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.reportdesign; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument +{ + public static String getUrl(String name) + { + return OfficeFileUrl.getAbsolute(new File("test_documents", name)); + } + + private TestDocument() {} +} diff --git a/reportdesign/qa/complex/reportdesign/makefile.mk b/reportdesign/qa/complex/reportdesign/makefile.mk new file mode 100755 index 000000000000..68140b184bde --- /dev/null +++ b/reportdesign/qa/complex/reportdesign/makefile.mk @@ -0,0 +1,66 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: + @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." +.ELSE + +PRJ = ../../.. +PRJNAME = reportdesign +TARGET = qa_complex_reportdesign + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/reportdesign + +# here store only Files which contain a @Test +JAVATESTFILES = \ + ReportDesignerTest.java + +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java \ + FileURL.java + +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) + +# subdirectories +# SUBDIRS = helper + +# Sample how to debug +JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y + +.END + +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk + +ALLTAR : javatest + +.END diff --git a/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl new file mode 100644 index 000000000000..6eefe2bb0639 --- /dev/null +++ b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl @@ -0,0 +1,9 @@ +eval 'exec perl -wS $0 ${1+\"$@\"}' + if 0; + +my $sMySQLConnector = $ARGV[0]; +if (! -e $sMySQLConnector) +{ + exit 1; +} +exit 0; diff --git a/reportdesign/qa/complex/reportdesign/runner.props b/reportdesign/qa/complex/reportdesign/runner.props new file mode 100755 index 000000000000..d894366ce006 --- /dev/null +++ b/reportdesign/qa/complex/reportdesign/runner.props @@ -0,0 +1,22 @@ +# where to store created documents +wntmsci.DOC_COMPARATOR_OUTPUT_PATH=\\\\so-gfxcmp-lin\\doc-pool\\reporttest +unxlngi.DOC_COMPARATOR_OUTPUT_PATH=/net/so-gfxcmp-lin/export/gfxcmp/document-pool/reporttest + +DB_CONNECTION_STRING=server:jakobus,db:jobs_convwatch,user:admin,passwd:admin + +# Set path to an existing office installation +wntmsci.AppExecutionCommand=C:\\home\\${USERNAME}\\staroffice8\\program\\soffice.exe -norestore -nocrashreport -accept=socket,host=localhost,port=8100;urp; +unxlngi.AppExecutionCommand=/opt/staroffice8/program/soffice -norestore -nocrashreport -accept=socket,host=localhost,port=8100;urp; + +# Set the 'Continue' Property to true, to leave out already done tests. +Continue=true + +TestBase=java_complex +TestJob=-o complex.ReportDesignerTest +DebugIsActive=true +ThreadTimeOut=400000 +SingleTimeOut=300000 + +# don't start office automatically +NoOffice=true + diff --git a/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb new file mode 100755 index 000000000000..0e91d633d4e7 Binary files /dev/null and b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb differ diff --git a/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb new file mode 100755 index 000000000000..7099b1abf2b5 Binary files /dev/null and b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb differ diff --git a/reportdesign/qa/complex/runner.props b/reportdesign/qa/complex/runner.props deleted file mode 100755 index d894366ce006..000000000000 --- a/reportdesign/qa/complex/runner.props +++ /dev/null @@ -1,22 +0,0 @@ -# where to store created documents -wntmsci.DOC_COMPARATOR_OUTPUT_PATH=\\\\so-gfxcmp-lin\\doc-pool\\reporttest -unxlngi.DOC_COMPARATOR_OUTPUT_PATH=/net/so-gfxcmp-lin/export/gfxcmp/document-pool/reporttest - -DB_CONNECTION_STRING=server:jakobus,db:jobs_convwatch,user:admin,passwd:admin - -# Set path to an existing office installation -wntmsci.AppExecutionCommand=C:\\home\\${USERNAME}\\staroffice8\\program\\soffice.exe -norestore -nocrashreport -accept=socket,host=localhost,port=8100;urp; -unxlngi.AppExecutionCommand=/opt/staroffice8/program/soffice -norestore -nocrashreport -accept=socket,host=localhost,port=8100;urp; - -# Set the 'Continue' Property to true, to leave out already done tests. -Continue=true - -TestBase=java_complex -TestJob=-o complex.ReportDesignerTest -DebugIsActive=true -ThreadTimeOut=400000 -SingleTimeOut=300000 - -# don't start office automatically -NoOffice=true - -- cgit v1.2.3 From ab61fd887a083bd8837a82e98dfd60376e0f29c1 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Fri, 18 Jun 2010 10:12:37 +0200 Subject: sb123:#i111449# cleanups in reportdesign qa/complex tests --- reportdesign/qa/complex/reportdesign/ReportDesignerTest.java | 1 + 1 file changed, 1 insertion(+) (limited to 'reportdesign/qa') diff --git a/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java index d84675a64004..346c28569929 100755 --- a/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java +++ b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java @@ -384,6 +384,7 @@ public class ReportDesignerTest XDatabaseDocumentUI aDBDocUI = UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController); /* boolean isConnect = */ +// TODO: throws an exception in DEV300m78 aDBDocUI.connect(); // if (isConnect) // { -- cgit v1.2.3 From 15642a2f8d17997b3c051a9b0587f523cba83e86 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 21 Jun 2010 11:12:24 +0200 Subject: sb123:#i111449# cleanups in reportdesign qa/complex tests --- reportdesign/prj/build.lst | 2 +- reportdesign/qa/complex/reportdesign/makefile.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'reportdesign/qa') diff --git a/reportdesign/prj/build.lst b/reportdesign/prj/build.lst index dff79ac79c3d..aa73b032fafa 100644 --- a/reportdesign/prj/build.lst +++ b/reportdesign/prj/build.lst @@ -13,6 +13,6 @@ rd reportdesign\source\ui\inspection nmake rd reportdesign\source\filter\xml nmake - all rd_filter_xml rd_inc NULL rd reportdesign\util nmake - all rd_util rd_api rd_res rd_shared rd_uimisc rd_uidlg rd_uireport rd_uiinspection rd_sdr rd_misc rd_filter_xml NULL -# has problems im m78 +# has problems in m78, in m83 also # rd reportdesign\qa\complex\reportdesign nmake - all rd_qa_complex NULL diff --git a/reportdesign/qa/complex/reportdesign/makefile.mk b/reportdesign/qa/complex/reportdesign/makefile.mk index 68140b184bde..261077caed68 100755 --- a/reportdesign/qa/complex/reportdesign/makefile.mk +++ b/reportdesign/qa/complex/reportdesign/makefile.mk @@ -53,7 +53,7 @@ EXTRAJARFILES = $(OOO_JUNIT_JAR) # SUBDIRS = helper # Sample how to debug -JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y .END -- cgit v1.2.3 From d1e2b3804ca92d0e28e672a600f7a7b1d66f6d75 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Tue, 29 Jun 2010 13:43:23 +0200 Subject: sb123:#i111449# makefile cleanups for qa/complex tests --- dbaccess/qa/complex/dbaccess/makefile.mk | 1 - reportdesign/qa/complex/reportdesign/makefile.mk | 1 - 2 files changed, 2 deletions(-) (limited to 'reportdesign/qa') diff --git a/dbaccess/qa/complex/dbaccess/makefile.mk b/dbaccess/qa/complex/dbaccess/makefile.mk index ef5c9183ce60..c0d78d55d687 100755 --- a/dbaccess/qa/complex/dbaccess/makefile.mk +++ b/dbaccess/qa/complex/dbaccess/makefile.mk @@ -27,7 +27,6 @@ .IF "$(OOO_SUBSEQUENT_TESTS)" == "" nothing .PHONY: - @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." .ELSE PRJ = ../../.. diff --git a/reportdesign/qa/complex/reportdesign/makefile.mk b/reportdesign/qa/complex/reportdesign/makefile.mk index 261077caed68..49de6d4b1e57 100755 --- a/reportdesign/qa/complex/reportdesign/makefile.mk +++ b/reportdesign/qa/complex/reportdesign/makefile.mk @@ -27,7 +27,6 @@ .IF "$(OOO_SUBSEQUENT_TESTS)" == "" nothing .PHONY: - @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." .ELSE PRJ = ../../.. -- cgit v1.2.3 From 077f9fea1f7faccb083f933bd60caaae65c6be32 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 23 Aug 2010 10:38:44 +0200 Subject: sb123:#i111449# remove all subdirs in complex tests --- dbaccess/qa/complex/dbaccess/makefile.mk | 3 --- reportdesign/qa/complex/reportdesign/makefile.mk | 3 --- 2 files changed, 6 deletions(-) (limited to 'reportdesign/qa') diff --git a/dbaccess/qa/complex/dbaccess/makefile.mk b/dbaccess/qa/complex/dbaccess/makefile.mk index c0d78d55d687..4a3e0426fe1d 100755 --- a/dbaccess/qa/complex/dbaccess/makefile.mk +++ b/dbaccess/qa/complex/dbaccess/makefile.mk @@ -64,9 +64,6 @@ JAVAFILES = $(JAVATESTFILES) \ JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar ConnectivityTools.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/reportdesign/qa/complex/reportdesign/makefile.mk b/reportdesign/qa/complex/reportdesign/makefile.mk index 49de6d4b1e57..4174eb02ce3a 100755 --- a/reportdesign/qa/complex/reportdesign/makefile.mk +++ b/reportdesign/qa/complex/reportdesign/makefile.mk @@ -48,9 +48,6 @@ JAVAFILES = $(JAVATESTFILES) \ JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -- cgit v1.2.3