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 rh...@apache.org on 2007/03/19 14:50:36 UTC
svn commit: r519945 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting:
functionTests/tests/derbynet/SecureServerTest.java
junit/TestConfiguration.java
Author: rhillegas
Date: Mon Mar 19 06:50:35 2007
New Revision: 519945
URL: http://svn.apache.org/viewvc?view=rev&rev=519945
Log:
DERBY-2419: Refactor some code in TestConfiguration so that SecureServerTest does not need to access TestConfiguration constants which ought to be private.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java?view=diff&rev=519945&r1=519944&r2=519945
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.java Mon Mar 19 06:50:35 2007
@@ -237,9 +237,9 @@
);
}
- testSetup = new ServerSetup( testSetup, TestConfiguration.DEFAULT_HOSTNAME, TestConfiguration.DEFAULT_PORT );
+ Test test = TestConfiguration.defaultServerDecorator( testSetup );
- Test test = SecurityManagerSetup.noSecurityManager( testSetup );
+ test = SecurityManagerSetup.noSecurityManager( test );
return test;
}
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?view=diff&rev=519945&r1=519944&r2=519945
==============================================================================
--- 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 Mon Mar 19 06:50:35 2007
@@ -255,6 +255,7 @@
suiteName(testClass)+":client");
return clientServerDecorator(suite);
}
+
/**
* Return a decorator for the passed in tests that sets the
* configuration for the client to be Derby's JDBC client
@@ -269,14 +270,27 @@
*/
public static Test clientServerDecorator(Test suite)
{
+ Test test = new NetworkServerTestSetup(suite, false);
+
+ return defaultServerDecorator(test);
+ }
+
+ /**
+ * Decorate a test to use suite's default host and port.
+ */
+ public static Test defaultServerDecorator(Test test)
+ {
// Need to have network server and client and not
// running in J2ME (JSR169).
if (!(Derby.hasClient() && Derby.hasServer())
|| JDBC.vmSupportsJSR169())
return new TestSuite("empty: no network server support");
-
- Test test = new NetworkServerTestSetup(suite, false);
-
+
+ //
+ // This looks bogus to me. Shouldn't this get the hostname and port
+ // which are specific to this test run (perhaps overridden on the
+ // command line)?
+ //
return new ServerSetup(test, DEFAULT_HOSTNAME, DEFAULT_PORT);
}