db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r947797 - in /db/derby/code/branches/10.3: java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ java/testing/org/apache/derbyTesting/functionTests/master/ibm15/ java/...
Date Mon, 24 May 2010 20:33:22 GMT
Author: myrnavl
Date: Mon May 24 20:33:21 2010
New Revision: 947797

URL: http://svn.apache.org/viewvc?rev=947797&view=rev
Log:
DERBY-4536; testProperties and sysinfo_withproperties test failures with ibm 1.6  (sr7) on 10.3
  backport of test conversions for testProperties and sysinfo_withproperties to
  serverPropertiesTest (DERBY-3088) and SysinfoTest (DERBY-3829) and of changes
  to make ij5.sql and ijConnName.sql be independent of hashtable ordering by
  the jvm (DERBY-858).
  backport of (trunk) revisions: 608633, 612684, 616982, 617168, 688103, 688127, and 835153.

Added:
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java
      - copied, changed from r608633, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
      - copied, changed from r608633, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java
      - copied, changed from r688103, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
      - copied unchanged from r688103, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_sed.properties
      - copied unchanged from r945472, db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_sed.properties
Removed:
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/sysinfo.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ibm15/ijConnName.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij5.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ijConnName.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/sysinfo_withproperties.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.policy
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties.policy
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties_derby.properties
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties_sed.properties
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_app.properties
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_derby.properties
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_sed.properties
Modified:
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetHarnessJavaTest.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/Utilities.java
    db/derby/code/branches/10.3/tools/release/build.xml

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out Mon May 24 20:33:21 2010
@@ -1,7 +1,6 @@
 CONNONE* - 	jdbc:derby:wombat
-CONNTWO - 	jdbc:derby:lemming
 * = current connection
-ij(CONNONE)> --
+ij> --
 --   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.
@@ -17,7 +16,7 @@ ij(CONNONE)> --
 --   See the License for the specific language governing permissions and
 --   limitations under the License.
 --
--- assumes the connections connOne, connTwo are set up already
+-- 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;
@@ -25,4 +24,4 @@ select count(*) from sys.systables where
 -----------
 0          
 1 row selected
-ij(CONNONE)> 
+ij> 

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out Mon May 24 20:33:21 2010
@@ -1,6 +1,4 @@
-ERROR XJ004: Database 'nevercreated' not found.
-ERROR 08001: No suitable driver
-ij(CONNONE)> --
+ij> --
 --   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,14 +14,14 @@ ij(CONNONE)> --
 --   See the License for the specific language governing permissions and
 --   limitations under the License.
 --
--- assumes the connections connOne, connTwo are set up already
+-- assumes the connection connOne is set up already
 -- and that connThree, connFour failed to be setup correctly (bad URLs)
 -- expect connOne to be active
 show connections;
 CONNONE* - 	jdbc:derby:wombat
-CONNTWO - 	jdbc:derby:lemming
 * = current connection
-ij(CONNONE)> set connection connOne;
+ij> connect 'jdbc:derby:lemming;create=true' as connTwo;
+ij(CONNTWO)> set connection connOne;
 ij(CONNONE)> values 1;
 1          
 -----------

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientRemote.exclude Mon May 24 20:33:21 2010
@@ -11,11 +11,8 @@
 #     the server machine
 # derbynet/maxthreads - tries to use NetworkServerControl statements
 # derbynet/runtimeinfo - tries to use NetworkServerControl statements
-# derbynet/sysinfo - tries to use NetworkServerControl statements
-# derbynet/sysinfo_withproperties - tries to use NetworkServerControl statements and for the test, server needs to be
 # started with specific property set - DERBY928 for reference 
 # thus not suitable for remote server testing in its current form. - DERBY-928
-# derbynet/testProperties - tries to use NetworkServerControl statements
 # derbynet/timeslice - tries to use NetworkServerControl statements
 # derbynet/DerbyNetAutoStart - tries to start networkserver
 # lang/wisconsin - optimization is quite different when running remote server.
@@ -27,9 +24,6 @@ derbynet/dblook_test_net.java
 derbynet/dblook_test_net_territory.java
 derbynet/maxthreads.java
 derbynet/runtimeinfo.java
-derbynet/sysinfo.java
-derbynet/sysinfo_withproperties.java
-derbynet/testProperties.java
 derbynet/timeslice.java
 derbynet/DerbyNetAutoStart.java
 lang/wisconsin.java

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude Mon May 24 20:33:21 2010
@@ -11,8 +11,6 @@
 # derbynet/dblook_test_net_territory.java - expects different dir structure
 # stress/stress.multi - exits suite
 # derbynet/runtimeinfo.java - different sessions
-# derbynet/sysinfo.java - needs other properties
-# derbynet/sysinfo_withproperties.java - needs other properties
 # following fail for various reasons, many related to not being able to connect:
 #  jdbcapi/odbc_metadata.java
 #  lang/optimizerOverrides.sql
@@ -29,8 +27,6 @@ derbynet/DerbyNetAutoStart.java
 derbynet/dblook_test_net.java
 derbynet/dblook_test_net_territory.java
 derbynet/runtimeinfo.java
-derbynet/sysinfo.java
-derbynet/sysinfo_withproperties.java
 stress/stress.multi
 jdbcapi/odbc_metadata.java
 lang/optimizerOverrides.sql

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetRemote.exclude Mon May 24 20:33:21 2010
@@ -11,12 +11,9 @@
 #     the server machine
 # derbynet/maxthreads - tries to use NetworkServerControl statements
 # derbynet/runtimeinfo - tries to use NetworkServerControl statements
-# derbynet/sysinfo - tries to use NetworkServerControl statements
-# derbynet/testProperties - tries to use NetworkServerControl statements
 # thus not suitable for remote server testing in its current form. - DERBY-928
 # derbynet/timeslice - tries to use NetworkServerControl statements
 # derbynet/DerbyNetAutoStart - tries to start networkserver
-# derbynet/sysinfo_withproperties - tries to use NetworkServerControl statements and test requires server to 
 # be started with a specific property. see DERBY-928 for reference
 # lang/wisconsin - optimization is quite different when running remote server.
 # junitTests/derbyNet/CompatibilityTest.java - tries to start and shutdown the server
@@ -26,9 +23,6 @@ derbynet/dblook_test_net.java
 derbynet/dblook_test_net_territory.java
 derbynet/maxthreads.java
 derbynet/runtimeinfo.java
-derbynet/sysinfo.java
-derbynet/sysinfo_withproperties.java
-derbynet/testProperties.java
 derbynet/timeslice.java
 derbynet/DerbyNetAutoStart.java
 lang/wisconsin.java

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude Mon May 24 20:33:21 2010
@@ -10,8 +10,6 @@
 # derbynet/dblook_test_net.java - fails, test misses properties
 # derbynet/dblook_test_net_territory.java - fails, test misses properties
 # derbynet/runtimeinfo.java - fails with already existing threads (maybe intermittent)
-# derbynet/sysinfo.java - fails because not access to java.class.path
-# derbynet/sysinfo_withproperties.java - fails because not access to java.class.path
 # jdbcapi/odbc_metadata.java - fails...
 # lang/optimizerOverrides.sql - fails...
 # lang/big.sql - checks depend on dir structure
@@ -26,8 +24,6 @@ derbynet/DerbyNetAutoStart.java
 derbynet/dblook_test_net.java
 derbynet/dblook_test_net_territory.java
 derbynet/runtimeinfo.java
-derbynet/sysinfo.java
-derbynet/sysinfo_withproperties.java
 jdbcapi/odbc_metadata.java
 lang/optimizerOverrides.sql
 lang/big.sql

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall Mon May 24 20:33:21 2010
@@ -3,10 +3,7 @@ derbynet/dblook_test_net_territory.java
 derbynet/DerbyNetAutoStart.java
 derbynet/maxthreads.java
 derbynet/runtimeinfo.java
-derbynet/sysinfo.java
-derbynet/sysinfo_withproperties.java
 derbynet/testProtocol.java
-derbynet/testProperties.java
 derbynet/testconnection.java
 derbynet/timeslice.java
 jdbcapi/metadata.java

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall Mon May 24 20:33:21 2010
@@ -2,7 +2,6 @@ derbynet/dblook_test_net.java
 derbynet/dblook_test_net_territory.java
 derbynet/maxthreads.java
 derbynet/runtimeinfo.java
-derbynet/testProperties.java
 derbynet/testconnection.java
 derbynet/timeslice.java
 jdbcapi/metadata.java

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetHarnessJavaTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetHarnessJavaTest.java?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetHarnessJavaTest.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetHarnessJavaTest.java Mon May 24 20:33:21 2010
@@ -37,18 +37,14 @@ import org.apache.derbyTesting.junit.Sup
  * The following tests could not be run this way, reasons for the
  * 
  * dblook_test_net - filters output
- * dataSourcePermissions_net - InvocationTargetException, needs investigation
  * dblook_test_net_territory - filters output 
  * getCurrentProperties - ExceptionInInitializerError, needs investigation
  * maxthreads - forks VM
  * runtimeinfo" - filters output
  * sysinfo" - forks VM
  * sysinfo_withproperties" - forks VM
- * testProperties" - filters output
- * testconnection" - forks VM
  * testij" - filters output
  * timeslice" - forks VM
- * NSinSameJVM" - filters output
  * DerbyNetAutoStart" - forks VM
  */
 public class NetHarnessJavaTest extends HarnessJavaTest {

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java Mon May 24 20:33:21 2010
@@ -497,9 +497,9 @@ public class SecureServerTest extends Ba
     private boolean serverCameUp()
         throws Exception
     {
-        return NetworkServerTestSetup.pingForServerStart(
+        return NetworkServerTestSetup.pingForServerUp(
             NetworkServerTestSetup.getNetworkServerControl(),
-            nsTestSetup.getServerProcess());
+            nsTestSetup.getServerProcess(), true);
     }
 
 }

Copied: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java (from r608633, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java)
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java?p2=db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java&r1=608633&r2=947797&rev=947797&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.java Mon May 24 20:33:21 2010
@@ -24,25 +24,18 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.net.InetAddress;
 import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import java.sql.SQLException;
-import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Properties;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.derby.drda.NetworkServerControl;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
-import org.apache.derbyTesting.junit.BaseTestCase;
 import org.apache.derbyTesting.junit.Derby;
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.NetworkServerTestSetup;
@@ -75,20 +68,7 @@ public class ServerPropertiesTest  exten
     private static String POLICY_FILE_NAME = 
         "functionTests/tests/derbynet/ServerPropertiesTest.policy";
     private static String TARGET_POLICY_FILE_NAME = "server.policy";
-    
-    private static String[] serverProperties = {
-                "derby.drda.logConnections",
-                "derby.drda.traceAll",
-                "derby.drda.traceDirectory",
-                "derby.drda.keepAlive",
-                "derby.drda.timeSlice",
-                "derby.drda.host",
-                "derby.drda.portNumber",
-                "derby.drda.minThreads",
-                "derby.drda.maxThreads",
-                "derby.drda.startNetworkServer",
-                "derby.drda.debug"
-                };
+    private int[] portsSoFar;
     
     public ServerPropertiesTest(String name) {
         super(name);
@@ -98,33 +78,43 @@ public class ServerPropertiesTest  exten
     public static Test suite()
     {
         TestSuite suite = new TestSuite("ServerPropertiesTest");
-
-        // Server booting requires that we run from the jar files
-        // Need derbynet.jar in the classpath!
-        // TODO: check - can this be modified to use noSecurityManager
-        //    for classes?
-        // if (!TestConfiguration.loadingFromJars()) { return suite; }
           
         if (!Derby.hasServer()) return suite;
         // don't run with JSR169 for 1. this is network server and
         // 2. the java executable may be named differently
         if (JDBC.vmSupportsJSR169()) return suite;
         
-        // this test doesn't use a client/server setup, instead does the 
+        // this fixture doesn't use a client/server setup, instead does the 
         // relevant starting/stopping inside the test
         // Add security manager policy that allows executing java commands
-        Test setPortPriority = new ServerPropertiesTest("ttestSetPortPriority");
-        setPortPriority = decorateWithPolicy(setPortPriority);
-        suite.addTest(setPortPriority);
-        
-        // unfinished properties settings. decorateTest add policy file and sets
-        // up properties
-        suite.addTest(decorateTest("ttestDefaultProperties", getStartupProperties(),
-            new String[] {}));
+        suite.addTest(decorateTest("ttestSetPortPriority", 
+                new String[] {}, new String[] {}, false));
         
-        // The other tests, testToggleTrace (trace on/off), 
+        // test unfinished properties settings. 
+        // decorateTest adds policy file and sets up properties
+        // the properties settings are incorrect i.e. they have no value
+        String[] badServerProperties = {
+                "derby.drda.logConnections=",
+                "derby.drda.traceAll=",
+                "derby.drda.traceDirectory=",
+                "derby.drda.keepAlive=",
+                "derby.drda.timeSlice=",
+                "derby.drda.host=",
+                "derby.drda.portNumber=",
+                "derby.drda.minThreads=",
+                "derby.drda.maxThreads=",
+                "derby.drda.startNetworkServer=",
+                "derby.drda.debug="
+                };
+        // fixture hits error DRDA_MissingNetworkJar (Cannot find derbynet.jar) so,
+        // only run with jars
+        if (TestConfiguration.loadingFromJars())
+            suite.addTest(decorateTest("ttestDefaultProperties", 
+                badServerProperties, new String[] {}, true));
+        
+        // The other fixtures, testToggleTrace (trace on/off), 
         // testToggleLogConnections (logconnections on/off) , and
-        // testWrongCommands can all use the default setup - with policy
+        // testWrongCommands can all use the default setup with adjusted policy
         
         // need english locale so we can compare command output for those tests 
         if (!Locale.getDefault().getLanguage().equals("en"))
@@ -141,10 +131,21 @@ public class ServerPropertiesTest  exten
     
     public void tearDown() throws Exception {
         super.tearDown();
-        serverProperties = null;
         POLICY_FILE_NAME = null;
         TARGET_POLICY_FILE_NAME = null;
         _inputStreamHolder = null;
+        if (portsSoFar != null)
+        {
+            for (int i = 0 ; i < portsSoFar.length ; i++)
+            {
+                try {
+                    shutdownServer(portsSoFar[i], true);
+                } catch (SQLException e) {
+                    fail("could not shutdown server at port " + portsSoFar[i]);
+                }
+            }
+            portsSoFar=null;
+        }
     }
     
     /**
@@ -154,7 +155,8 @@ public class ServerPropertiesTest  exten
      * </p>
      */
     private static Test decorateTest(String testName, 
-            String[] startupProperties, String[] startupArgs)
+            String[] startupProperties, String[] startupArgs,
+            boolean startServer)
     {
         ServerPropertiesTest spt = new ServerPropertiesTest(testName);
         String [] startupProps;
@@ -164,36 +166,25 @@ public class ServerPropertiesTest  exten
             startupProps = startupProperties;
         if (startupArgs == null)
             startupArgs = new String[]{};
-        // start networkServer as a process
-        NetworkServerTestSetup networkServerTestSetup =
-            new NetworkServerTestSetup(spt,
-                startupProps, startupArgs, true, 
-                spt._inputStreamHolder);
+        NetworkServerTestSetup networkServerTestSetup;
+        if (startServer)
+        {
+            // start networkServer as a process
+            networkServerTestSetup = new NetworkServerTestSetup(
+                spt, startupProps, startupArgs, true, true, spt._inputStreamHolder);
+        }
+        else
+        {
+            // get networkserver setup but don't start anything
+            networkServerTestSetup = new NetworkServerTestSetup(
+                spt, true, false);
+        }
         Test test = decorateWithPolicy(networkServerTestSetup);
         test = TestConfiguration.defaultServerDecorator(test);
         return test;
     }   
     
     /**
-     * <p>
-     * Return a set of startup properties for testing
-     * </p>
-     */
-    private static  String[]  getStartupProperties()
-    {
-
-        ArrayList list = new ArrayList();
-        for (int i = 0 ; i<serverProperties.length ; i++)
-        {
-            //System.out.println(serverProperties[i]);
-            list.add(serverProperties[i] + "=");
-        }
-        String[] result = new String[ list.size()];
-        list.toArray(result);
-        return result;
-    }
-    
-    /**
      * Construct the name of the server policy file.
      */
     private String makeServerPolicyName()
@@ -230,35 +221,57 @@ public class ServerPropertiesTest  exten
         );
         return test;
     }
-
-    private static void verifyProperties(String[] expectedValues) { 
+ 
+    private static Properties getTheProperties() {
         Properties p;
         try {
-        NetworkServerControl derbyServer = NetworkServerTestSetup.getNetworkServerControl(); 
-            p = derbyServer.getCurrentProperties();
+            p = NetworkServerTestSetup.getNetworkServerControl().getCurrentProperties();
         } catch (Exception e) {
             p = null; // should be ok to set to null (to satisfy compiler)
             // as fail will exit without further checks.
             e.printStackTrace();
             fail("unexpected exception getting properties from server");
         }
-        
-        Enumeration e = p.propertyNames();
+        return p;
+    }
+
+    // check for 1 Property/Value pair, passing in expected as a String
+    // "<propertyName>=<expectedPropertyValue>"
+    private static void verifyProperties(String expectedPropAndValue) {
+        Properties p = getTheProperties();
+        assertPropertyValueCorrect(p, expectedPropAndValue);
+        p=null;
+    }
+ 
+    // check for an array of Property/Value pairs, passing each expected pair 
+    // in as a String "<propertyName>=<expectedPropertyValue>"
+    private static void verifyProperties(String[] expectedValues) { 
+        Properties p = getTheProperties();
         // for debugging:
         for (int i=0 ; i<expectedValues.length; i++){
             println("expV: " + expectedValues[i]);
         }
         assertEquals(expectedValues.length , p.size());
-        for ( int i = 0 ; i < p.size() ; i++)
+        for ( int i = 0 ; i < expectedValues.length ; i++)
         {
-            String propName = (String)e.nextElement();
-            // next line for debugging
-            println("propName: " + propName);
-            String propval = (String)p.get(propName);
-            assertEquals(expectedValues[i], propval);
+            assertPropertyValueCorrect(p, expectedValues[i]);
         }
         p = null;
     }
+ 
+    private static void assertPropertyValueCorrect(Properties p, String expectedPropAndValue) {
+        String[] expPropValueString = expectedPropAndValue.split("=");
+        try {
+            // for debugging
+            String actualPropertyValue = p.getProperty(expPropValueString[0]);
+            println("exppropName: " + expPropValueString[0]);
+            println("exppropValue: " + expPropValueString[1]);
+            println("actualpropValue: " + actualPropertyValue);
+            assertEquals(expPropValueString[1],actualPropertyValue);
+        } catch(Exception e) {
+            fail("could not find property " + expPropValueString[0]);
+        }
+    }
     
     public int getAlternativePort() throws SQLException {
 
@@ -306,55 +319,22 @@ public class ServerPropertiesTest  exten
     }
     
     /**
-     *  Ping for the server started on the specified port
+     *  Ping for the server to be up - or down.
+     *  @param port port number to be used in the ping
+     *  @param expectServerUp indicator whether the server is expected to be up
      */
-    public boolean canPingServer(int port, int SLEEP_TIME, int retries) 
+    private boolean canPingServer(int port, boolean expectServerUp) 
     throws SQLException {
-    
-        // Wait for the network server to respond
-        boolean started = false;
-        if (retries > 10)
-            retries = 10;         // Max retries = max seconds to wait
-
-        while (!started && retries > 0) {
-            try {
-                NetworkServerControl nsctrl = new NetworkServerControl(
-                        InetAddress.getByName(
-                                TestConfiguration.getCurrent().getHostName()),
-                                port);
-                // Sleep x second and then ping the network server
-                Thread.sleep(SLEEP_TIME);
-                nsctrl.ping();
-
-                // If ping does not throw an exception the server has started
-                started = true;
-            } catch(Exception e) {         
-                retries--;
-            }
-        }
-        return (started);
-    }
         
-    private Process runProcess(String[] command) {
-        final String[] finalCommand = command;
-        Process serverProcess = (Process) AccessController.doPrivileged
-        (
-         new PrivilegedAction()
-         {
-             public Object run()
-             {
-                 Process result = null;
-                 try {
-                    result = Runtime.getRuntime().exec(finalCommand);
-                 } catch (Exception ex) {
-                     ex.printStackTrace();
-                     println("failure starting process");
-                 }
-                 return result;
-             }
-         }
-        );
-        return serverProcess;
+        boolean serverUp = false;
+        try {
+            serverUp = NetworkServerTestSetup.pingForServerUp(
+                NetworkServerTestSetup.getNetworkServerControl(port), null,
+                expectServerUp);
+        } catch (Exception e) {
+            fail("unexpected Exception while pinging");
+        }
+        return serverUp;
     }
     
     // obtain & shutdown the network server;
@@ -364,20 +344,20 @@ public class ServerPropertiesTest  exten
         try {
             if (specifyPort)
             {
-                NetworkServerControl nsctrl = new NetworkServerControl(
-                    InetAddress.getByName(
-                        TestConfiguration.getCurrent().getHostName()), port);
+                NetworkServerControl nsctrl = 
+                    NetworkServerTestSetup.getNetworkServerControl(port);
                 nsctrl.shutdown();
             }
             else
             {
-                NetworkServerControl nsctrl = new NetworkServerControl();
+                NetworkServerControl nsctrl = 
+                    NetworkServerTestSetup.getNetworkServerControlDefault();
                 nsctrl.shutdown();
             }
         } catch (Exception e) {
             return "failed to shutdown server with API parameter";
         }
-        if (canPingServer(port,0,1)) {
+        if (canPingServer(port,false)) {
             return "Can still ping server";
         }
         return null;
@@ -391,10 +371,8 @@ public class ServerPropertiesTest  exten
         try {
             if (specifyPort)
             {
-                NetworkServerControl nsctrl = new NetworkServerControl(
-                        InetAddress.getByName(
-                            TestConfiguration.getCurrent().getHostName()),
-                            port);
+                NetworkServerControl nsctrl = 
+                    NetworkServerTestSetup.getNetworkServerControl(port);
                 // For debugging, to make output come to console uncomment:
                 //nsctrl.start(new PrintWriter(System.out, true));
                 // and comment out:
@@ -403,7 +381,8 @@ public class ServerPropertiesTest  exten
             }
             else
             {
-            NetworkServerControl nsctrl = new NetworkServerControl();
+                NetworkServerControl nsctrl = 
+                    NetworkServerTestSetup.getNetworkServerControlDefault();
                 // For debugging, to make output come to console uncomment:
                 //nsctrl.start(new PrintWriter(System.out, true));
                 // and comment out:
@@ -414,40 +393,18 @@ public class ServerPropertiesTest  exten
             return "failed to start server with port " + port;
         }
         // check that we have this server up now
-        if (!canPingServer(port, 1, 10)) {
+        if (!canPingServer(port, true)) {
             return "Cannot ping server started with port set to " + port;
         }
         return null;
     }
     
-    /**
-     *  Shutdown the server on the specified port - for cleanup
-     */
-    public void shutdownServer(int port) throws SQLException {
-        try {
-        NetworkServerControl nsctrl = new NetworkServerControl(
-            InetAddress.getByName(
-                TestConfiguration.getCurrent().getHostName()), port);
-        nsctrl.shutdown();
-        } catch (Exception e) {
-            // ignore errors for this one.
-        }
-    }
-    
-   public void checkWhetherNeedToShutdown(int[] portsSoFar, String failReason) {
+   public void checkWhetherNeedToShutdown(int[] ports, String failReason) {
        
+       portsSoFar = ports;
        if (!(failReason == null))
        {
-           if (portsSoFar != null && portsSoFar[0] != 0);
-           for (int i = 0 ; i < portsSoFar.length ; i++)
-           {
-               try {
-                   shutdownServer(portsSoFar[i]);
-               } catch (SQLException e) {
-                   fail("could not shutdown server at port " + portsSoFar[i]);
-               }
-           }
-       fail(failReason);
+           fail(failReason);
        }
    }
    
@@ -458,101 +415,14 @@ public class ServerPropertiesTest  exten
     * @throws IOException
     */
    private void  assertSuccessfulCmd(String expectedString, String[] Cmd) throws InterruptedException, IOException {
-       InputStream is = Utilities.execJavaCmd(Cmd, 0);
-       byte[] b = new byte[80];
-       is.read(b, 0, 80);
-       String output = new String(b);
-       //System.out.println("output: " + output);
-       assertTrue(output.startsWith(expectedString));
+       assertExecJavaCmdAsExpected(new String[] {expectedString}, Cmd, 0);
    }
 
-   /**
-    * Execute command and verify that it completes with
-    * an error
-    * This method does *not* use Utilities.execJavaCmd, because
-    * that one will hang on waitFor() when the usage message needs
-    * to get extracted. This is probably DERBY-3251.
-    * Note: this method may possibly be extracted 
-    *     be placed in either Utilities or one of the Configuration
-    *     or Setup classes, but as there is an intermittent problem
-    *     with it, holding off on that
-    * @param expectedString String to compare the resulting output with
-    * @param cmd array of java arguments for command
-    * @param expectedExitValue expected return value from the command
-    * @throws InterruptedException
-    * @throws IOException
-    */
-   private void  assertUsageMessage(
-           String[] expectedString, String[] cmd, int expectedExitValue)
-   throws InterruptedException, IOException {
-       
-       int totalSize = 3 + cmd.length;
-       String[] tcmd = new String[totalSize];
-       tcmd[0] = "java";
-       tcmd[1] = "-classpath";
-       tcmd[2] = BaseTestCase.getSystemProperty("java.class.path");
-               
-       System.arraycopy(cmd, 0, tcmd, 3, cmd.length);
-       
-       final String[] command = tcmd;
-       Process pr = null;
-       try {
-           pr = (Process) AccessController
-               .doPrivileged(new PrivilegedExceptionAction() {
-                   public Object run() throws IOException {
-                       Process result = null;
-                           result = Runtime.getRuntime().exec(command);
-                       return result;
-                   }
-               });
-       } catch (PrivilegedActionException pe) {
-           Exception e = pe.getException();
-           if (e instanceof IOException)
-               throw (IOException) e;
-           else
-               throw (SecurityException) e;
-       }
-       InputStream is = pr.getInputStream();
-       if ( is == null )
-       {
-           fail("Unexpectedly receiving no text from the java command");
-       }
-       
-       String output = "";
-       try
-       {
-           char[] ca = new char[1024];
-           // Create an InputStreamReader with UTF-8 encoding
-           // use default encoding; we're hoping this to be en.
-           // if not, it's not going to match the expected string.
-           InputStreamReader inStream;
-               //inStream = new InputStreamReader(is, "UTF-8");
-               inStream = new InputStreamReader(is);
-           // keep reading from the stream until all done
-           while ((inStream.read(ca, 0, ca.length)) != -1)
-           {
-               output = output + new String(ca).trim();
-           }
-       } catch (Exception e) {
-           fail("Exception accessing inputstream from javacommand");
-       }
-       
-       // wait until the process exits
-       pr.waitFor();
-       
-       Assert.assertEquals(expectedExitValue, pr.exitValue());
-       for (int i=0 ; i<expectedString.length ; i++)
-       {
-           assertFalse(output.indexOf(expectedString[i]) < 0);
-       }
-   }
-   
-   
-
     /**
      *  Test port setting priority
      */
-    public void ttestSetPortPriority() throws SQLException {
+    public void ttestSetPortPriority() 
+    throws SQLException, InterruptedException, IOException {
         // default is 1527. The test harness configuration would
         // use the API and add the port number. We want to test all
         // 4 mechanisms for specifying the port.
@@ -565,10 +435,15 @@ public class ServerPropertiesTest  exten
         // Note: if the harness gets modified to accomodate splitting
         //    over different networkservers, there maybe something more
         //    appropriate than shutting down the default server.
-        if (canPingServer(1527, 0, 1)) {
+        // we really expect the server to be down, let's
+        // not do any waiting around
+        NetworkServerTestSetup.setWaitTime(0);
+        if (canPingServer(1527, false)) {
             // for now, shutdown
             shutdownServer(1527, false);
         }
+        NetworkServerTestSetup.setDefaultWaitTime();
+
         // start the default, which at this point should be localhost and 1527
         String actionResult = startServer(1527, false);
         checkWhetherNeedToShutdown(new int[] {1527}, actionResult);
@@ -579,24 +454,7 @@ public class ServerPropertiesTest  exten
         derbyProperties.put("derby.drda.portNumber", 
                 new Integer(firstAlternatePort).toString());
 
-        String tmpDerbyHome = "";
-        try {
-            final String derbyHome = (String)
-            AccessController.doPrivileged
-            (new java.security.PrivilegedAction(){
-                public Object run(){
-                    String x = System.getProperty(
-                        "derby.system.home");
-                    println("derbyhome: " + x);
-                        return x;
-                }
-            });
-            tmpDerbyHome = derbyHome;
-        } catch (Exception e) {
-            checkWhetherNeedToShutdown(new int[] {1527}, "failed to get derby.system.home for test");
-        }
-        
-        final String derbyHome = tmpDerbyHome;
+        final String derbyHome = getSystemProperty("derby.system.home");
         Boolean b = (Boolean)AccessController.doPrivileged
         (new java.security.PrivilegedAction(){
             public Object run(){
@@ -613,7 +471,7 @@ public class ServerPropertiesTest  exten
             }
         });
         if (b.booleanValue())
-       {
+        {
             checkWhetherNeedToShutdown(new int[] {1527}, "failed to write derby.properties");
         }
         // have to shutdown engine to force read of derby.properties
@@ -640,51 +498,31 @@ public class ServerPropertiesTest  exten
 
         // now with -p. 
         int fourthAlternatePort = getAlternativePort();
-        String classpath = getSystemProperty("java.class.path");
-        String[] commandArray = {"java", "-classpath", classpath, 
-            "-Dderby.system.home=" + derbyHome,
+        String[] commandArray = {"-Dderby.system.home=" + derbyHome,
             "org.apache.derby.drda.NetworkServerControl", "-p",
             String.valueOf(fourthAlternatePort).toString(), 
             "-noSecurityManager", "start"};
-        Process p = runProcess(commandArray);
+        execJavaCmd(commandArray);
         
-        if (!canPingServer(fourthAlternatePort,1,10)) {
+        if (!canPingServer(fourthAlternatePort, true)) {
             actionResult = "Can not ping server specified with -p";
         }
         checkWhetherNeedToShutdown(new int[] {1527, firstAlternatePort, secondAlternatePort,
             thirdAlternatePort, fourthAlternatePort}, actionResult);
-            
+                        
         // shutdown with -p
-        commandArray = new String[] {"java", "-classpath", classpath, 
-                "-Dderby.system.home=" + derbyHome,
+        commandArray = new String[] {"-Dderby.system.home=" + derbyHome,
                 "org.apache.derby.drda.NetworkServerControl", "-p",
                 String.valueOf(fourthAlternatePort).toString(), 
                 "-noSecurityManager", "shutdown"};
-        Process p2 = runProcess(commandArray);
+        execJavaCmd(commandArray);
 
-        if (canPingServer(fourthAlternatePort,1000,10)) {
+        if (canPingServer(fourthAlternatePort, false)) {
             actionResult = "Can still ping server specified with -p";
         }
         checkWhetherNeedToShutdown(new int[] {1527, firstAlternatePort, secondAlternatePort,
             thirdAlternatePort, fourthAlternatePort}, actionResult);
             
-        // clean up
-        InputStream istr = p.getInputStream();
-        InputStream istr2 = p2.getInputStream();
-        try {
-            istr.close();
-            istr2.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail("cannot close spawned process' inputstream");
-        }
-        istr=null;
-        istr2=null;
-        p.destroy();
-        p=null;
-        p2.destroy();
-        p2=null;
-        
         // shutdown with port specified in constructor
         actionResult = shutdownServer(thirdAlternatePort, true);
         checkWhetherNeedToShutdown( new int[] {1527, firstAlternatePort, secondAlternatePort,
@@ -729,14 +567,18 @@ public class ServerPropertiesTest  exten
     {
         //check that default properties are used
         verifyProperties(new String[] {
-                // getProperties returns properties in sequence:
-                // maxThreads; sslMode; keepAlive; minThreads; portNumber;
-                // logConnections; timeSlice; startNetworkServer; host; traceAll 
-                "0", "off", "true", "0", 
-                String.valueOf(TestConfiguration.getCurrent().getPort()),
-                "false", "0", "false", 
-                String.valueOf(TestConfiguration.getCurrent().getHostName()), 
-                "false"});     
+                "derby.drda.maxThreads=0", 
+                "derby.drda.sslMode=off", 
+                "derby.drda.keepAlive=true", 
+                "derby.drda.minThreads=0", 
+                "derby.drda.portNumber=" + 
+                    String.valueOf(TestConfiguration.getCurrent().getPort()),
+                "derby.drda.logConnections=false", 
+                "derby.drda.timeSlice=0", 
+                "derby.drda.startNetworkServer=false",
+                "derby.drda.host=" +
+                    String.valueOf(TestConfiguration.getCurrent().getHostName()), 
+                "derby.drda.traceAll=false"});
     }
        
     /**
@@ -745,31 +587,10 @@ public class ServerPropertiesTest  exten
     public void testToggleTrace() 
     throws SQLException, IOException, InterruptedException
     {        
-        String[] expectedTraceOff = new String[] {
-                // getProperties returns properties in sequence:
-                // traceDirectory; maxThreads; sslMode; keepAlive; minThreads; 
-                // portNumber; logConnections; timeSlice; startNetworkServer;
-                // host; traceAll
-                getSystemProperty("derby.system.home"),
-                "0", "off", "true", "0", 
-                String.valueOf(TestConfiguration.getCurrent().getPort()),
-                "false", "0", "false", 
-                //String.valueOf(TestConfiguration.getCurrent().getHostName()),
-                "127.0.0.1", 
-                "false"};     
-        String[] expectedTraceOn = new String[] {
-                // getProperties returns properties in sequence:
-                // traceDirectory; maxThreads; sslMode; keepAlive; minThreads; 
-                // portNumber; logConnections; timeSlice; startNetworkServer;
-                // host; traceAll
-                getSystemProperty("derby.system.home"),
-                "0", "off", "true", "0", 
-                String.valueOf(TestConfiguration.getCurrent().getPort()),
-                "false", "0", "false", 
-                //String.valueOf(TestConfiguration.getCurrent().getHostName()),
-                "127.0.0.1", 
-                "true"};     
-        
+        // we only care about the traceAll property, the rest will be unchanged
+        String expectedTraceOff = "derby.drda.traceAll=false";
+        String expectedTraceOn = "derby.drda.traceAll=true";      
+
         verifyProperties(expectedTraceOff);     
 
         String[] traceCmd = new String[] {
@@ -790,31 +611,10 @@ public class ServerPropertiesTest  exten
     public void testToggleLogConnections() 
     throws SQLException, IOException, InterruptedException
     {
-        String[] expectedLogConnectionsOff = new String[] {
-                // getProperties returns properties in sequence:
-                // traceDirectory; maxThreads; sslMode; keepAlive; minThreads; 
-                // portNumber; logConnections; timeSlice; startNetworkServer;
-                // host; traceAll
-                getSystemProperty("derby.system.home"),
-                "0", "off", "true", "0", 
-                String.valueOf(TestConfiguration.getCurrent().getPort()),
-                "false", "0", "false", 
-                //String.valueOf(TestConfiguration.getCurrent().getHostName()),
-                "127.0.0.1", 
-                "false"};     
-        String[] expectedLogConnectionsOn = new String[] {
-                // getProperties returns properties in sequence:
-                // traceDirectory; maxThreads; sslMode; keepAlive; minThreads; 
-                // portNumber; logConnections; timeSlice; startNetworkServer;
-                // host; traceAll
-                getSystemProperty("derby.system.home"),
-                "0", "off", "true", "0", 
-                String.valueOf(TestConfiguration.getCurrent().getPort()),
-                "true", "0", "false", 
-                //String.valueOf(TestConfiguration.getCurrent().getHostName()),
-                "127.0.0.1", 
-                "false"};     
-        
+        // only care about the LogConnections property; the rest is unchanged
+        String expectedLogConnectionsOff = "derby.drda.logConnections=false";
+        String expectedLogConnectionsOn = "derby.drda.logConnections=true";       
+ 
         verifyProperties(expectedLogConnectionsOff);     
 
         String[] cmd = new String[] {
@@ -845,15 +645,15 @@ public class ServerPropertiesTest  exten
         // we'll assume that we get the full message if we get 'Usage'
         // because sometimes, the message gets returned with carriage return,
         // and sometimes it doesn't, checking for two different parts...
-        assertUsageMessage(new String[] 
+        assertExecJavaCmdAsExpected(new String[] 
             {"No arguments given.", "Usage: "}, cmd, 1);
         //Unknown command
         cmd = new String[] {nsc, "unknowncmd"};
-        assertUsageMessage(new String[] 
+        assertExecJavaCmdAsExpected(new String[] 
             {"Command unknowncmd is unknown.", "Usage: "}, cmd, 0);
         // wrong number of arguments
         cmd = new String[] {nsc, "ping", "arg1"};
-        assertUsageMessage(new String[] 
+        assertExecJavaCmdAsExpected(new String[] 
             {"Invalid number of arguments for command ping.",
              "Usage: "}, cmd, 1);
     }

Copied: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy (from r608633, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy)
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy?p2=db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy&r1=608633&r2=947797&rev=947797&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy Mon May 24 20:33:21 2010
@@ -172,6 +172,12 @@ grant codeBase "${derbyTesting.testjar}d
 // super-set of the jar permissions for running out of the classes directory
 //
 grant codeBase "${derbyTesting.codeclasses}" {
+
+  // just add the complete gross policy change for ServerPropertiesTest
+  // execute permission is for 'java', but this can be at a variety of locations.
+  permission java.io.FilePermission "<<ALL FILES>>", "execute";
+  permission java.security.SecurityPermission "getPolicy";
+
   // Access all properties using System.getProperties
   permission java.util.PropertyPermission "*", "read, write";
   

Copied: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java (from r688103, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java)
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java?p2=db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java&r1=688103&r2=947797&rev=947797&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java Mon May 24 20:33:21 2010
@@ -45,7 +45,7 @@ import org.apache.derbyTesting.junit.Tes
 public class SysinfoTest extends BaseJDBCTestCase {
 
     private static String TARGET_POLICY_FILE_NAME="sysinfo.policy";
-    private String OUTPUT;
+    private String [] OUTPUT;
 
     /**
      * Set to true before adding a test to the suite to add some extra properties.
@@ -62,41 +62,41 @@ public class SysinfoTest extends BaseJDB
         /**
          * Output from sysinfo without the extra properties. 
          */
-        String OUTPUT1 = 
-            "--------- Derby Network Server Information --------\n" + 
-            "derby.drda.maxThreads=0\n" + 
-            "derby.drda.sslMode=off\n" + 
-            "derby.drda.keepAlive=true\n" + 
-            "derby.drda.minThreads=0\n" + 
-            "derby.drda.portNumber=1527\n" + 
-            "derby.drda.logConnections=false\n" + 
-            "derby.drda.timeSlice=0\n" + 
-            "derby.drda.startNetworkServer=false\n" + 
-            "derby.drda.traceAll=false\n" + 
-            "--------- Derby Information --------\n" + 
-            "------------------------------------------------------\n" + 
-            "----------------- Locale Information -----------------\n" + 
-            "------------------------------------------------------";
+        String [] OUTPUT1 = {
+            "--------- Derby Network Server Information --------" , 
+            "derby.drda.maxThreads=0" ,
+            "derby.drda.sslMode=off" , 
+            "derby.drda.keepAlive=true" , 
+            "derby.drda.minThreads=0" , 
+            "derby.drda.portNumber=1527" , 
+            "derby.drda.logConnections=false" ,
+            "derby.drda.timeSlice=0" , 
+            "derby.drda.startNetworkServer=false" , 
+            "derby.drda.traceAll=false" ,
+            "--------- Derby Information --------" , 
+            "------------------------------------------------------" , 
+            "----------------- Locale Information -----------------" , 
+            "------------------------------------------------------"};
 
         /**
          * Output by sysinfo with the extra properties.
          */
-        String OUTPUT2 = 
-            "--------- Derby Network Server Information --------\n" + 
-            "derby.drda.securityMechanism=USER_ONLY_SECURITY\n" + 
-            "derby.drda.maxThreads=0\n" + 
-            "derby.drda.sslMode=off\n" + 
-            "derby.drda.keepAlive=true\n" + 
-            "derby.drda.minThreads=0\n" + 
-            "derby.drda.portNumber=1527\n" + 
-            "derby.drda.logConnections=false\n" + 
-            "derby.drda.timeSlice=0\n" + 
-            "derby.drda.startNetworkServer=false\n" + 
-            "derby.drda.traceAll=false\n" + 
-            "--------- Derby Information --------\n" + 
-            "------------------------------------------------------\n" + 
-            "----------------- Locale Information -----------------\n" + 
-            "------------------------------------------------------";
+        String [] OUTPUT2 = {
+            "--------- Derby Network Server Information --------" , 
+            "derby.drda.securityMechanism=USER_ONLY_SECURITY" , 
+            "derby.drda.maxThreads=0" ,
+            "derby.drda.sslMode=off" ,
+            "derby.drda.keepAlive=true" , 
+            "derby.drda.minThreads=0" , 
+            "derby.drda.portNumber=1527" , 
+            "derby.drda.logConnections=false" ,
+            "derby.drda.timeSlice=0" ,
+            "derby.drda.startNetworkServer=false" , 
+            "derby.drda.traceAll=false" ,
+            "--------- Derby Information --------" , 
+            "------------------------------------------------------" , 
+            "----------------- Locale Information -----------------" , 
+            "------------------------------------------------------"};
 
         if (useProperties)
             OUTPUT = OUTPUT2;
@@ -108,7 +108,9 @@ public class SysinfoTest extends BaseJDB
      * Creates a suite with two testcases, with and without some extra 
      * system properties.
      * 
-     * @return
+     * @return an empty suite if derbynet.jar is not available, and
+     *      if the JVM only supports JSR169, otherwise, return a suite with
+     *      6 tests, 3 with properties set, 3 without.
      */
     public static Test suite() {
         TestSuite suite = new TestSuite("SysinfoTest");
@@ -201,7 +203,8 @@ public class SysinfoTest extends BaseJDB
      */	
     public void testSysinfo() throws Exception {
         String[] SysInfoCmd = 
-            new String[] {"org.apache.derby.drda.NetworkServerControl", "sysinfo"};
+            new String[] {"org.apache.derby.drda.NetworkServerControl", "sysinfo",
+            "-p", String.valueOf(TestConfiguration.getCurrent().getPort())};
 
         Process p = execJavaCmd(SysInfoCmd);
         String s = readProcessOutput(p);
@@ -209,8 +212,7 @@ public class SysinfoTest extends BaseJDB
         s = sed(s);
 
         print("testSysinfo", s);
-        assertEquals(OUTPUT,s);
-
+        assertMatchingStringExists(s);
     }
 
     /**
@@ -221,11 +223,11 @@ public class SysinfoTest extends BaseJDB
     public void testSysinfoMethod() throws Exception {	
 
         String s = NetworkServerTestSetup.
-        getNetworkServerControlDefault().getSysinfo();
+        getNetworkServerControl(TestConfiguration.getCurrent().getPort()).getSysinfo();
         s = sed(s);
 
         print("testSysinfoMethod", s);
-        assertEquals(OUTPUT, s);
+        assertMatchingStringExists(s);
     }		
 
     /**
@@ -237,13 +239,14 @@ public class SysinfoTest extends BaseJDB
 
         String[] SysInfoLocaleCmd = 
             new String[] {"-Duser.language=de", "-Duser.country=DE", 
-                "org.apache.derby.drda.NetworkServerControl", "sysinfo"};
+                "org.apache.derby.drda.NetworkServerControl", "sysinfo",
+                "-p", String.valueOf(TestConfiguration.getCurrent().getPort())};
         Process p = execJavaCmd(SysInfoLocaleCmd);
         String s = readProcessOutput(p);
         s = sed(s);
 
         print("testSysinfoLocale", s);
-        assertEquals(OUTPUT, s);
+        assertMatchingStringExists(s);
     }
 
     /**
@@ -259,7 +262,7 @@ public class SysinfoTest extends BaseJDB
          * asserting that output is correct.
          */
         String[] sed = {"Version", "version", "Java", "OS", 
-                "[0-9*].[0-9*].[0-9*]","JRE - JDBC","derby.drda.traceDirectory",
+                "[0-9*]\\.[0-9*]\\.[0-9*]","JRE - JDBC","derby.drda.traceDirectory",
                 "Unable to access Protection Domain","listing properties",
                 "Current Locale",           //Remove these because locale info is
                 "Found support for locale:" //not printed when running from jars..
@@ -311,4 +314,33 @@ public class SysinfoTest extends BaseJDB
         }
         return url.getPath();
     }
+    
+    private void assertMatchingStringExists(String actualOutput) {
+        String delimiter = "\n";
+        String [] actualOutputArray = actualOutput.split(delimiter);
+        int lineCount = actualOutputArray.length;
+        assertEquals(OUTPUT.length, lineCount);
+        for (int i=0 ; i<lineCount ; i++)
+        {
+            String fullExpOutput="";
+            for (int j=0 ; j < OUTPUT.length; j++) {
+                fullExpOutput=fullExpOutput + OUTPUT[j] + "\n";
+            }
+            String ns = actualOutputArray[i];
+            assertTrue("Output string: " + ns + 
+                "\ndoesn't match any of the expected strings: \n" + 
+                fullExpOutput,
+                searchMatchingString(ns));
+        }
+    }
+        
+    private boolean searchMatchingString(String substring){
+        for (int i=0; i<OUTPUT.length;i++)
+        {
+            if (!substring.equals(OUTPUT[i]))
+                continue;
+            else return true;
+        }
+        return false;
+    }
 }

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/_Suite.java Mon May 24 20:33:21 2010
@@ -53,11 +53,13 @@ public class _Suite extends BaseTestCase
         suite.addTest(BadConnectionTest.suite());
         suite.addTest(NetHarnessJavaTest.suite());
         suite.addTest(SecureServerTest.suite());
+        suite.addTest(SysinfoTest.suite());
         suite.addTest(SSLTest.suite());
         suite.addTest(NetIjTest.suite());
         suite.addTest(LOBLocatorReleaseTest.suite());
         suite.addTest(NSinSameJVMTest.suite());
         suite.addTest(GetCurrentPropertiesTest.suite());
+        suite.addTest(ServerPropertiesTest.suite());
 
 
         // Disabled due to "java.sql.SQLSyntaxErrorException: The class

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql Mon May 24 20:33:21 2010
@@ -14,7 +14,7 @@
 --   See the License for the specific language governing permissions and
 --   limitations under the License.
 --
--- assumes the connections connOne, connTwo are set up already
+-- 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
 

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties Mon May 24 20:33:21 2010
@@ -14,10 +14,9 @@
 # limitations under the License.
 
 ij.connection.connOne=jdbc:derby:wombat;create=true
-ij.connection.connTwo=jdbc:derby:lemming;create=true
 
 ij.showNoConnectionsAtStart=false
 ij.showNoCountForSelect=false
 
 #Exclude for J2ME/Foundation - test requires java.sql.Driver
-runwithfoundation=false
\ No newline at end of file
+runwithfoundation=false

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql Mon May 24 20:33:21 2010
@@ -14,11 +14,12 @@
 --   See the License for the specific language governing permissions and
 --   limitations under the License.
 --
--- assumes the connections connOne, connTwo are set up already
+-- assumes the connection connOne is set up already
 -- and that connThree, connFour failed to be setup correctly (bad URLs)
 
 -- expect connOne to be active
 show connections;
+connect 'jdbc:derby:lemming;create=true' as connTwo;
 set connection connOne;
 values 1;
 set connection connTwo;

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties Mon May 24 20:33:21 2010
@@ -14,7 +14,6 @@
 # limitations under the License.
 
 ij.connection.connOne=jdbc:derby:wombat;create=true
-ij.connection.connTwo=jdbc:derby:lemming;create=true
 ij.connection.connThree=jdbc:noone:fruitfly;create=true
 ij.connection.connFour=jdbc:derby:nevercreated
 
@@ -25,4 +24,4 @@ ij.showNoCountForSelect=true
 runwithfoundation=false
 
 # disable security manager for now - need investigating
-noSecurityManager=true
\ No newline at end of file
+noSecurityManager=true

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java Mon May 24 20:33:21 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.derbyTesting.junit;
 
+import junit.framework.Assert;
 import junit.framework.TestCase;
 import junit.framework.AssertionFailedError;
 
@@ -28,12 +29,14 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.PrintStream;
 import java.net.URL;
 import java.sql.SQLException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
 
 import java.security.PrivilegedActionException;
 
@@ -395,6 +398,114 @@ public abstract class BaseTestCase
         });
 	}
     
+	/**
+	 * Execute command using 'java' executable and verify that it completes
+	 * with expected results
+	 * @param expectedString String to compare the resulting output with. May be
+	 *     null if the output is not expected to be of interest.
+	 * @param cmd array of java arguments for command
+	 * @param expectedExitValue expected return value from the command
+	 * @throws InterruptedException
+	 * @throws IOException
+	 */
+	public void assertExecJavaCmdAsExpected(String[] expectedString,
+	        String[] cmd, int expectedExitValue) throws InterruptedException,
+	        IOException {
+
+	    Process pr = execJavaCmd(cmd);
+	    String output = readProcessOutput(pr);
+	    int exitValue = pr.exitValue();
+
+	    Assert.assertEquals(expectedExitValue, exitValue);
+	    if (expectedString != null) {
+	        for (int i = 0; i < expectedString.length; i++) {
+	            assertFalse(output.indexOf(expectedString[i]) < 0);
+	        }
+	    }
+	}
+
+
+	/**
+	 * Execute a java command and return the process.
+	 * The caller should decide what to do with the process, if anything,
+	 * typical activities would be to do a pr.waitFor, or to
+	 * get a getInputStream or getErrorStream
+	 * Note, that for verifying the output of a Java process, there is
+	 * assertExecJavaCmdAsExpected
+	 * 
+	 * @param cmd array of java arguments for command
+	 * @return the process that was started
+	 * @throws IOException
+	 */
+	public Process execJavaCmd(String[] cmd) throws IOException {
+	    int totalSize = 3 + cmd.length;
+	    String[] tcmd = new String[totalSize];
+	    tcmd[0] = "java";
+	    tcmd[1] = "-classpath";
+	    tcmd[2] = BaseTestCase.getSystemProperty("java.class.path");
+
+	    System.arraycopy(cmd, 0, tcmd, 3, cmd.length);
+
+	    final String[] command = tcmd;
+
+	    Process pr = null;
+	    try {
+	        pr = (Process) AccessController
+	        .doPrivileged(new PrivilegedExceptionAction() {
+	            public Object run() throws IOException {
+	                Process result = null;
+	                result = Runtime.getRuntime().exec(command);
+	                return result;
+	            }
+	        });
+	    } catch (PrivilegedActionException pe) {
+	        Exception e = pe.getException();
+	        if (e instanceof IOException)
+	            throw (IOException) e;
+	        else
+	            throw (SecurityException) e;
+	    }
+	    return pr;
+	}
+   
+   /**
+    * Reads output from a process and returns it as a string.
+    * This will block until the process terminates.
+    * 
+    * @param pr a running process
+    * @return output of the process
+    * @throws InterruptedException
+    */
+   public String readProcessOutput(Process pr) throws InterruptedException {
+		InputStream is = pr.getInputStream();
+		if (is == null) {
+			fail("Unexpectedly receiving no text from the process");
+		}
+
+		String output = "";
+		try {
+		    char[] ca = new char[1024];
+		    // Create an InputStreamReader with default encoding; we're hoping
+		    // this to be en. If not, we may not match the expected string.
+		    InputStreamReader inStream;
+		    inStream = new InputStreamReader(is);
+
+		    // keep reading from the stream until all done
+		    int charsRead;
+		    while ((charsRead = inStream.read(ca, 0, ca.length)) != -1)
+		    {
+		        output = output + new String(ca, 0, charsRead);
+		    }
+		} catch (Exception e) {
+		    fail("Exception accessing inputstream from process", e);
+		}
+
+		// wait until the process exits
+		pr.waitFor();
+		
+		return output;
+	}
+    
     /**
      * Remove the directory and its contents.
      * @param path Path of the directory

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java Mon May 24 20:33:21 2010
@@ -63,6 +63,7 @@ final public class NetworkServerTestSetu
     private FileOutputStream serverOutput;
     private final boolean asCommand;
 
+    private final boolean startServerAtSetup;
     private final boolean useSeparateProcess;
     private final boolean serverShouldComeUp;
     private final InputStream[] inputStreamHolder;
@@ -82,8 +83,35 @@ final public class NetworkServerTestSetu
         this.useSeparateProcess = false;
         this.serverShouldComeUp = true;
         this.inputStreamHolder = null;
+        this.startServerAtSetup = true;
 }
 
+    /**
+     * Decorator this test with the NetworkServerTestSetup.
+     * 
+     * Sets up the server using the current configuration, but does not start.
+     * 
+     * @param test the Test for which this setup is used
+     * @param asCommand True to start using NetworkServerControl.main()
+     * within the same virtual machine, false to use NetworkServerControl.start.
+     * @param startServerAtSetup False to start using NetworkServerControl.main()
+     * 
+     * @see NetworkServerControl#main(String[])
+     * @see NetworkServerControl#start(PrintWriter)
+     */
+    public NetworkServerTestSetup(Test test, boolean asCommand, boolean startServerAtSetup) {
+        super(test);
+        this.asCommand = asCommand;
+
+        this.systemProperties = null;
+        this.startupArgs = null;
+        this.useSeparateProcess = false;
+        this.serverShouldComeUp = true;
+        this.inputStreamHolder = null;
+
+        this.startServerAtSetup = startServerAtSetup;
+    }
+    
      /**
      * Decorator for starting up with specific command args.
      */
@@ -106,6 +134,7 @@ final public class NetworkServerTestSetu
         this.useSeparateProcess = true;
         this.serverShouldComeUp = serverShouldComeUp;
         this.inputStreamHolder = inputStreamHolder;
+        this.startServerAtSetup = true;
     }
 
     /**
@@ -116,14 +145,17 @@ final public class NetworkServerTestSetu
         
         networkServerController = getNetworkServerControl();
 
-        if (useSeparateProcess)
-        { serverProcess = startSeparateProcess(); }
-        else if (asCommand)
-        { startWithCommand(); }
-        else
-        { startWithAPI(); }
-        
-        if ( serverShouldComeUp ) { waitForServerStart(networkServerController); }
+        if (startServerAtSetup)
+        {
+            if (useSeparateProcess)
+            { serverProcess = startSeparateProcess(); }
+            else if (asCommand)
+            { startWithCommand(); }
+            else
+            { startWithAPI(); }
+
+            if ( serverShouldComeUp ) { waitForServerStart(networkServerController); }
+        }
     }
 
     private void startWithAPI() throws Exception
@@ -211,8 +243,14 @@ final public class NetworkServerTestSetu
 
         final   String  command = buffer.toString();
 
-        //System.out.println( "XXX server startup command = " + command );
-
+        System.out.println( "XXX server startup command = " + command);
+        /* System.out.println( "XXX server startup command = ");
+        for (int i = 0 ; i < command.length ; i++) {
+            System.out.print( command[i] + " " );
+        }
+        System.out.println();
+        */
+        
         Process     serverProcess = (Process) AccessController.doPrivileged
             (
              new PrivilegedAction()
@@ -346,6 +384,34 @@ final public class NetworkServerTestSetu
     }
     
     /**
+     * Return a new NetworkServerControl for the current configuration.
+     * Use the port number specified.
+     * This method is not for general use - in most cases, the port
+     * should not be specified in the test, instead, the test framework
+     * will decide what is the best port number to use.
+     */
+    public static NetworkServerControl getNetworkServerControl(int port)
+        throws Exception
+    {
+        TestConfiguration config = TestConfiguration.getCurrent();
+            return new NetworkServerControl
+            (InetAddress.getByName(config.getHostName()), 
+             port);
+    }
+    
+    /**
+     * Return a new NetworkServerControl for the current configuration.
+     * Use default values, i.e. port number and host are dependent on 
+     * whatever settings are set in the environment (properties)
+     */
+    public static NetworkServerControl getNetworkServerControlDefault()
+        throws Exception
+    {
+        TestConfiguration config = TestConfiguration.getCurrent();
+            return new NetworkServerControl();
+    }
+    
+    /**
      * Ping the server until it has started. Asserts a failure
      * if the server has not started within sixty seconds.
      */
@@ -367,6 +433,16 @@ final public class NetworkServerTestSetu
     }
     
     /**
+     * Set the number of milliseconds to wait before declaring server startup
+     * a failure back to the default value specified in this class.
+     * 
+     */
+    public static void setDefaultWaitTime()
+    {
+        waitTime = WAIT_TIME;
+    }
+    
+    /**
      * Ping server for upto sixty seconds. If the server responds
      * in that time then return true, otherwise return false.
      * 
@@ -375,16 +451,30 @@ final public class NetworkServerTestSetu
      * (could be <code>null</code>)
      * @return true if server responds in time, false otherwise
      */
-    public static boolean pingForServerStart(
-        NetworkServerControl networkServerController, Process serverProcess)
+    public static boolean pingForServerUp(
+        NetworkServerControl networkServerController, Process serverProcess,
+        boolean expectServerUp)
         throws InterruptedException
     {
+        // If we expect the server to be or come up, then
+        // it makes sense to sleep (if ping unsuccessful), then ping 
+        // and repeat this for the duration of wait-time, but stop
+        // when the ping is successful.
+        // But if we are pinging to see if the server is - or
+        // has come - down, we should do the opposite, stop if ping 
+        // is unsuccessful, and repeat until wait-time if it is
         final long startTime = System.currentTimeMillis();
         while (true) {
-            Thread.sleep(SLEEP_TIME);
             try {
                 networkServerController.ping();
-                return true;
+                if (expectServerUp)
+                    return true;
+                else
+                {
+                    if (System.currentTimeMillis() - startTime > waitTime) {
+                        return true;
+                    }
+                }
             } catch (Throwable e) {
                 if ( !vetPing( e ) )
                 {
@@ -396,9 +486,13 @@ final public class NetworkServerTestSetu
 
                     return false;
                 }
-                if (System.currentTimeMillis() - startTime > waitTime) {
-                    return false;
+                if (expectServerUp){
+                    if (System.currentTimeMillis() - startTime > waitTime) 
+                        return false;
                 }
+                // else, we got what we expected, done.
+                else
+                    return false;
             }
             if (serverProcess != null) {
                 // if the server runs in a separate process, check whether the
@@ -418,6 +512,7 @@ final public class NetworkServerTestSetu
                     return false;
                 }
             }
+            Thread.sleep(SLEEP_TIME);
         }
     }
 
@@ -440,6 +535,6 @@ final public class NetworkServerTestSetu
     public static boolean pingForServerStart(NetworkServerControl control)
         throws InterruptedException
     {
-        return pingForServerStart(control, null);
+        return pingForServerUp(control, null, true);
     }
 }

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/Utilities.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/Utilities.java?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/Utilities.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/junit/Utilities.java Mon May 24 20:33:21 2010
@@ -19,11 +19,22 @@
  */
 package org.apache.derbyTesting.junit;
 
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 
+
 /**
  * General non-JDBC related utilities relocated from TestUtil
  *
@@ -123,7 +134,11 @@ public class Utilities {
                 
                 for (int i = 0; i < nocols; i++)
                 {
-                    System.out.print("\"" + rs.getString(i+1) + "\"");
+                	String val = rs.getString(i+1);
+                	if (val == null)
+                		System.out.print("null");
+                	else
+                		System.out.print("\"" + rs.getString(i+1) + "\"");
                     if (i == (nocols -1))
                         System.out.print("}");
                     else
@@ -135,8 +150,50 @@ public class Utilities {
                 if (next)
                     System.out.println(",");
                 else
-                    System.out.println("};");
+                    System.out.println("};\n");
             }
-        }       
+        }
+        
+    /**
+     * Calls the public method <code>getInfo</code> of the sysinfo tool within
+     * this JVM and returns a <code>BufferedReader</code> for reading its 
+     * output. This is useful for obtaining system information that could be 
+     * used to verify, for example, values returned by Derby MBeans.
+     * 
+     * @return a buffering character-input stream containing the output from
+     *         sysinfo
+     * @see org.apache.derby.tools.sysinfo#getInfo(java.io.PrintWriter out)
+     */
+    public static BufferedReader getSysinfoLocally() {
+        ByteArrayOutputStream byteStream = new ByteArrayOutputStream(20 * 1024);
+        PrintWriter pw = new PrintWriter(byteStream, true); // autoflush
+        org.apache.derby.tools.sysinfo.getInfo(pw);
+        pw.flush();
+        pw.close();
+        byte[] outBytes = byteStream.toByteArray();
+        BufferedReader sysinfoOutput = new BufferedReader(
+                    new InputStreamReader(
+                            new ByteArrayInputStream(outBytes)));
+        return sysinfoOutput;
+    }
+    
+    /**
+     * <p>Calls the public method <code>getSysInfo()</code> of the Network 
+     * Server instance associated with the current test configuration and 
+     * returns the result as a BufferedReader, making it easy to analyse the 
+     * output line by line.</p>
+     * 
+     * <p>This is useful for obtaining system information that could be 
+     * used to verify, for example, values returned by Derby MBeans.</p>
+     * 
+     * @return a buffering character-input stream containing the output from 
+     *         the server's sysinfo.
+     * @see org.apache.derby.drda.NetworkServerControl#getSysinfo()
+     */
+    public static BufferedReader getSysinfoFromServer() throws Exception {
+        
+        return new BufferedReader(new StringReader(
+                NetworkServerTestSetup.getNetworkServerControl().getSysinfo()));
+    }
 
 }

Modified: db/derby/code/branches/10.3/tools/release/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/tools/release/build.xml?rev=947797&r1=947796&r2=947797&view=diff
==============================================================================
--- db/derby/code/branches/10.3/tools/release/build.xml (original)
+++ db/derby/code/branches/10.3/tools/release/build.xml Mon May 24 20:33:21 2010
@@ -427,9 +427,6 @@
     <antcall target="regex.version"> 
       <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/testclientij.out"/>
     </antcall>
-    <antcall target="regex.version"> 
-      <param name="regex.file" value="java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out"/>
-    </antcall>
   </target>
 
   <target name="regex.version">



Mime
View raw message