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/08/01 16:28:48 UTC

svn commit: r1152796 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/ij5.out suites/derbytools.runall tests/tools/_Suite.java tests/tools/ij5Test.java tests/tools/ij5_app.properties

Author: bpendleton
Date: Mon Aug  1 14:28:46 2011
New Revision: 1152796

URL: http://svn.apache.org/viewvc?rev=1152796&view=rev
Log:
DERBY-5327: Convert tools/ij5.sql to junit

This patch was contributed by Houx Zhang (houxzhang at gmail dot com)

This change converts the ij5.sql test to the JUnit tools suite. The test
verifies that the ij properties that control displaying the list of
connections at startup, and showing the number of rows selected in a
query, are working properly.

The new ij5.java test is added to the tools JUnit suite, and the old
test is removed from derbytools.runall.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5Test.java   (with props)
Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.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/ij5.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out?rev=1152796&r1=1152795&r2=1152796&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out Mon Aug  1 14:28:46 2011
@@ -1,4 +1,4 @@
-CONNONE* - 	jdbc:derby:wombat
+CONNECTION0* - 	jdbc:derby:wombat
 * = current connection
 ij> --
 --   Licensed to the Apache Software Foundation (ASF) under one or more
@@ -19,9 +19,11 @@ ij> --
 -- assumes the connection connOne is set up already
 -- 1)at the startup time, it will list all the connections
 -- 2)select will now display number of rows selected
+
 select count(*) from sys.systables where 1=0;
 1          
 -----------
 0          
+
 1 row selected
 ij> 

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=1152796&r1=1152795&r2=1152796&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 Mon Aug  1 14:28:46 2011
@@ -2,5 +2,4 @@ tools/dblook_test.java
 tools/dblook_test_territory.java
 tools/derbyrunjartest.java
 tools/ij.sql
-tools/ij2.sql
-tools/ij5.sql
\ No newline at end of file
+tools/ij2.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=1152796&r1=1152795&r2=1152796&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 Mon Aug  1 14:28:46 2011
@@ -59,6 +59,7 @@ public class _Suite extends BaseTestCase
         suite.addTest(RollBackWrappingWhenFailOnImportTest.suite());
         suite.addTest(ConnectWrongSubprotocolTest.suite());
         suite.addTest(ij3Test.suite());
+        suite.addTest(ij5Test.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/ij5Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5Test.java?rev=1152796&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5Test.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5Test.java Mon Aug  1 14:28:46 2011
@@ -0,0 +1,50 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.tools.ij5Test
+
+   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.JDBC;
+import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
+
+public class ij5Test extends ScriptTestCase {
+
+    public ij5Test(String script) {
+        super(script, true);
+    }   
+    
+    public static Test suite() {        
+        Properties props = new Properties();
+        
+        props.setProperty("ij.showNoConnectionsAtStart", "false");
+        props.setProperty("ij.showNoCountForSelect", "false");
+
+        Test test = new SystemPropertyTestSetup(new ij5Test("ij5"), props);
+        test = new CleanDatabaseTestSetup(test);   
+        
+        return getIJConfig(test); 
+    }   
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5Test.java
------------------------------------------------------------------------------
    svn:eol-style = native