db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oyste...@apache.org
Subject svn commit: r636837 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/
Date Thu, 13 Mar 2008 19:01:53 GMT
Author: oysteing
Date: Thu Mar 13 12:01:52 2008
New Revision: 636837

URL: http://svn.apache.org/viewvc?rev=636837&view=rev
Log:
DERBY-3162: Fixes several problems wrt. classpath, running on Windows, incorrect master or
slave database path. 
Contributed by Ole Solberg

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/KillMaster.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Distributed.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Full.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_1.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_2.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/KillMaster.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/KillMaster.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/KillMaster.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/KillMaster.java
Thu Mar 13 12:01:52 2008
@@ -21,7 +21,6 @@
 
 package org.apache.derbyTesting.functionTests.tests.replicationTests;
 
-import java.io.File;
 import java.io.IOException;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
@@ -131,7 +130,7 @@
                 masterServerHost,
                 ReplicationRun.ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All.
or use masterServerHost for interfacesToListenOn,
                 masterServerPort,
-                ReplicationRun.masterDatabasePath +File.separator+ ReplicationRun.masterDbSubPath);
// Distinguishing master/slave
+                ReplicationRun.masterDbSubPath); // Distinguishing master/slave
                                                   // Will only work if default/initial values
are used!
                                                   // MUST BE FULL PATH!!!
                 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
Thu Mar 13 12:01:52 2008
@@ -1536,7 +1536,7 @@
         return output;
     }
     private void runUserCommandLocally(String command, String userDir, String ID)
-    {
+    { // Running on localhost.
         util.DEBUG("");
         final String debugId = "runUserCommandLocally " + ID + " ";
         util.DEBUG("+++ runUserCommandLocally " + command + " / " + userDir);
@@ -1549,11 +1549,13 @@
         
         final String fullCmd = command;
         
-        String[] envElements = {""};
+        String[] envElements = null;
+        /*
         tmp ="";
         for ( int i=0;i<envElements.length;i++)
         {tmp = tmp + envElements[i] + " ";}
         util.DEBUG(debugId+"envElements: " + tmp);
+         */
         
         final File workingDir = new File(workingDirName);
         
@@ -1708,7 +1710,7 @@
                 }; */
         final String[] envElements = {"CLASS_PATH="+""
                 , "PATH="+FS+"home"+FS+testUser+FS+"bin:$PATH" // "/../bin"
-        };
+                };
         
         String workingDirName = System.getProperty("user.dir");
         util.DEBUG(ID+"user.dir: " + workingDirName);
@@ -2085,7 +2087,7 @@
             String serverHost,
             String interfacesToListenOn,
             int serverPort,
-            String fullDbDirPath)
+            String dbSubDirPath)
             throws Exception
     {
             stopServer(serverVM, serverVersion,
@@ -2095,16 +2097,17 @@
                     serverHost,
                     interfacesToListenOn, 
                     serverPort,
-                    fullDbDirPath); // Distinguishing master/slave
+                    dbSubDirPath); // Distinguishing master/slave
     }
     NetworkServerControl startServer(String serverVM, String serverVersion,
             String serverHost,
             String interfacesToListenOn,
             int serverPort,
-            String fullDbDirPath)
+            String dbSubDirPath) // fullDbDirPath)
             throws Exception
     {
         util.DEBUG("");
+         
         final String debugId = "startServer@" + serverHost + ":" + serverPort + " ";
         util.DEBUG(debugId+"+++ StartServer " + serverVM + " / " + serverVersion);
         
@@ -2131,11 +2134,15 @@
                 , " -p ", serverPort+""
                 , " " + securityOption
                 };
-        final String[] envElements = {"CLASS_PATH="+serverClassPath
+        String[] envElements = {"CLASS_PATH="+serverClassPath
                 , "PATH="+serverVM+FS+".."+FS+"bin"
                 };
+        if ( serverHost.equals("localhost") )
+        { // Simply inherit environment:
+            envElements = null;
+        }
         
-        String workingDirName = fullDbDirPath;
+        String workingDirName = userDir+FS+dbSubDirPath;// was fullDbDirPath; // "system"
for this server, typically <user.dir>/db_master or ..slave
         util.DEBUG(debugId+"user.dir: " + workingDirName);
         String tmp ="";
         
@@ -2145,8 +2152,11 @@
         
         final String fullCmd = tmp;
         tmp ="";
-        for ( int i=0;i<envElements.length;i++)
-        {tmp = tmp + envElements[i] + " ";}
+        if ( envElements != null )
+        {
+            for ( int i=0;i<envElements.length;i++)
+            {tmp = tmp + envElements[i] + " ";}
+        }
         util.DEBUG(debugId+"envElements: " + tmp);
         
         final File workingDir = new File(workingDirName);
@@ -2158,7 +2168,7 @@
         }
         
         String shellCmd = null;
-        /*
+        /* 
         if ( serverHost.equalsIgnoreCase("localhost") )
         {
             // 1. Can not select jvm or Derby version in this case.
@@ -2200,6 +2210,7 @@
             final String localCommand = shellCmd;
             util.DEBUG(debugId+"localCommand: " + localCommand);
             
+            final String[] fEnvElements = envElements;
             Thread serverThread = new Thread(
                     new Runnable()
             {
@@ -2209,7 +2220,7 @@
                     try
                     {
                         util.DEBUG(debugId+"************** In run().");
-                        proc = Runtime.getRuntime().exec(localCommand,envElements,workingDir);
+                        proc = Runtime.getRuntime().exec(localCommand,fEnvElements,workingDir);
                         util.DEBUG(debugId+"************** Done exec().");
                         processDEBUGOutput(debugId+"pDo ", proc);
                     }
@@ -2223,7 +2234,7 @@
             );
             util.DEBUG(debugId+"************** Do .start().");
             serverThread.start();
-            pingServer(serverHost, serverPort, 5); // Wait for the server to come up in a
reasonable time....
+            pingServer(serverHost, serverPort, 15); // Wait for the server to come up in
a reasonable time....
             
         }
         
@@ -2251,7 +2262,7 @@
                 InetAddress.getByName(interfacesToListenOn), serverPort);
         
         server.start(null); 
-        pingServer(serverHost, serverPort, 5);
+        pingServer(serverHost, serverPort, 15);
         
         Properties sp = server.getCurrentProperties();
         sp.setProperty("noSecurityManager", 
@@ -2325,9 +2336,13 @@
                 , " -p ", serverPort+""
                 // , " " + securityOption
                 };
-        final String[] envElements = {"CLASS_PATH="+serverClassPath
+        String[] envElements = {"CLASS_PATH="+serverClassPath
                 , "PATH="+serverVM+FS+".."+FS+"bin"
                 };
+        if ( serverHost.equals("localhost") )
+        {
+            envElements =null;
+        }
         
         String workingDirName = System.getProperty("user.dir"); // Means we will do the shutdown
wherever we are
         util.DEBUG(debugId+"user.dir: " + workingDirName);
@@ -2339,8 +2354,11 @@
         
         final String fullCmd = tmp;
         tmp ="";
-        for ( int i=0;i<envElements.length;i++)
-        {tmp = tmp + envElements[i] + " ";}
+        if ( envElements != null )
+        {
+            for ( int i=0;i<envElements.length;i++)
+            {tmp = tmp + envElements[i] + " ";}
+        }
         util.DEBUG(debugId+"envElements: " + tmp);
         
         final File workingDir = new File(workingDirName);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Distributed.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Distributed.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Distributed.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Distributed.java
Thu Mar 13 12:01:52 2008
@@ -84,13 +84,13 @@
                 masterServerHost,
                 ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                masterDbSubPath); // Distinguishing master/slave
         
         slaveServer = startServer(slaveJvmVersion, derbySlaveVersion,
                 slaveServerHost,
                 ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                slaveDbSubPath); // Distinguishing master/slave
         
         startServerMonitor(slaveServerHost);
         

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Full.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Full.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Full.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Full.java
Thu Mar 13 12:01:52 2008
@@ -81,7 +81,7 @@
                     masterServerHost,
                     ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                     masterServerPort,
-                    masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                    masterDbSubPath); // Distinguishing master/slave
             runTest(replicationTest,
                     jvmVersion,
                     testClientHost,
@@ -104,7 +104,7 @@
                 masterServerHost,
                 ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                masterDbSubPath); // Distinguishing master/slave
         ///////////////////////////////////////////////////////
         // State: PostStartedMasterServer, PreStartedSlaveServer
         
@@ -120,7 +120,7 @@
                 slaveServerHost,
                 ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                slaveDbSubPath); // Distinguishing master/slave
         ///////////////////////////////////////////////////////
         // State: PostStartedMasterServer, PostStartedSlaveServer
         //        PreStartedMaster,        PreStartedSlave
@@ -286,7 +286,7 @@
                     slaveServerHost,
                     ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                     slaveServerPort,
-                    slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                    slaveDbSubPath); // Distinguishing master/slave
         }
         /* BEGIN Failover do not yet clean replication mode on slave! Must restart the server!*/
         else{
@@ -307,7 +307,7 @@
                     slaveServerHost,
                     ALL_INTERFACES,
                     slaveServerPort,
-                    slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                    slaveDbSubPath); // Distinguishing master/slave
             /* */
           }
         }/* END */
@@ -325,7 +325,7 @@
                     masterServerHost,
                     ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                     masterServerPort,
-                    masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                    masterDbSubPath); // Distinguishing master/slave
         }
         verifyMaster(); // NB NB Hangs here with localhost/ReplicationTestRun!
         

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local.java
Thu Mar 13 12:01:52 2008
@@ -89,13 +89,13 @@
                 masterServerHost,
                 ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                masterDbSubPath); // Distinguishing master/slave
         
         slaveServer = startServer(slaveJvmVersion, derbySlaveVersion,
                 slaveServerHost,
                 ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                slaveDbSubPath); // Distinguishing master/slave
         
         startServerMonitor(slaveServerHost);
         

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1.java
Thu Mar 13 12:01:52 2008
@@ -86,7 +86,7 @@
                 masterServerHost,
                 ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                masterDbSubPath); // Distinguishing master/slave
         
         // State test. 
         _testPreStartedSlaveServer(); 
@@ -95,7 +95,7 @@
                 slaveServerHost,
                 ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                slaveDbSubPath); // Distinguishing master/slave
         
         startServerMonitor(slaveServerHost);
         
@@ -183,7 +183,7 @@
     private void _testPreStartedMasterServer()
     {
         Connection conn = null;
-        String db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        String db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db
@@ -211,7 +211,7 @@
     private void _testPreStartedSlaveServer()
     {
         Connection conn = null;
-        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -243,7 +243,7 @@
         Connection conn = null;
         
         // 1.  stopMaster on master: fail
-        db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db
@@ -268,7 +268,7 @@
         }
         
         // 2. stopSlave on slave: fail
-        db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -294,7 +294,7 @@
     private void _testPreStartedSlave()
     {
         Connection conn = null;
-        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -344,7 +344,7 @@
     throws Exception
     {
         Connection conn = null;
-        String db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        String db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db
@@ -406,7 +406,7 @@
         
         // A 2. StartSlave connect should fail:
         util.DEBUG("startSlave attempt should fail on: " + connectionURL);
-        db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_1.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_1.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_1.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_1.java
Thu Mar 13 12:01:52 2008
@@ -83,13 +83,13 @@
                 masterServerHost,
                 ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                masterDbSubPath); // Distinguishing master/slave
                 
         slaveServer = startServer(slaveJvmVersion, derbySlaveVersion,
                 slaveServerHost,
                 ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                slaveDbSubPath); // Distinguishing master/slave
         
         startServerMonitor(slaveServerHost);
         
@@ -145,7 +145,7 @@
         Connection conn = null;
         
         // 1. stopSlave to slave with connection to master should fail.
-        db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -169,7 +169,7 @@
         // Default replication test sequence still OK.
         
         // 2. stopSlave to a master server should fail:
-        db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db
@@ -200,7 +200,7 @@
         Thread.sleep(5000L); // TEMPORARY to see if slave sees that master is gone!
         
         // 3.  stopSlave on slave should now be allowed. Observe that the database shall
be shutdown.
-        db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -218,11 +218,13 @@
             int ec = se.getErrorCode();
             String ss = se.getSQLState();
             String msg = ec + " " + ss + " " + se.getMessage();
-            assertTrue("connectionURL +  failed: " + msg, 
+            util.DEBUG("3. Got "+msg + " Expected: " + SQLState.REPLICATION_SLAVE_SHUTDOWN_OK);
+            assertTrue(connectionURL + " failed: " + msg, 
                     SQLState.REPLICATION_SLAVE_SHUTDOWN_OK.equals(ss));
             util.DEBUG("3. Failed as expected: " + connectionURL +  " " + msg);
             stopSlaveCorrect = true;
         }
+        
         // Default replication test sequence will NOT be OK after this point.
         
         if ( stopSlaveCorrect )

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_2.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_2.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_2.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_2.java
Thu Mar 13 12:01:52 2008
@@ -83,14 +83,14 @@
                 masterServerHost,
                 ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                masterDbSubPath); // Distinguishing master/slave
         
         
         slaveServer = startServer(slaveJvmVersion, derbySlaveVersion,
                 slaveServerHost,
                 ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                slaveDbSubPath); // Distinguishing master/slave
         
         startServerMonitor(slaveServerHost);
         
@@ -146,8 +146,8 @@
         String connectionURL = null;
         
         // 1. Attempt to perform stopMaster on slave. Should fail.
-        db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath 
-                +"/"+ replicatedDb;
+        db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath 
+                +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -174,8 +174,8 @@
         // Default replication test sequence still OK.
         
         // 2. stopMaster on master: OK
-        db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath 
-                +"/"+ replicatedDb;
+        db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath 
+                +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db
@@ -198,7 +198,7 @@
         // Not meaningful to continue default replication test sequence after this point!
         
         // 3. Connect to slave which now is not in non-replication mode is OK.
-        db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db;
@@ -222,7 +222,7 @@
         }
         
         // 4. stopMaster on slave which now is not in replication mode should fail.
-        db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -247,7 +247,7 @@
         }
         
         // 5. Connect master which now is now in non-replication mode should succeed.
-        db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db;
@@ -269,8 +269,8 @@
         }
 
         // 6. Attempt to do stopmaster on master which now is now in non-replication mode
should fail.
-        db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath 
-                +"/"+ replicatedDb;
+        db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath 
+                +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java
Thu Mar 13 12:01:52 2008
@@ -82,13 +82,13 @@
                 masterServerHost,
                 ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath); // Distinguishing master/slave
+                masterDbSubPath); // Distinguishing master/slave
         
         slaveServer = startServer(slaveJvmVersion, derbySlaveVersion,
                 slaveServerHost,
                 ALL_INTERFACES, // slaveServerHost, // "0.0.0.0", // All. or use slaveServerHost
for interfacesToListenOn,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath); // Distinguishing master/slave
+                slaveDbSubPath); // Distinguishing master/slave
         
         startServerMonitor(slaveServerHost);
         
@@ -132,7 +132,7 @@
     private void _testPostStartedMasterAndSlave_Failover()
     {
         Connection conn = null;
-        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -154,7 +154,7 @@
         // Default replication test sequence still OK.
         
         // Failover on master should succeed:
-        db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        db = masterDatabasePath +FS+ReplicationRun.masterDbSubPath +FS+ replicatedDb;
         connectionURL = "jdbc:derby:"  
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java?rev=636837&r1=636836&r2=636837&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java
Thu Mar 13 12:01:52 2008
@@ -82,13 +82,13 @@
                 masterServerHost,
                 ALL_INTERFACES,
                 masterServerPort,
-                masterDatabasePath +FS+ masterDbSubPath);
+                masterDbSubPath);
         
         slaveServer = startServer(slaveJvmVersion, derbySlaveVersion,
                 slaveServerHost,
                 ALL_INTERFACES,
                 slaveServerPort,
-                slaveDatabasePath +FS+ slaveDbSubPath);
+                slaveDbSubPath);
         
         startServerMonitor(slaveServerHost);
         
@@ -310,7 +310,7 @@
             String slaveDatabasePath, String replicatedDb,
             int slaveReplPort)
     {
-        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -334,7 +334,7 @@
             String slaveDatabasePath, String replicatedDb, 
             int slaveReplPort)
     {
-        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String db = slaveDatabasePath +FS+ReplicationRun.slaveDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + slaveServerHost + ":" + slaveServerPort + "/"
                 + db
@@ -357,7 +357,7 @@
     SQLException failOver(String serverHost, int serverPort, 
             String databasePath, String dbSubPath, String replicatedDb)
     {
-        String db = databasePath +"/"+dbSubPath +"/"+ replicatedDb;
+        String db = databasePath +FS+dbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + serverHost + ":" + serverPort + "/"
                 + db
@@ -380,7 +380,7 @@
             String slaveServerHost,
             int slaveReplPort)
     {
-        String db = databasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        String db = databasePath +FS+ReplicationRun.masterDbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + masterServerHost + ":" + masterServerPort + "/"
                 + db
@@ -404,7 +404,7 @@
             String databasePath, String dbSubPath, String replicatedDb)
         throws SQLException
     {
-        String db = databasePath +"/"+dbSubPath +"/"+ replicatedDb;
+        String db = databasePath +FS+dbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + serverHost + ":" + serverPort + "/"
                 + db;
@@ -415,7 +415,7 @@
     SQLException connectTo(String serverHost, int serverPort,
             String databasePath, String dbSubPath, String replicatedDb)
     {
-        String db = databasePath +"/"+dbSubPath +"/"+ replicatedDb;
+        String db = databasePath +FS+dbSubPath +FS+ replicatedDb;
         String connectionURL = "jdbc:derby:"  
                 + "//" + serverHost + ":" + serverPort + "/"
                 + db;



Mime
View raw message