diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-09-30 13:08:12 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-09-30 13:08:12 +0200 |
commit | fe4a50d598615844b61704b7beb2a86d1681627f (patch) | |
tree | d9a7051c5ee4f362ca3cf1c2eb8a35f2216fba57 /connectivity/qa | |
parent | 522a402edc720525a4354e8f728a9b7a9074a3e2 (diff) |
dba34b: make tests runnable with a simple 'dmake run', and selectively runnable with a 'dmake run_<testname>'
Diffstat (limited to 'connectivity/qa')
-rw-r--r-- | connectivity/qa/complex/connectivity/DBaseDriverTest.java (renamed from connectivity/qa/complex/dbase/DBaseDriverTest.java) | 14 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/HsqlDriverTest.java (renamed from connectivity/qa/complex/hsqldb/DriverTest.java) | 5 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java (renamed from connectivity/qa/complex/jdbc/LongVarCharTest.java) | 4 | ||||
-rwxr-xr-x | connectivity/qa/complex/connectivity/SubTestCase.java | 23 | ||||
-rwxr-xr-x | connectivity/qa/complex/connectivity/TestCase.java | 35 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java (renamed from connectivity/qa/complex/dbase/DBaseDateFunctions.java) | 26 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java (renamed from connectivity/qa/complex/dbase/DBaseNumericFunctions.java) | 19 | ||||
-rwxr-xr-x | connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java (renamed from connectivity/qa/complex/dbase/DBaseSqlTests.java) | 20 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java (renamed from connectivity/qa/complex/dbase/DBaseStringFunctions.java) | 18 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData.java (renamed from connectivity/qa/complex/hsqldb/DatabaseMetaData.java) | 7 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java (renamed from connectivity/qa/complex/hsqldb/TestCacheSize.java) | 12 | ||||
-rw-r--r-- | connectivity/qa/complex/dbase/.nbattrs | 10 | ||||
-rw-r--r-- | connectivity/qa/makefile.mk | 2 |
13 files changed, 116 insertions, 79 deletions
diff --git a/connectivity/qa/complex/dbase/DBaseDriverTest.java b/connectivity/qa/complex/connectivity/DBaseDriverTest.java index 83123bc20e8d..fe5444d1bfdd 100644 --- a/connectivity/qa/complex/dbase/DBaseDriverTest.java +++ b/connectivity/qa/complex/connectivity/DBaseDriverTest.java @@ -24,14 +24,17 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.dbase; +package complex.connectivity; +import complex.connectivity.dbase.DBaseDateFunctions; +import complex.connectivity.dbase.DBaseStringFunctions; +import complex.connectivity.dbase.DBaseSqlTests; +import complex.connectivity.dbase.DBaseNumericFunctions; import com.sun.star.lang.XMultiServiceFactory; import complexlib.ComplexTestCase; import share.LogWriter; -//import complex.connectivity.DBaseStringFunctions; -public class DBaseDriverTest extends ComplexTestCase +public class DBaseDriverTest extends ComplexTestCase implements TestCase { public String[] getTestMethodNames() { @@ -47,9 +50,10 @@ public class DBaseDriverTest extends ComplexTestCase return "DBaseDriverTest"; } - public void assure2(String s, boolean b) + @Override + public void assure( final String i_message, final boolean i_condition ) { - assure(s, b); + super.assure( i_message, i_condition ); } public LogWriter getLog() diff --git a/connectivity/qa/complex/hsqldb/DriverTest.java b/connectivity/qa/complex/connectivity/HsqlDriverTest.java index 44233df5da52..28ad862c4a76 100644 --- a/connectivity/qa/complex/hsqldb/DriverTest.java +++ b/connectivity/qa/complex/connectivity/HsqlDriverTest.java @@ -24,8 +24,9 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.hsqldb; +package complex.connectivity; +import complex.connectivity.hsqldb.TestCacheSize; import com.sun.star.frame.XModel; import com.sun.star.frame.XStorable; @@ -43,7 +44,7 @@ import com.sun.star.sdbc.XDataSource; import com.sun.star.sdbc.XDriver; import connectivity.tools.HsqlDatabase; -public class DriverTest extends ComplexTestCase { +public class HsqlDriverTest extends ComplexTestCase { public String[] getTestMethodNames() { diff --git a/connectivity/qa/complex/jdbc/LongVarCharTest.java b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java index b5fbfee5aa04..63a3e8f241bc 100644 --- a/connectivity/qa/complex/jdbc/LongVarCharTest.java +++ b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.jdbc; +package complex.connectivity; import com.sun.star.beans.PropertyState; import com.sun.star.beans.PropertyValue; @@ -40,7 +40,7 @@ import com.sun.star.sdbc.XRow; import com.sun.star.uno.UnoRuntime; import complexlib.ComplexTestCase; -public class LongVarCharTest extends ComplexTestCase +public class JdbcLongVarCharTest extends ComplexTestCase { public String[] getTestMethodNames() diff --git a/connectivity/qa/complex/connectivity/SubTestCase.java b/connectivity/qa/complex/connectivity/SubTestCase.java new file mode 100755 index 000000000000..1c2e685c5943 --- /dev/null +++ b/connectivity/qa/complex/connectivity/SubTestCase.java @@ -0,0 +1,23 @@ +package complex.connectivity; + +import share.LogWriter; + +public class SubTestCase implements TestCase +{ + protected SubTestCase( final TestCase i_parentTestCase ) + { + m_parentTestCase = i_parentTestCase; + } + + public void assure( String i_message, boolean i_condition ) + { + m_parentTestCase.assure( i_message, i_condition ); + } + + public LogWriter getLog() + { + return m_parentTestCase.getLog(); + } + + private final TestCase m_parentTestCase; +} diff --git a/connectivity/qa/complex/connectivity/TestCase.java b/connectivity/qa/complex/connectivity/TestCase.java new file mode 100755 index 000000000000..bae5fcdcb4c4 --- /dev/null +++ b/connectivity/qa/complex/connectivity/TestCase.java @@ -0,0 +1,35 @@ +/************************************************************************* + * + * 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.connectivity; + +import share.LogWriter; + +public interface TestCase +{ + public void assure( final String i_message, final boolean i_condition ); + public LogWriter getLog(); +} diff --git a/connectivity/qa/complex/dbase/DBaseDateFunctions.java b/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java index 8f3c6b41c56e..9cfc6aaaf590 100644 --- a/connectivity/qa/complex/dbase/DBaseDateFunctions.java +++ b/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java @@ -24,30 +24,26 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.dbase; +package complex.connectivity.dbase; import com.sun.star.uno.UnoRuntime; import com.sun.star.sdbc.*; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.XMultiServiceFactory; +import complex.connectivity.TestCase; +import complex.connectivity.SubTestCase; -public class DBaseDateFunctions +public class DBaseDateFunctions extends SubTestCase { private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'"; private final XMultiServiceFactory m_xORB; - private final DBaseDriverTest testcase; - public DBaseDateFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase) + public DBaseDateFunctions(final XMultiServiceFactory _xORB, final TestCase i_testCase) { + super( i_testCase ); m_xORB = _xORB; - testcase = _testcase; - } - - private void assure(final String s, final boolean b) - { - testcase.assure2(s, b); } public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException @@ -55,7 +51,7 @@ public class DBaseDateFunctions final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, m_xORB.createInstance("com.sun.star.sdb.RowSet")); - testcase.getLog().println("starting DateTime function test!"); + getLog().println("starting DateTime function test!"); // set the properties needed to connect to a database final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes); xProp.setPropertyValue("DataSourceName", "Bibliography"); @@ -289,21 +285,21 @@ public class DBaseDateFunctions { final XRow row = execute(xRowRes, "CURDATE() "); final com.sun.star.util.Date aDate = row.getDate(1); - testcase.getLog().println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day + "'"); + getLog().println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day + "'"); } private void curtime(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException { final XRow row = execute(xRowRes, "CURTIME() "); final com.sun.star.util.Time aTime = row.getTime(1); - testcase.getLog().println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'"); + getLog().println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'"); } private void now(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException { final XRow row = execute(xRowRes, "NOW() "); final com.sun.star.util.DateTime aTime = row.getTimestamp(1); - testcase.getLog().println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'"); - testcase.getLog().println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'"); + getLog().println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'"); + getLog().println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'"); } } diff --git a/connectivity/qa/complex/dbase/DBaseNumericFunctions.java b/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java index ab9986722967..f5aec94a3c23 100644 --- a/connectivity/qa/complex/dbase/DBaseNumericFunctions.java +++ b/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java @@ -24,30 +24,25 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.dbase; +package complex.connectivity.dbase; import com.sun.star.uno.UnoRuntime; import com.sun.star.sdbc.*; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.XMultiServiceFactory; +import complex.connectivity.SubTestCase; +import complex.connectivity.TestCase; -public class DBaseNumericFunctions +public class DBaseNumericFunctions extends SubTestCase { - private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'"; private final XMultiServiceFactory m_xORB; - private final DBaseDriverTest testcase; - public DBaseNumericFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase) + public DBaseNumericFunctions(final XMultiServiceFactory _xORB, final TestCase i_testCase) { + super( i_testCase ); m_xORB = _xORB; - testcase = _testcase; - } - - private void assure(final String s, final boolean b) - { - testcase.assure2(s, b); } public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException @@ -55,7 +50,7 @@ public class DBaseNumericFunctions final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, m_xORB.createInstance("com.sun.star.sdb.RowSet")); - testcase.getLog().println("starting Numeric function test"); + getLog().println("starting Numeric function test"); // set the properties needed to connect to a database final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes); xProp.setPropertyValue("DataSourceName", "Bibliography"); diff --git a/connectivity/qa/complex/dbase/DBaseSqlTests.java b/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java index ac2b65cf1830..1265e05e7bef 100755 --- a/connectivity/qa/complex/dbase/DBaseSqlTests.java +++ b/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java @@ -24,27 +24,23 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.dbase; +package complex.connectivity.dbase; import com.sun.star.uno.UnoRuntime; import com.sun.star.sdbc.*; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.XMultiServiceFactory; +import complex.connectivity.TestCase; +import complex.connectivity.SubTestCase; -public class DBaseSqlTests +public class DBaseSqlTests extends SubTestCase { private final XMultiServiceFactory m_xORB; - private final DBaseDriverTest testcase; - public DBaseSqlTests(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase) + public DBaseSqlTests(final XMultiServiceFactory _xORB,final TestCase i_testCase) { + super( i_testCase ); m_xORB = _xORB; - testcase = _testcase; - } - - private void assure(final String s,final boolean b) - { - testcase.assure2(s, b); } public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException @@ -52,7 +48,7 @@ public class DBaseSqlTests final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, m_xORB.createInstance("com.sun.star.sdb.RowSet")); - testcase.getLog().println("starting SQL test"); + getLog().println("starting SQL test"); // set the properties needed to connect to a database final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes); xProp.setPropertyValue("DataSourceName", "Bibliography"); @@ -88,7 +84,7 @@ public class DBaseSqlTests } catch(SQLException e) { - testcase.getLog().println(sql + " Error: " + e.getMessage()); + getLog().println(sql + " Error: " + e.getMessage()); } } diff --git a/connectivity/qa/complex/dbase/DBaseStringFunctions.java b/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java index 23b960b7073d..30b94484d53d 100644 --- a/connectivity/qa/complex/dbase/DBaseStringFunctions.java +++ b/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java @@ -24,28 +24,24 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.dbase; +package complex.connectivity.dbase; import com.sun.star.uno.UnoRuntime; import com.sun.star.sdbc.*; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.XMultiServiceFactory; +import complex.connectivity.SubTestCase; +import complex.connectivity.TestCase; -public class DBaseStringFunctions +public class DBaseStringFunctions extends SubTestCase { private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'"; private final XMultiServiceFactory m_xORB; - private final DBaseDriverTest testcase; - public DBaseStringFunctions(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase) + public DBaseStringFunctions(final XMultiServiceFactory _xORB,final TestCase i_testCase) { + super( i_testCase ); m_xORB = _xORB; - testcase = _testcase; - } - - private void assure(final String s,final boolean b) - { - testcase.assure2(s, b); } public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException @@ -53,7 +49,7 @@ public class DBaseStringFunctions final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, m_xORB.createInstance("com.sun.star.sdb.RowSet")); - testcase.getLog().println("starting String function test"); + getLog().println("starting String function test"); // set the properties needed to connect to a database final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes); xProp.setPropertyValue("DataSourceName", "Bibliography"); diff --git a/connectivity/qa/complex/hsqldb/DatabaseMetaData.java b/connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData.java index c73676c1125e..a20bb992b4e3 100644 --- a/connectivity/qa/complex/hsqldb/DatabaseMetaData.java +++ b/connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData.java @@ -8,7 +8,8 @@ * * @author oj93728 */ -package complex.hsqldb; +package complex.connectivity.hsqldb; +import complex.connectivity.HsqlDriverTest; import java.sql.*; import java.lang.reflect.Method; @@ -16,10 +17,10 @@ import java.lang.reflect.Method; public class DatabaseMetaData { private java.sql.DatabaseMetaData m_xMD; - private DriverTest m_TestCase; + private HsqlDriverTest m_TestCase; /** Creates a new instance of DatabaseMetaData */ - public DatabaseMetaData(DriverTest _testCase,java.sql.DatabaseMetaData _xmd) { + public DatabaseMetaData(HsqlDriverTest _testCase,java.sql.DatabaseMetaData _xmd) { m_TestCase = _testCase; m_xMD = _xmd; } diff --git a/connectivity/qa/complex/hsqldb/TestCacheSize.java b/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java index 0f49aeccc8fc..6c4db8bdeee7 100644 --- a/connectivity/qa/complex/hsqldb/TestCacheSize.java +++ b/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java @@ -29,7 +29,7 @@ */ -package complex.hsqldb; +package complex.connectivity.hsqldb; @@ -115,17 +115,17 @@ public class TestCacheSize { XDriver drv; com.sun.star.beans.PropertyValue[] info; - TestCacheSize(XMultiServiceFactory _xmulti,com.sun.star.beans.PropertyValue[] _info,XDriver _drv){ + public TestCacheSize(XMultiServiceFactory _xmulti,com.sun.star.beans.PropertyValue[] _info,XDriver _drv){ servicefactory = _xmulti; drv = _drv; info = _info; } - void setURL(String _url){ + public void setURL(String _url){ url = _url; } - protected void setUp() { + public void setUp() { user = "sa"; password = ""; @@ -398,9 +398,9 @@ public class TestCacheSize { + (i * 1000 / (sw.elapsedTime() + 1))); } - protected void tearDown() {} + public void tearDown() {} - protected void checkResults() { + public void checkResults() { try { StopWatch sw = new StopWatch(); diff --git a/connectivity/qa/complex/dbase/.nbattrs b/connectivity/qa/complex/dbase/.nbattrs deleted file mode 100644 index 1ea7ed0bd8e6..000000000000 --- a/connectivity/qa/complex/dbase/.nbattrs +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> -<attributes version="1.0"> - <fileobject name="DBaseDriverTest.java"> - <attr name="class_dependency_complexlib.ComplexTestCase" stringvalue="DBaseDriverTest"/> - </fileobject> - <fileobject name="makefile.mk"> - <attr name="org.netbeans.modules.text.IsTextFile" boolvalue="true"/> - </fileobject> -</attributes> diff --git a/connectivity/qa/makefile.mk b/connectivity/qa/makefile.mk index 24218a8fa692..2ae164868f0e 100644 --- a/connectivity/qa/makefile.mk +++ b/connectivity/qa/makefile.mk @@ -72,4 +72,4 @@ run: $(CLASSDIR)$/$(JARTARGET) +$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce scenarios.sce run_%: $(CLASSDIR)$/$(JARTARGET) - +$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o complex.$(@:s/run_//:s/_/\./) + +$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o complex.$(PRJNAME).$(@:s/run_//) |