summaryrefslogtreecommitdiff
path: root/reportdesign/qa
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-03-09 23:17:51 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-03-09 23:17:51 -0600
commit256f6ca67d03b875e8e6a355a6cf5130ea7404a3 (patch)
treec1916add744093d07466b54d6af832cd87891d8e /reportdesign/qa
parentf71ad82e60bebde81ebb193dcd16305ca339cc1a (diff)
parentdee1ea70160df84946cf9040281de42945faf65a (diff)
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
* commit 'ooo/DEV300_m101': (76 commits) masterfix DEV300: #i10000# usage of L10N build_type removetooltypes01: Fix build problems after rebase to DEV300m99 in basctl, cui, reportdesign, sw hr75: #i116747#: remove obsolete copyright notices gnumake3: remove comphelper version; fix including extract.hxx removetooltypes01: #i112600# Replace missing tools types replacement removetooltypes01: #i112600# remove tooltypes from reportdesign removetooltypes01: #i112600# remove tooltypes from dbaccess undoapi: don't use deprecated JUnit API, this seems to fail now (but didn't before the rebase) undoapi: those two classes do not belong into JAVATESTFILES, but JAVAFILES only undoapi: (I|Sfx)UndoManager now working with size_t instead of USHORT gridsort: give the UnoControl(Model/Base) classes a ctor taking a service factory, so we have access to the factory which created us, and don't need to resort to the process'es service factory dba34b: #109956# notify column value in correct order dba34b: #i114309# set default values for bit boolean and reset when we are on the insertrow undoapi: assert unknown slots in ImplInvalidateFeature dba34b: #i110907# check if design handle event dba34b: #i109956# notify column values when row is refreshed dba34b: #i115753# add test again undoapi: renamed Undo.* to RptUndo.*, to not confuse a certain IDE with different same-named files in the source tree ... undoapi: migrated report designer to use an own, model-bound UndoManager, instead of the UndoManager formerly bound to the controller undoapi: split OSingleDocumentController into DBSubComponentController (which the report design's controller will be derived from) and the still-so-named OSingleDocumentController. Module reportdesign does not compile with this change, this is yet to come. ... Conflicts: dbaccess/inc/IEnvironment.hxx dbaccess/inc/dataview.hxx dbaccess/qa/complex/dbaccess/RowSet.java dbaccess/source/core/api/CacheSet.cxx dbaccess/source/core/api/KeySet.hxx dbaccess/source/core/api/OptimisticSet.hxx dbaccess/source/core/api/RowSet.cxx dbaccess/source/core/api/RowSetCache.cxx dbaccess/source/ext/adabas/Acomponentmodule.cxx dbaccess/source/ext/adabas/Aservices.cxx dbaccess/source/filter/migration/cfgimport.cxx dbaccess/source/filter/migration/cfgimport.hxx dbaccess/source/filter/migration/cfgservices.cxx dbaccess/source/filter/migration/makefile.mk dbaccess/source/inc/cfg_reghelper.hxx dbaccess/source/sdbtools/misc/sdbt_services.cxx dbaccess/source/shared/cfg_reghelper.cxx dbaccess/source/shared/cfgstrings.cxx dbaccess/source/shared/registrationhelper.cxx dbaccess/source/ui/app/AppController.cxx dbaccess/source/ui/app/AppDetailPageHelper.cxx dbaccess/source/ui/app/AppDetailPageHelper.hxx dbaccess/source/ui/app/AppDetailView.cxx dbaccess/source/ui/app/AppIconControl.cxx dbaccess/source/ui/app/AppSwapWindow.cxx dbaccess/source/ui/browser/brwctrlr.cxx dbaccess/source/ui/browser/dataview.cxx dbaccess/source/ui/browser/unodatbr.cxx dbaccess/source/ui/control/dbtreelistbox.cxx dbaccess/source/ui/control/opendoccontrols.cxx dbaccess/source/ui/control/tabletree.cxx dbaccess/source/ui/dlg/ConnectionHelper.cxx dbaccess/source/ui/dlg/ConnectionPage.src dbaccess/source/ui/dlg/ExtensionNotPresent.cxx dbaccess/source/ui/dlg/ExtensionNotPresent.hrc dbaccess/source/ui/dlg/ExtensionNotPresent.src dbaccess/source/ui/dlg/TablesSingleDlg.cxx dbaccess/source/ui/dlg/adodatalinks.hxx dbaccess/source/ui/dlg/dbadmin2.src dbaccess/source/ui/dlg/dbadminsetup.src dbaccess/source/ui/dlg/dlgattr.cxx dbaccess/source/ui/dlg/dlgsize.src dbaccess/source/ui/dlg/makefile.mk dbaccess/source/ui/dlg/sqlmessage.cxx dbaccess/source/ui/inc/ExtensionNotPresent.hxx dbaccess/source/ui/inc/TokenWriter.hxx dbaccess/source/ui/inc/imageprovider.hxx dbaccess/source/ui/misc/DExport.cxx dbaccess/source/ui/misc/HtmlReader.cxx dbaccess/source/ui/misc/RowSetDrop.cxx dbaccess/source/ui/misc/RtfReader.cxx dbaccess/source/ui/misc/TokenWriter.cxx dbaccess/source/ui/misc/imageprovider.cxx dbaccess/source/ui/misc/linkeddocuments.cxx dbaccess/source/ui/misc/singledoccontroller.cxx dbaccess/source/ui/querydesign/ConnectionData.hxx dbaccess/source/ui/querydesign/JoinTableView.cxx dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx dbaccess/source/ui/querydesign/TableConnectionData.cxx dbaccess/source/ui/querydesign/TableWindowListBox.cxx dbaccess/source/ui/relationdesign/RelationController.cxx dbaccess/source/ui/relationdesign/RelationTableView.cxx dbaccess/source/ui/tabledesign/table.src reportdesign/inc/RptPage.hxx reportdesign/qa/complex/reportdesign/ReportDesignerTest.java reportdesign/source/core/api/ReportDefinition.cxx reportdesign/source/core/sdr/ReportUndoFactory.cxx reportdesign/source/core/sdr/UndoEnv.cxx reportdesign/source/filter/xml/xmlservices.cxx reportdesign/source/ui/dlg/GroupsSorting.cxx reportdesign/source/ui/dlg/Navigator.cxx reportdesign/source/ui/inspection/metadata.cxx reportdesign/source/ui/misc/RptUndo.cxx reportdesign/source/ui/misc/UITools.cxx reportdesign/source/ui/misc/rptuiservices.cxx reportdesign/source/ui/report/DesignView.cxx reportdesign/source/ui/report/FixedTextColor.cxx reportdesign/source/ui/report/ReportController.cxx reportdesign/source/ui/report/ReportSection.cxx reportdesign/source/ui/report/SectionView.cxx reportdesign/source/ui/report/SectionWindow.cxx reportdesign/source/ui/report/StartMarker.cxx reportdesign/source/ui/report/ViewsWindow.cxx reportdesign/source/ui/report/dlgedfunc.cxx reportdesign/source/ui/report/report.src
Diffstat (limited to 'reportdesign/qa')
-rw-r--r--reportdesign/qa/complex/reportdesign/FileURL.java62
-rw-r--r--reportdesign/qa/complex/reportdesign/ReportDesignerTest.java (renamed from reportdesign/qa/complex/ReportDesignerTest.java)343
-rw-r--r--reportdesign/qa/complex/reportdesign/TestDocument.java41
-rwxr-xr-xreportdesign/qa/complex/reportdesign/makefile.mk (renamed from reportdesign/qa/complex/makefile.mk)44
-rw-r--r--reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl (renamed from reportdesign/qa/complex/mysql-connector-exists.pl)0
-rwxr-xr-xreportdesign/qa/complex/reportdesign/runner.props (renamed from reportdesign/qa/complex/runner.props)0
-rwxr-xr-xreportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb (renamed from reportdesign/qa/complex/RPTCalcTests.odb)bin6715 -> 6715 bytes
-rwxr-xr-xreportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb (renamed from reportdesign/qa/complex/RPTWriterTests.odb)bin5886 -> 5762 bytes
8 files changed, 322 insertions, 168 deletions
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
+ * <http://www.openoffice.org/license.html>
+ * 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/ReportDesignerTest.java b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java
index f34414efac8d..6dfb6f719daf 100644
--- a/reportdesign/qa/complex/ReportDesignerTest.java
+++ b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex;
+package complex.reportdesign;
import java.io.File;
import java.util.ArrayList;
@@ -47,21 +47,28 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.util.XCloseable;
-import complexlib.ComplexTestCase;
-import util.utils;
+// import complexlib.ComplexTestCase;
+// import util.utils;
import helper.OfficeProvider;
import helper.URLHelper;
-import helper.OfficeWatcher;
+// import helper.OfficeWatcher;
import convwatch.DB;
+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 = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, _aObj);
+ m_xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, _aObj);
}
/**
@@ -129,57 +136,73 @@ class PropertyHelper
}
}
-public class ReportDesignerTest extends ComplexTestCase {
+public class ReportDesignerTest
+{
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()
+// 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) m_xXMultiServiceFactory.createInstance( "com.sun.star.frame.Desktop" );
- m_xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xInterface);
+ 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)
{
- log.println("ERROR: uno.Exception caught");
- log.println("Message: " + e.getMessage());
+ System.out.println("ERROR: uno.Exception caught");
+ System.out.println("Message: " + e.getMessage());
}
}
return m_xDesktop;
@@ -203,26 +226,27 @@ public class ReportDesignerTest extends ComplexTestCase {
private OfficeProvider m_aProvider = null;
- private static XMultiServiceFactory m_xXMultiServiceFactory = null;
- private void startOffice()
- {
- param.put("TimeOut", new Integer(300000));
- System.out.println("TimeOut: " + param.getInt("TimeOut"));
- System.out.println("ThreadTimeOut: " + param.getInt("ThreadTimeOut"));
-
- m_aProvider = new OfficeProvider();
- m_xXMultiServiceFactory = (XMultiServiceFactory) m_aProvider.getManager(param);
- param.put("ServiceFactory", m_xXMultiServiceFactory);
- }
-
- private void stopOffice()
- {
- if (m_aProvider != null)
- {
- m_aProvider.closeExistingOffice(param, true);
- m_aProvider = null;
- }
- }
+// private void startOffice()
+// {
+// // int tempTime = param.getInt("SingleTimeOut");
+// param.put("TimeOut", new Integer(300000));
+// System.out.println("TimeOut: " + param.getInt("TimeOut"));
+// System.out.println("ThreadTimeOut: " + param.getInt("ThreadTimeOut"));
+//
+// // OfficeProvider aProvider = null;
+// m_aProvider = new OfficeProvider();
+// m_xXMultiServiceFactory = (XMultiServiceFactory) m_aProvider.getManager(param);
+// param.put("ServiceFactory", m_xXMultiServiceFactory);
+// }
+//
+// private void stopOffice()
+// {
+// if (m_aProvider != null)
+// {
+// m_aProvider.closeExistingOffice(param, true);
+// m_aProvider = null;
+// }
+// }
private String m_sMailAddress = null;
private String m_sUPDMinor;
@@ -231,103 +255,104 @@ public class ReportDesignerTest extends ComplexTestCase {
private static final int WRITER = 1;
private static final int CALC = 2;
- public void firsttest()
+ @Test public void firsttest()
{
- convwatch.GlobalLogWriter.set(log);
- try
- {
-
- // -------------------- preconditions, try to find an office --------------------
+ // convwatch.GlobalLogWriter.set(log);
- String sAppExecutionCommand = (String) param.get("AppExecutionCommand");
+ // -------------------- preconditions, try to find an office --------------------
- String sUser = System.getProperty("user.name");
- log.println("user.name='" + sUser + "'");
+// String sAppExecutionCommand = (String) param.get("AppExecutionCommand");
- String sVCSID = System.getProperty("VCSID");
- log.println("VCSID='" + sVCSID + "'");
- m_sMailAddress = sVCSID + "@openoffice.org";
- log.println("Assumed mail address: " + m_sMailAddress);
+ String sUser = System.getProperty("user.name");
+ System.out.println("user.name='" + sUser + "'");
- m_sUPDMinor = System.getProperty("UPDMINOR");
- m_sCWS_WORK_STAMP = System.getProperty("CWS_WORK_STAMP");
- log.println("Current CWS: " + m_sCWS_WORK_STAMP);
- log.println("Current MWS: " + m_sUPDMinor);
+ String sVCSID = System.getProperty("VCSID");
+ System.out.println("VCSID='" + sVCSID + "'");
+ m_sMailAddress = sVCSID + "@openoffice.org";
+ System.out.println("Assumed mail address: " + m_sMailAddress);
- sAppExecutionCommand = sAppExecutionCommand.replaceAll( "\\$\\{USERNAME\\}", sUser);
- log.println("sAppExecutionCommand='" + sAppExecutionCommand + "'");
+ m_sUPDMinor = System.getProperty("UPDMINOR");
+ m_sCWS_WORK_STAMP = System.getProperty("CWS_WORK_STAMP");
+ System.out.println("Current CWS: " + m_sCWS_WORK_STAMP);
+ System.out.println("Current MWS: " + m_sUPDMinor);
- checkIfOfficeExists(sAppExecutionCommand);
- param.put("AppExecutionCommand", new String(sAppExecutionCommand));
+// sAppExecutionCommand = sAppExecutionCommand.replaceAll( "\\$\\{USERNAME\\}", sUser);
+// System.out.println("sAppExecutionCommand='" + sAppExecutionCommand + "'");
+//
+// checkIfOfficeExists(sAppExecutionCommand);
+// param.put("AppExecutionCommand", new String(sAppExecutionCommand));
- // --------------------------- Start the given Office ---------------------------
+ // --------------------------- Start the given Office ---------------------------
- startOffice();
+// startOffice();
- // ------------------------------ Start a test run ------------------------------
+ // ------------------------------ Start a test run ------------------------------
- String sCurrentDirectory = System.getProperty("user.dir");
- log.println("Current Dir: " + sCurrentDirectory);
-
- String sWriterDocument = sCurrentDirectory + "/" + "RPTWriterTests.odb";
- startTestForFile(sWriterDocument, WRITER);
-
- String sCalcDocument = sCurrentDirectory + "/" + "RPTCalcTests.odb";
- startTestForFile(sCalcDocument, CALC);
- }
- catch (AssureException e)
- {
- stopOffice();
- throw new AssureException(e.getMessage());
- }
+// String sCurrentDirectory = System.getProperty("user.dir");
+// System.out.println("Current Dir: " + sCurrentDirectory);
+//
+ String sWriterDocument = TestDocument.getUrl("RPTWriterTests.odb");
+ startTestForFile(sWriterDocument, WRITER);
+ String sCalcDocument = TestDocument.getUrl("RPTCalcTests.odb");
+ startTestForFile(sCalcDocument, CALC);
+// catch (AssureException e)
+// {
+// stopOffice();
+// throw new AssureException(e.getMessage());
+// }
+//
// ------------------------------ Office shutdown ------------------------------
- stopOffice();
+// stopOffice();
}
// -----------------------------------------------------------------------------
private void startTestForFile(String _sDocument, int _nType)
{
- File aFile = new File(_sDocument);
- assure("Test File doesn't '" + _sDocument + "'exist.", aFile.exists());
+ FileURL aFileURL = new FileURL(_sDocument);
+ assertTrue("Test File doesn't '" + _sDocument + "'exist.", aFileURL.exists());
- String sFileURL = URLHelper.getFileURLFromSystemPath(_sDocument);
- log.println("File URL: " + sFileURL);
+ String sFileURL = _sDocument; // URLHelper.getFileURLFromSystemPath(_sDocument);
+ System.out.println("File URL: " + sFileURL);
XComponent xDocComponent = loadComponent(sFileURL, getXDesktop(), null);
- log.println("Load done");
+ System.out.println("Load done");
+ assertNotNull("Can't load document ", xDocComponent);
+
try
{
- XInterface x = (XInterface)m_xXMultiServiceFactory.createInstance("com.sun.star.sdb.DatabaseContext");
- assure("can't create instance of com.sun.star.sdb.DatabaseContext", x != null);
- log.println("createInstance com.sun.star.sdb.DatabaseContext done");
+ XInterface x = (XInterface)getMSF().createInstance("com.sun.star.sdb.DatabaseContext");
+ assertNotNull("can't create instance of com.sun.star.sdb.DatabaseContext", x);
+ System.out.println("createInstance com.sun.star.sdb.DatabaseContext done");
- XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, x);
+ XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, x);
showElements(xNameAccess);
Object aObj = xNameAccess.getByName(sFileURL);
- XDocumentDataSource xDataSource = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class, aObj);
+ XDocumentDataSource xDataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, aObj);
XOfficeDatabaseDocument xOfficeDBDoc = xDataSource.getDatabaseDocument();
- assure("can't access DatabaseDocument", xOfficeDBDoc != null);
+ assertNotNull("can't access DatabaseDocument", xOfficeDBDoc);
- XModel xDBSource = (XModel)UnoRuntime.queryInterface(XModel.class, xOfficeDBDoc);
+ XModel xDBSource = UnoRuntime.queryInterface(XModel.class, xOfficeDBDoc);
Object aController = xDBSource.getCurrentController();
- assure("Controller of xOfficeDatabaseDocument is empty!", aController != null);
+ assertNotNull("Controller of xOfficeDatabaseDocument is empty!", aController);
- XDatabaseDocumentUI aDBDocUI = (XDatabaseDocumentUI)UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController);
- boolean isConnect = aDBDocUI.connect();
+ XDatabaseDocumentUI aDBDocUI = UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController);
+ /* boolean isConnect = */
+// TODO: throws an exception in DEV300m78
+ aDBDocUI.connect();
Object aActiveConnectionObj = aDBDocUI.getActiveConnection();
- assure("ActiveConnection is empty", aActiveConnectionObj != null);
+ assertNotNull("ActiveConnection is empty", aActiveConnectionObj);
- XReportDocumentsSupplier xSupplier = (XReportDocumentsSupplier)UnoRuntime.queryInterface(XReportDocumentsSupplier.class, xOfficeDBDoc);
+ XReportDocumentsSupplier xSupplier = UnoRuntime.queryInterface(XReportDocumentsSupplier.class, xOfficeDBDoc);
xNameAccess = xSupplier.getReportDocuments();
- assure("xOfficeDatabaseDocument returns no Report Document", xNameAccess != null);
+ assertNotNull("xOfficeDatabaseDocument returns no Report Document", xNameAccess);
showElements(xNameAccess);
- ArrayList aPropertyList = new ArrayList();
+ ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>();
PropertyValue aActiveConnection = new PropertyValue();
aActiveConnection.Name = "ActiveConnection";
@@ -339,7 +364,7 @@ public class ReportDesignerTest extends ComplexTestCase {
}
catch(com.sun.star.uno.Exception e)
{
- log.println("ERROR: Exception caught");
+ fail("ERROR: Exception caught" + e.getMessage());
}
// Close the document
@@ -355,8 +380,8 @@ public class ReportDesignerTest extends ComplexTestCase {
private void createDBEntry(int _nType)
{
// try to connect the database
- String sDBConnection = (String)param.get( convwatch.PropertyName.DB_CONNECTION_STRING );
- log.println("DBConnection: " + sDBConnection);
+ 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)
@@ -370,10 +395,10 @@ public class ReportDesignerTest extends ComplexTestCase {
String sSpecial = "";
String sFixRefSubDirectory = "ReportDesign_qa_complex_" + getFileFormat(_nType);
- DB.insertinto_documentcompare(sFixRefSubDirectory, "", "fixref",
- sDestinationVersion, sDestinationName, sDestinationCreatorType,
- sDocumentPoolDir, sDocumentPoolName, m_sMailAddress,
- sSpecial);
+// DB.insertinto_documentcompare(sFixRefSubDirectory, "", "fixref",
+// sDestinationVersion, sDestinationName, sDestinationCreatorType,
+// sDocumentPoolDir, sDocumentPoolName, m_sMailAddress,
+// sSpecial);
}
private void loadAndStoreReports(XNameAccess _xNameAccess, ArrayList _aPropertyList, int _nType)
@@ -427,7 +452,7 @@ public class ReportDesignerTest extends ComplexTestCase {
private String getOutputPath(int _nType)
{
- String sOutputPath = (String)param.get( convwatch.PropertyName.DOC_COMPARATOR_OUTPUT_PATH );
+ String sOutputPath = util.utils.getOfficeTemp/*Dir*/(getMSF());// (String)param.get( convwatch.PropertyName.DOC_COMPARATOR_OUTPUT_PATH );
if (!sOutputPath.endsWith("/") || // construct the output file name
!sOutputPath.endsWith("\\"))
@@ -462,7 +487,7 @@ public class ReportDesignerTest extends ComplexTestCase {
String sOutputURL = URLHelper.getFileURLFromSystemPath(sOutputPath);
- ArrayList aPropertyList = new ArrayList(); // set some properties for storeAsURL
+ ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); // set some properties for storeAsURL
PropertyValue aFileFormat = new PropertyValue();
aFileFormat.Name = "FilterName";
@@ -475,19 +500,19 @@ public class ReportDesignerTest extends ComplexTestCase {
aPropertyList.add(aOverwrite);
// store the document in an other directory
- XStorable aStorable = (XStorable) UnoRuntime.queryInterface( XStorable.class, _xComponent);
+ XStorable aStorable = UnoRuntime.queryInterface(XStorable.class, _xComponent);
if (aStorable != null)
{
- log.println("store document as URL: '" + sOutputURL + "'");
+ System.out.println("store document as URL: '" + sOutputURL + "'");
try
{
aStorable.storeAsURL(sOutputURL, PropertyHelper.createPropertyValueArrayFormArrayList(aPropertyList));
}
catch (com.sun.star.io.IOException e)
{
- log.println("ERROR: Exception caught");
- log.println("Can't write document URL: '" + sOutputURL + "'");
- log.println("Message: " + e.getMessage());
+ System.out.println("ERROR: Exception caught");
+ System.out.println("Can't write document URL: '" + sOutputURL + "'");
+ System.out.println("Message: " + e.getMessage());
}
}
}
@@ -495,25 +520,25 @@ public class ReportDesignerTest extends ComplexTestCase {
private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList)
{
XComponent xDocComponent = null;
- XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface( XComponentLoader.class, _xComponent );
+ XComponentLoader xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, _xComponent);
try
{
PropertyValue[] aLoadProperties = PropertyHelper.createPropertyValueArrayFormArrayList(_aPropertyList);
- log.println("Load component: '" + _sName + "'");
+ System.out.println("Load component: '" + _sName + "'");
xDocComponent = xComponentLoader.loadComponentFromURL(_sName, "_blank", 0, aLoadProperties);
}
catch (com.sun.star.io.IOException e)
{
- log.println("ERROR: Exception caught");
- log.println("Can't load document '" + _sName + "'");
- log.println("Message: " + e.getMessage());
+ 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)
{
- log.println("ERROR: Exception caught");
- log.println("Illegal Arguments given to loadComponentFromURL.");
- log.println("Message: " + e.getMessage());
+ System.out.println("ERROR: Exception caught");
+ System.out.println("Illegal Arguments given to loadComponentFromURL.");
+ System.out.println("Message: " + e.getMessage());
}
return xDocComponent;
}
@@ -521,17 +546,39 @@ public class ReportDesignerTest extends ComplexTestCase {
private void closeComponent(XComponent _xDoc)
{
// Close the document
- XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, _xDoc);
+ XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, _xDoc);
try
{
xCloseable.close(true);
}
catch (com.sun.star.util.CloseVetoException e)
{
- log.println("ERROR: CloseVetoException caught");
- log.println("CloseVetoException occurred Can't close document.");
- log.println("Message: " + e.getMessage());
+ 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
+* <http://www.openoffice.org/license.html>
+* 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/makefile.mk b/reportdesign/qa/complex/reportdesign/makefile.mk
index 9d1b7667c125..4174eb02ce3a 100755
--- a/reportdesign/qa/complex/makefile.mk
+++ b/reportdesign/qa/complex/reportdesign/makefile.mk
@@ -25,34 +25,38 @@
#
#*************************************************************************
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+PRJ = ../../..
PRJNAME = reportdesign
-PACKAGE = complex
-TARGET = rptdesigntest
+TARGET = qa_complex_reportdesign
-# --- Settings -----------------------------------------------------
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/reportdesign
-.INCLUDE : settings.mk
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ ReportDesignerTest.java
-# --- Files --------------------------------------------------------
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+ TestDocument.java \
+ FileURL.java
-JARFILES = ridl.jar jurt.jar unoil.jar juh.jar OOoRunner.jar
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-JAVAFILES = ReportDesignerTest.java
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-# --- Targets ------------------------------------------------------
+.END
-.INCLUDE : target.mk
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-# JAVADEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8502,suspend=y
-JAVADEBUG=
+ALLTAR : javatest
-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
+.END
diff --git a/reportdesign/qa/complex/mysql-connector-exists.pl b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl
index 6eefe2bb0639..6eefe2bb0639 100644
--- a/reportdesign/qa/complex/mysql-connector-exists.pl
+++ b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl
diff --git a/reportdesign/qa/complex/runner.props b/reportdesign/qa/complex/reportdesign/runner.props
index d894366ce006..d894366ce006 100755
--- a/reportdesign/qa/complex/runner.props
+++ b/reportdesign/qa/complex/reportdesign/runner.props
diff --git a/reportdesign/qa/complex/RPTCalcTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb
index 0e91d633d4e7..0e91d633d4e7 100755
--- a/reportdesign/qa/complex/RPTCalcTests.odb
+++ b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb
Binary files differ
diff --git a/reportdesign/qa/complex/RPTWriterTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb
index 86228f457f0b..7099b1abf2b5 100755
--- a/reportdesign/qa/complex/RPTWriterTests.odb
+++ b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb
Binary files differ