db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r602213 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
Date Fri, 07 Dec 2007 20:48:42 GMT
Author: djd
Date: Fri Dec  7 12:48:41 2007
New Revision: 602213

URL: http://svn.apache.org/viewvc?rev=602213&view=rev
Log:
TestConfiguration.start/stopNetworkServer indicated they use the server defined by the current
configuration, but they didn't. Changed the code to use the utility method provided by NetworkServerTestSetup
to obtain a NetworkServerControl configured to the current configuration.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java?rev=602213&r1=602212&r2=602213&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
Fri Dec  7 12:48:41 2007
@@ -79,10 +79,6 @@
 		
     /** Sleep for 500 ms before pinging the network server (again) */
     private static final int SLEEP_TIME = 1000;
-
-    /* Network Server Control */
-    private NetworkServerControl networkServerController;
-    private NetworkServerControl networkServer;
             
     /**
      * Keys to use to look up values in properties files.
@@ -182,6 +178,11 @@
     /**
      * Get this Thread's current configuraiton for running
      * the tests.
+     * Note this call must only be used while a test is
+     * running, they make no sense when setting up a suite.
+     * A suite itself sets up which test configurations
+     * the fixtures will run in.
+
      * @return TestConfiguration to use.
      */
     public static TestConfiguration getCurrent() {
@@ -1222,7 +1223,9 @@
      */
     public void stopNetworkServer() {
         try {
-            NetworkServerControl networkServer = new NetworkServerControl();
+            NetworkServerControl networkServer =
+                NetworkServerTestSetup.getNetworkServerControl();
+
             networkServer.shutdown();
             if (serverOutput != null) {
                 serverOutput.close();
@@ -1241,10 +1244,11 @@
     {
         Exception failException = null;
         try {
-
-	    NetworkServerControl networkServer =
-                     new NetworkServerControl(InetAddress.getByName("localhost"), port);
-	    serverOutput = (FileOutputStream)
+            
+            NetworkServerControl networkServer =
+                NetworkServerTestSetup.getNetworkServerControl();
+	    
+ 	    serverOutput = (FileOutputStream)
             AccessController.doPrivileged(new PrivilegedAction() {
                 public Object run() {
                     File logs = new File("logs");



Mime
View raw message