db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1308434 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests: derbynet/ engine/ replicationTests/
Date Mon, 02 Apr 2012 17:22:47 GMT
Author: kahatlen
Date: Mon Apr  2 17:22:47 2012
New Revision: 1308434

URL: http://svn.apache.org/viewvc?rev=1308434&view=rev
Log:
DERBY-5677: ClassNotFoundException when running suites.All without derbynet.jar

Exclude tests that cannot run without derbynet.jar if the network server
classes are not available on the classpath.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServerTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServerTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServerTest.java?rev=1308434&r1=1308433&r2=1308434&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServerTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServerTest.java
Mon Apr  2 17:22:47 2012
@@ -31,6 +31,7 @@ import junit.framework.TestSuite;
 
 import org.apache.derby.drda.NetworkServerControl;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.Derby;
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.NetworkServerTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
@@ -52,7 +53,7 @@ public class DerbyNetNewServerTest exten
 
     public static Test suite() {
         // Test does not run on J2ME
-        if (JDBC.vmSupportsJDBC3()) {
+        if (JDBC.vmSupportsJDBC3() && Derby.hasServer()) {
             return new TestSuite(DerbyNetNewServerTest.class);
         } else {
             return new TestSuite("DerbyNetNewServerTest.empty");

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java?rev=1308434&r1=1308433&r2=1308434&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSSecurityMechanismTest.java
Mon Apr  2 17:22:47 2012
@@ -353,17 +353,9 @@ public class NSSecurityMechanismTest ext
     private boolean setSecurityMechanism(String derby_security_mechanism) 
     throws Exception {
         try {
-            // getting a networkservercontrol to shutdown the currently running
+            // shut down the currently running
             // server, before setting the next security mechanism
-            final TestConfiguration config = TestConfiguration.getCurrent();
-            NetworkServerControl server = new NetworkServerControl(
-                InetAddress.getByName(config.getHostName()),
-                config.getPort(),
-                config.getUserName(),
-                config.getUserPassword());
-
-            // shut down the server
-            server.shutdown();
+            NetworkServerTestSetup.getNetworkServerControl().shutdown();
         } catch (Exception e) {
             if (!(e.getMessage().substring(0,17).equals("DRDA_InvalidValue")))
             {
@@ -381,16 +373,12 @@ public class NSSecurityMechanismTest ext
             
             // if the security mechanism isn't supported or invalid, getting a
             // networkservercontrol will fail.
-            NetworkServerControl server2 = new NetworkServerControl(
-                InetAddress.getByName(
-                    TestConfiguration.getCurrent().getHostName()),
-                    TestConfiguration.getCurrent().getPort());
-
-            // For debugging, to make output come to console uncomment:
-            //server2.start(new PrintWriter(System.out, true));
-            // and comment out:
-            server2.start(null);
-            NetworkServerTestSetup.waitForServerStart(server2);
+
+            // For debugging, to make output come to console call start() with
+            // new PrintWriter(System.out, true) instead of null.
+            NetworkServerTestSetup.getNetworkServerControl().start(null);
+            NetworkServerTestSetup.waitForServerStart(
+                    NetworkServerTestSetup.getNetworkServerControl());
             
             if (derby_drda_securityMechanism.equals("") ||
                 derby_drda_securityMechanism.equals("INVALID_VALUE"))

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java?rev=1308434&r1=1308433&r2=1308434&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
Mon Apr  2 17:22:47 2012
@@ -53,6 +53,7 @@ import org.apache.derbyTesting.junit.JDB
 import org.apache.derbyTesting.junit.NetworkServerTestSetup;
 import org.apache.derbyTesting.junit.SupportFilesSetup;
 import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests;
+import org.apache.derbyTesting.junit.*;
 
 /**
  * Tests related to use of restrictive file permissions (DERBY-5363).
@@ -132,14 +133,15 @@ public class RestrictiveFilePermissionsT
 
         // For server started from command line, we should still get secure
         // permissions.
-
-        totalSuite.addTest(
-            new NetworkServerTestSetup(
-                new RestrictiveFilePermissionsTest(
-                    "doTestCliServerIsRestrictive"),
-                new String[]{}, // system properties
-                new String[]{}, // non-default start up arguments
-                true));
+        if (Derby.hasServer()) {
+            totalSuite.addTest(
+                new NetworkServerTestSetup(
+                    new RestrictiveFilePermissionsTest(
+                        "doTestCliServerIsRestrictive"),
+                    new String[]{}, // system properties
+                    new String[]{}, // non-default start up arguments
+                    true));
+        }
 
         // For server started from API, we should see lax permissions.
         //

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java?rev=1308434&r1=1308433&r2=1308434&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java
Mon Apr  2 17:22:47 2012
@@ -27,6 +27,7 @@ import org.apache.derbyTesting.junit.Bas
 
 import junit.framework.Test; 
 import junit.framework.TestSuite;
+import org.apache.derbyTesting.junit.Derby;
 import org.apache.derbyTesting.junit.JDBC;
 
 /**
@@ -49,8 +50,9 @@ public class ReplicationSuite extends Ba
 
         // The tests require both DriverManager and ClientDataSource. None
         // of those classes are available in JSR-169, so only run the test
-        // on platforms that support JDBC3 and higher.
-        if (JDBC.vmSupportsJDBC3()) {
+        // on platforms that support JDBC3 and higher. The tests also require
+        // a network server.
+        if (JDBC.vmSupportsJDBC3() && Derby.hasServer()) {
 
             suite.addTest(ReplicationRun_Local.suite());
             suite.addTest(ReplicationRun_Local.localAuthenticationSuite());



Mime
View raw message