db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oyste...@apache.org
Subject svn commit: r634734 [2/2] - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: suites/ tests/replicationTests/
Date Fri, 07 Mar 2008 16:34:20 GMT
Added: 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=634734&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java
Fri Mar  7 08:34:18 2008
@@ -0,0 +1,183 @@
+/*
+ 
+Derby - Class org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun
+ 
+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.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+ 
+   http://www.apache.org/licenses/LICENSE-2.0
+ 
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+ 
+ */
+package org.apache.derbyTesting.functionTests.tests.replicationTests;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.derbyTesting.junit.SecurityManagerSetup;
+
+
+/**
+ * Run a replication test on localhost
+ * by using default values for master and slave hosts,
+ * and master and slave ports.
+ * 
+ */
+
+public class ReplicationRun_Local_StateTest_part1_3 extends ReplicationRun
+{
+    
+    /**
+     * Creates a new instance of ReplicationRun_Local_StateTest_part1
+     * 
+     * @param testcaseName Identifying the test.
+     */
+    public ReplicationRun_Local_StateTest_part1_3(String testcaseName)
+    {
+        super(testcaseName);
+    }
+        
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite("ReplicationRun_Local_StateTest_part1_3 Suite");
+        
+        suite.addTestSuite( ReplicationRun_Local_StateTest_part1_3.class );
+        
+        return SecurityManagerSetup.noSecurityManager(suite);
+    }
+    
+    //////////////////////////////////////////////////////////////
+    ////
+    //// The replication test framework (testReplication()):
+    //// a) "clean" replication run starting master and slave servers,
+    ////     preparing master and slave databases,
+    ////     starting and stopping replication and doing
+    ////     failover for a "normal"/"failure free" replication
+    ////     test run.
+    ////
+    //////////////////////////////////////////////////////////////
+    
+    public void testReplication_Local_StateTest_part1_3()
+    throws Exception
+    {
+        cleanAllTestHosts();
+        
+        initEnvironment();
+        
+        initMaster(masterServerHost,
+                replicatedDb);
+        
+        masterServer = startServer(masterJvmVersion, derbyMasterVersion,
+                masterServerHost,
+                ALL_INTERFACES, // masterServerHost, // "0.0.0.0", // All. or use masterServerHost
for interfacesToListenOn,
+                masterServerPort,
+                masterDatabasePath +FS+ 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
+        
+        startServerMonitor(slaveServerHost);
+        
+        bootMasterDatabase(jvmVersion,
+                masterDatabasePath +FS+ masterDbSubPath,
+                replicatedDb,
+                masterServerHost, // Where the startreplication command must be given
+                masterServerPort, // master server interface accepting client requests
+                null // bootLoad, // The "test" to start when booting db.
+                );
+        
+        initSlave(slaveServerHost,
+                jvmVersion,
+                replicatedDb); // Trunk and Prototype V2: copy master db to db_slave.
+        
+        startSlave(jvmVersion, replicatedDb,
+                slaveServerHost, // slaveClientInterface // where the slave db runs
+                slaveServerPort,
+                slaveServerHost, // for slaveReplInterface
+                slaveReplPort,
+                testClientHost);
+        
+        startMaster(jvmVersion, replicatedDb,
+                masterServerHost, // Where the startMaster command must be given
+                masterServerPort, // master server interface accepting client requests
+                masterServerHost, // An interface on the master: masterClientInterface (==masterServerHost),
+                slaveServerPort, // Not used since slave don't allow clients.
+                slaveServerHost, // for slaveReplInterface
+                slaveReplPort);
+        
+        _testPostStartedMasterAndSlave_Failover(); // Not in a state to continue!
+        
+        stopServer(jvmVersion, derbyVersion,
+                slaveServerHost, slaveServerPort);
+        
+        stopServer(jvmVersion, derbyVersion,
+                masterServerHost, masterServerPort);
+        
+    }
+
+    private void _testPostStartedMasterAndSlave_Failover()
+    {
+        Connection conn = null;
+        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String connectionURL = "jdbc:derby:"  
+                + "//" + slaveServerHost + ":" + slaveServerPort + "/"
+                + db
+                + ";failover=true";
+        util.DEBUG("1. testPostStartedMasterAndSlave_Failover: " + connectionURL);
+        try
+        {
+            conn = DriverManager.getConnection(connectionURL);
+            util.DEBUG("Successfully connected as: " + connectionURL);
+            assertTrue("Successfully connected as: " + connectionURL, false);
+        }
+        catch (SQLException se)
+        {
+            int ec = se.getErrorCode();
+            String ss = se.getSQLState();
+            String msg = "As expected: Failover on slave should fail: " + ec + " " + ss +
" " + se.getMessage();
+            util.DEBUG(msg);
+        }
+        // Default replication test sequence still OK.
+        
+        // Failover on master should succeed:
+        db = masterDatabasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        connectionURL = "jdbc:derby:"  
+                + "//" + masterServerHost + ":" + masterServerPort + "/"
+                + db
+                + ";failover=true";
+        util.DEBUG("2. testPostStartedMasterAndSlave_Failover: " + connectionURL);
+        try
+        {
+            conn = DriverManager.getConnection(connectionURL);
+            util.DEBUG("Unexpectedly connected as: " + connectionURL);
+            assertTrue("Unexpectedly connected as: " + connectionURL, false);
+        }
+        catch (SQLException se)
+        {
+            int ec = se.getErrorCode();
+            String ss = se.getSQLState();
+            String msg = ec + " " + ss + " " + se.getMessage();
+            // Failover OK: SQLCODE: -1, SQLSTATE: XRE20
+            assertTrue("connectionURL " + " failed: " + msg, 
+                    // SQLState.REPLICATION_FAILOVER_SUCCESSFUL.equals(ss)); // "XRE20.D"
+                    "XRE20".equals(ss));
+            util.DEBUG("Failover on master succeeded: " + connectionURL + " " + msg);
+        }
+        // Not meaningful to continue default replication test sequence after this point!
+    }
+    
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part1_3.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=634734&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java
Fri Mar  7 08:34:18 2008
@@ -0,0 +1,449 @@
+/*
+ 
+Derby - Class org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun
+ 
+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.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+ 
+   http://www.apache.org/licenses/LICENSE-2.0
+ 
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+ 
+ */
+package org.apache.derbyTesting.functionTests.tests.replicationTests;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.derbyTesting.junit.SecurityManagerSetup;
+
+
+/**
+ * Run a replication test on localhost
+ * by using default values for master and slave hosts,
+ * and master and slave ports.
+ * 
+ */
+
+public class ReplicationRun_Local_StateTest_part2 extends ReplicationRun
+{
+    
+    /**
+     * Creates a new instance of ReplicationRun_Local
+     * @param testcaseName Identifying the test.
+     */
+    public ReplicationRun_Local_StateTest_part2(String testcaseName)
+    {
+        super(testcaseName);
+    }
+    
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+    
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+    }
+    
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite("ReplicationRun_Local_StateTest_part2 Suite");
+        
+        suite.addTestSuite( ReplicationRun_Local_StateTest_part2.class );
+        
+        return SecurityManagerSetup.noSecurityManager(suite);
+    }
+        
+    public void testReplication_Local_StateTest_part2()
+    throws Exception
+    {
+        cleanAllTestHosts();
+        
+        initEnvironment();
+        
+        initMaster(masterServerHost,
+                replicatedDb);
+        
+        masterServer = startServer(masterJvmVersion, derbyMasterVersion,
+                masterServerHost,
+                ALL_INTERFACES,
+                masterServerPort,
+                masterDatabasePath +FS+ masterDbSubPath);
+        
+        slaveServer = startServer(slaveJvmVersion, derbySlaveVersion,
+                slaveServerHost,
+                ALL_INTERFACES,
+                slaveServerPort,
+                slaveDatabasePath +FS+ slaveDbSubPath);
+        
+        startServerMonitor(slaveServerHost);
+        
+        bootMasterDatabase(jvmVersion,
+                masterDatabasePath +FS+ masterDbSubPath,
+                replicatedDb,
+                masterServerHost,
+                masterServerPort,
+                null // bootLoad, // The "test" to start when booting db.
+                );
+        
+        initSlave(slaveServerHost,
+                jvmVersion,
+                replicatedDb);
+        
+        startSlave(jvmVersion, replicatedDb,
+                slaveServerHost,
+                slaveServerPort,
+                slaveServerHost,
+                slaveReplPort,
+                testClientHost);
+        
+        startMaster(jvmVersion, replicatedDb,
+                masterServerHost,
+                masterServerPort,
+                masterServerHost,
+                slaveServerPort,
+                slaveServerHost,
+                slaveReplPort);
+        
+        
+        // Run a "load" on the master to make sure there
+        // has been replication to slave.
+        replicationTest = "org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationTestRun";
+        util.DEBUG("replicationTest: " + replicationTest);
+        replicationVerify = "org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationTestRun_Verify";
+        util.DEBUG("replicationVerify: " + replicationVerify);
+        
+        runTest(replicationTest, // Returns immediatly if replicationTest is null.
+                jvmVersion,
+                testClientHost,
+                masterServerHost, masterServerPort,
+                replicatedDb);
+        
+        // Check that this is gone after failover!
+        Connection mConn = getConnection(masterServerHost, masterServerPort, 
+                    masterDatabasePath, masterDbSubPath, replicatedDb);
+        
+        failOver(jvmVersion,
+                masterDatabasePath, masterDbSubPath, replicatedDb,
+                masterServerHost,  // Where the master db is run.
+                masterServerPort,
+                testClientHost);
+        
+        connectPing(slaveDatabasePath+FS+slaveDbSubPath+FS+replicatedDb,
+                slaveServerHost,slaveServerPort,
+                testClientHost);
+        
+        verifySlave();
+        
+        // We should verify the master as well, at least to see that we still can connect.
+        verifyMaster();
+        
+        _testPreStoppedSlave(mConn);
+        
+        shutdownDb(jvmVersion,
+            slaveServerHost, slaveServerPort,
+            slaveDatabasePath+FS+slaveDbSubPath, replicatedDb,
+            testClientHost);
+        
+        _testPostStoppedSlave();
+        // _testPreStoppedSlaveServer();
+        
+        stopServer(jvmVersion, derbyVersion,
+                slaveServerHost, slaveServerPort);
+        
+        _testPostStoppedSlaveServer();
+        // _testPreStoppedMaster();
+        
+        // NOTE:
+        // If stopMaster is "connect 'jdbc:...:dbname;shutdown=true';", 
+        // this method call will fail because failover has already shutdown 
+        // the master database
+        
+        shutdownDb(jvmVersion,
+            masterServerHost, masterServerPort,
+            masterDatabasePath+FS+masterDbSubPath, replicatedDb,
+            testClientHost);
+        
+        _testPostStoppedMaster();
+        // _testPreStoppedMasterServer();
+        
+        stopServer(jvmVersion, derbyVersion,
+                masterServerHost, masterServerPort);
+        
+        _testPostStoppedServer();
+        
+    }
+
+    private void _testPreStoppedSlave(Connection mConn)
+        throws SQLException
+    {
+        util.DEBUG("_testPreStoppedSlave");
+        /*  
+         * Future test case; should probably be done in a separate test 
+         * - let Derby instances change roles:
+         *   - (M) copy db from slave location to master location
+         *   - (M) start old master in slave mode
+         *   - (S) start old slave in master mode
+         *
+         */
+        
+        // Tests against slave:
+        assertException(
+                startSlave(slaveServerHost,slaveServerPort,
+                    slaveDatabasePath, replicatedDb,
+                    slaveReplPort),
+                "XRE09");
+
+        assertException(
+                stopSlave(slaveServerHost,slaveServerPort,
+                    slaveDatabasePath, replicatedDb,
+                    slaveReplPort),
+                "XRE40");
+        
+        assertException(
+                failOver(slaveServerHost,slaveServerPort,
+                    slaveDatabasePath, slaveDbSubPath, replicatedDb),
+                "XRE07");
+        
+        // Tests against master:
+        assertException(
+                startMaster(masterServerHost,masterServerPort,
+                    masterDatabasePath, replicatedDb,
+                    slaveServerHost,slaveReplPort),
+                "XRE04");
+        
+        assertException(
+                failOver(masterServerHost,masterServerPort,
+                    masterDatabasePath, masterDbSubPath, replicatedDb),
+                "XRE07");
+        
+        // connect / show tables
+        assertException(
+                executeQuery(mConn, "select count(*) from SYS.SYSTABLES"), 
+                "08006"); // Thats's just how it is...
+         assertException(
+                executeQuery(mConn, "select count(*) from SYS.SYSTABLES"), 
+                "08003"); // Thats's just how it is...
+        
+        // Tests against slave:
+        Connection sConn = getConnection(slaveServerHost, slaveServerPort, 
+                    slaveDatabasePath, slaveDbSubPath, replicatedDb); // OK
+         assertException(
+                executeQuery(sConn, "select count(*) from SYS.SYSTABLES"), 
+                null); // null: Should be OK
+         sConn.close();
+    }
+
+    private void _testPostStoppedSlave()
+    {
+        util.DEBUG("_testPostStoppedSlave");
+        /* No value-adding suggestions here exept that calling startSlave 
+         * should hang now. 
+         */
+        util.DEBUG("_testPostStoppedSlaveServer Not yet implemented");
+    }
+
+    private void _testPostStoppedSlaveServer()
+    {
+        /* No value-adding suggestions here */
+        util.DEBUG("_testPostStoppedSlave Not yet implemented");
+    }
+
+    private void _testPostStoppedMaster()
+    {
+        /* No value-adding suggestions here since the stopMaster method will 
+         * not do anything when called after failover
+         */
+        util.DEBUG("_testPostStoppedMaster Not yet implemented");
+    }
+
+    private void _testPostStoppedServer()
+    {
+        /* No value-adding suggestions here */
+        util.DEBUG("_testPostStoppedServer Not yet implemented");
+    }
+    
+    //////////////////////////////////////////////////////////////////
+    // FIXME! The following should be moved to ReplicationRun!
+    //        Use the pattern 'assertException(replCmd()),expectedException);'
+    //        also in the other replication tests!
+    void assertException(SQLException se, String expectedSqlState)
+    {
+        if (se == null ) // Did not get an exception
+        {
+            util.DEBUG("Got 'null' exception, expected '" + expectedSqlState + "'");
+            assertTrue("Expected exception " + expectedSqlState, 
+                    expectedSqlState == null);
+            return;
+        }
+        int ec = se.getErrorCode();
+        String ss = se.getSQLState();
+        String msg = "Got " + ec + " " + ss + " " + se.getMessage()
+        + ". Expected " + expectedSqlState;
+        util.DEBUG(msg);
+        
+        if ( expectedSqlState != null ) // We expect an exception
+        {
+            assertTrue(msg, ss.equals(expectedSqlState));
+        }
+        else // We do not expect an exception, but got one.
+        {
+            assertTrue(msg, false);
+        }
+    }
+    
+    SQLException startSlave(String slaveServerHost, int slaveServerPort,
+            String slaveDatabasePath, String replicatedDb,
+            int slaveReplPort)
+    {
+        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String connectionURL = "jdbc:derby:"  
+                + "//" + slaveServerHost + ":" + slaveServerPort + "/"
+                + db
+                + ";startSlave=true"
+                + ";slaveHost=" + slaveServerHost 
+                + ";slavePort=" + slaveReplPort;
+        util.DEBUG(connectionURL);
+        try
+        {
+            Connection conn = DriverManager.getConnection(connectionURL);
+            util.DEBUG("startSlave Unexpectedly connected as: " + connectionURL);
+            return new SQLException("startSlave Unexpectedly connected");
+        }
+        catch (SQLException se)
+        {
+            return se;
+        }
+    }
+
+    SQLException stopSlave(String slaveServerHost, int slaveServerPort, 
+            String slaveDatabasePath, String replicatedDb, 
+            int slaveReplPort)
+    {
+        String db = slaveDatabasePath +"/"+ReplicationRun.slaveDbSubPath +"/"+ replicatedDb;
+        String connectionURL = "jdbc:derby:"  
+                + "//" + slaveServerHost + ":" + slaveServerPort + "/"
+                + db
+                + ";stopSlave=true"
+                + ";slaveHost=" + slaveServerHost 
+                + ";slavePort=" + slaveReplPort;
+        util.DEBUG(connectionURL);
+        try
+        {
+            Connection conn = DriverManager.getConnection(connectionURL);
+            util.DEBUG("stopSlave Unexpectedly connected as: " + connectionURL);
+            return new SQLException("stopSlave Unexpectedly connected");
+        }
+        catch (SQLException se)
+        {
+            return se;
+        }
+    }
+
+    SQLException failOver(String serverHost, int serverPort, 
+            String databasePath, String dbSubPath, String replicatedDb)
+    {
+        String db = databasePath +"/"+dbSubPath +"/"+ replicatedDb;
+        String connectionURL = "jdbc:derby:"  
+                + "//" + serverHost + ":" + serverPort + "/"
+                + db
+                + ";failover=true";
+        util.DEBUG(connectionURL);
+        try
+        {
+            Connection conn = DriverManager.getConnection(connectionURL);
+            util.DEBUG("failOver Unexpectedly connected as: " + connectionURL);
+            return new SQLException("failOver Unexpectedly connected");
+        }
+        catch (SQLException se)
+        {
+            return se;
+        }
+    }
+    
+    SQLException startMaster(String masterServerHost, int masterServerPort,
+            String databasePath, String replicatedDb,
+            String slaveServerHost,
+            int slaveReplPort)
+    {
+        String db = databasePath +"/"+ReplicationRun.masterDbSubPath +"/"+ replicatedDb;
+        String connectionURL = "jdbc:derby:"  
+                + "//" + masterServerHost + ":" + masterServerPort + "/"
+                + db
+                + ";startMaster=true"
+                + ";slaveHost=" + slaveServerHost 
+                + ";slavePort=" + slaveReplPort;
+        util.DEBUG(connectionURL);
+        try
+        {
+            Connection conn = DriverManager.getConnection(connectionURL);
+            util.DEBUG("startMaster Unexpectedly connected as: " + connectionURL);
+            return new SQLException("startMaster Unexpectedly connected");
+        }
+        catch (SQLException se)
+        {
+            return se;
+        }
+    }
+
+    Connection getConnection(String serverHost, int serverPort,
+            String databasePath, String dbSubPath, String replicatedDb)
+        throws SQLException
+    {
+        String db = databasePath +"/"+dbSubPath +"/"+ replicatedDb;
+        String connectionURL = "jdbc:derby:"  
+                + "//" + serverHost + ":" + serverPort + "/"
+                + db;
+        util.DEBUG(connectionURL);
+        return DriverManager.getConnection(connectionURL);
+    }
+    
+    SQLException connectTo(String serverHost, int serverPort,
+            String databasePath, String dbSubPath, String replicatedDb)
+    {
+        String db = databasePath +"/"+dbSubPath +"/"+ replicatedDb;
+        String connectionURL = "jdbc:derby:"  
+                + "//" + serverHost + ":" + serverPort + "/"
+                + db;
+        util.DEBUG(connectionURL);
+        try
+        {
+            Connection conn = DriverManager.getConnection(connectionURL);
+            util.DEBUG("connectTo Unexpectedly connected as: " + connectionURL);
+            return new SQLException("connectTo Unexpectedly connected");
+        }
+        catch (SQLException se)
+        {
+            return se;
+        }
+    }
+
+    SQLException executeQuery(Connection conn, String query)
+    {
+        util.DEBUG("executeQuery: " + query);
+        try
+        {
+            Statement s = conn.createStatement();
+            ResultSet rs = s.executeQuery(query);
+            return null;        
+        }
+        catch (SQLException se)
+        {
+            return se;
+        }
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_StateTest_part2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=634734&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java
Fri Mar  7 08:34:18 2008
@@ -0,0 +1,60 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbc4.ReplicationSuite
+
+       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.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License
+*/
+package org.apache.derbyTesting.functionTests.tests.replicationTests;
+
+import java.sql.SQLException;
+
+import org.apache.derbyTesting.junit.BaseTestCase;
+
+import junit.framework.Test; 
+import junit.framework.TestSuite;
+
+/**
+ * Suite to run all JUnit tests in this package:
+ * org.apache.derbyTesting.functionTests.tests.jdbc4
+ *
+ */
+public class ReplicationSuite extends BaseTestCase  
+{
+	/**
+	 * Use suite method instead.
+	 */
+	private ReplicationSuite(String name) {
+		super(name);
+	}
+
+	public static Test suite() throws SQLException {
+
+		TestSuite suite = new TestSuite("ReplicationSuite");
+
+		suite.addTest(ReplicationRun_Local.suite());
+        
+		suite.addTest(ReplicationRun_Local_StateTest_part1.suite());
+		suite.addTest(ReplicationRun_Local_StateTest_part1_1.suite());
+		suite.addTest(ReplicationRun_Local_StateTest_part1_2.suite());
+		suite.addTest(ReplicationRun_Local_StateTest_part1_3.suite());
+        
+		suite.addTest(ReplicationRun_Local_StateTest_part2.suite());
+        		
+		return suite;
+	}
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationSuite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/TestPreStartedMaster.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/TestPreStartedMaster.java?rev=634734&r1=634733&r2=634734&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/TestPreStartedMaster.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/TestPreStartedMaster.java
Fri Mar  7 08:34:18 2008
@@ -24,13 +24,9 @@
 import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.sql.Statement;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
@@ -78,7 +74,9 @@
     /**
      *
      *
-     * @throws SQLException, IOException, InterruptedException
+     * @throws java.sql.SQLException 
+     * @throws java.io.IOException 
+     * @throws java.lang.InterruptedException 
      */
     public void testStartMasterConnect_OK()
     throws SQLException, IOException, InterruptedException
@@ -112,7 +110,8 @@
         
         System.out.println("2. startMaster attempt should fail on: " + connectionURL);
         System.out.println("********************'' 2. CURRENTLY HANGS!!!! Skipping.");
-        if (false){ // FIXME! PRELIM Hangs!!
+        // if (false)
+        { // FIXME! PRELIM Hangs!!
         // A 2. StartMaster connect should fail:
         try
         {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/Utils.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/Utils.java?rev=634734&r1=634733&r2=634734&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/Utils.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/Utils.java
Fri Mar  7 08:34:18 2008
@@ -33,7 +33,7 @@
 
 class Utils
 {
-    boolean printDebug = true;
+    boolean printDebug = false;
     
     private final static String FS = File.separator;
     



Mime
View raw message