You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by bp...@apache.org on 2011/07/20 02:55:51 UTC
svn commit: r1148590 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests:
master/ij3.out suites/derbytools.runall tests/tools/_Suite.java
tests/tools/ij3Test.java tests/tools/ij3_app.properties
Author: bpendleton
Date: Wed Jul 20 00:55:50 2011
New Revision: 1148590
URL: http://svn.apache.org/viewvc?rev=1148590&view=rev
Log:
DERBY-5332: Convert tools/ij3.sql to junit
This patch was contributed by Houx Zhang (houxzhang at gmail dot com)
This change adds a new test program, ij3Test.java, to the
tools JUnit suite, and removes the old ij3.sql test program
from the derbytools.runall suite.
The purpose of the ij3Test program is to verify that ij can detect
the driver information by examining the ij.database property at startup.
Added:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3Test.java (with props)
Removed:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3_app.properties
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out?rev=1148590&r1=1148589&r2=1148590&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out Wed Jul 20 00:55:50 2011
@@ -1,4 +1,4 @@
-ij> --
+ij(CONNECTION1)> --
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
@@ -16,9 +16,10 @@ ij> --
--
-- this test shows that ij can detect the driver from the URL.
-- the ij.properties file sets ij.database and nothing else.
+
values 'PASS';
1
----
PASS
-ij> -- this test also exercises the shutdown on exit code
+ij(CONNECTION1)> -- this test also exercises the shutdown on exit code
exit;
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall?rev=1148590&r1=1148589&r2=1148590&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall Wed Jul 20 00:55:50 2011
@@ -3,5 +3,4 @@ tools/dblook_test_territory.java
tools/derbyrunjartest.java
tools/ij.sql
tools/ij2.sql
-tools/ij3.sql
tools/ij5.sql
\ No newline at end of file
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java?rev=1148590&r1=1148589&r2=1148590&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/_Suite.java Wed Jul 20 00:55:50 2011
@@ -58,6 +58,7 @@ public class _Suite extends BaseTestCase
suite.addTest(IjConnNameTest.suite());
suite.addTest(RollBackWrappingWhenFailOnImportTest.suite());
suite.addTest(ConnectWrongSubprotocolTest.suite());
+ suite.addTest(ij3Test.suite());
// SysinfoAPITest currently fails when run against jars, so is
// disabled. Only the first jar file on the classpath properly
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3Test.java?rev=1148590&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3Test.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3Test.java Wed Jul 20 00:55:50 2011
@@ -0,0 +1,50 @@
+/*
+
+ Derby - Class org.apache.derbyTesting.functionTests.tests.tools.ij3Test
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.tools;
+
+import java.util.Properties;
+
+import junit.framework.Test;
+
+import org.apache.derbyTesting.functionTests.util.ScriptTestCase;
+import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
+
+public class ij3Test extends ScriptTestCase {
+
+ public ij3Test(String script) {
+ super(script, true);
+ }
+
+ public static Test suite() {
+ Properties props = new Properties();
+
+ props.setProperty("ij.database", "jdbc:derby:wombat;create=true");
+ props.setProperty("ij.showNoConnectionsAtStart", "true");
+ props.setProperty("ij.showNoCountForSelect", "true");
+
+ Test test = new SystemPropertyTestSetup(new ij3Test("ij3"), props);
+ test = new CleanDatabaseTestSetup(test);
+
+ return getIJConfig(test);
+ }
+}
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3Test.java
------------------------------------------------------------------------------
svn:eol-style = native