summaryrefslogtreecommitdiff
path: root/qpid/java/systests
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2009-08-18 03:39:04 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2009-08-18 03:39:04 +0000
commit06d1a8ad0bbfb4580bd7ba9fca8622d951e7b5c9 (patch)
tree25d3620021da6f52b55166bdd9e847291a2898fb /qpid/java/systests
parentd2a98d4dfc63fd606418f5bd433be514bbe20d01 (diff)
downloadqpid-python-06d1a8ad0bbfb4580bd7ba9fca8622d951e7b5c9.tar.gz
This commit allows a limited number of failover tests to run under the SSL profile using SSL connections.
This commit should also fix the tests hanging under the SSL test profile due to port conflicts with SSL and failover ports. FailoverBaseCase and FailoverTest is improved to handle the failover port without having to rely on port arithmetic. The FailoverBaseCase is modified to use the failover.ssl connection factory when running under the SSL profile. I have uncommented the FailoverTest from the cpp.ssl.excludes. However only a selected set of tests will run outside the cpp.clustered profile. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@805267 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java25
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java12
2 files changed, 20 insertions, 17 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
index 9bca1ec39f..dfc3bb7b42 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
@@ -333,8 +333,9 @@ public class FailoverTest extends FailoverBaseCase implements ConnectionListener
}
int iterations = Integer.getInteger("profile.failoverIterations",0);
- boolean b = true;
- int failingPort = getFailingPort();
+ boolean useAltPort = false;
+ int altPort = FAILING_PORT;
+ int stdPort = DEFAULT_PORT;
init(false, Session.AUTO_ACKNOWLEDGE);
for (int i=0; i < iterations; i++)
{
@@ -343,25 +344,25 @@ public class FailoverTest extends FailoverBaseCase implements ConnectionListener
_logger.debug("===================================================================");
runP2PFailover(numMessages, false,false, false);
- startBroker(failingPort);
- if (b)
+ startBroker(getFailingPort());
+ if (useAltPort)
{
- failingPort = getFailingPort()-1;
- b = false;
+ setFailingPort(altPort);
+ useAltPort = false;
}
else
{
- failingPort = getFailingPort()+1;
- b = true;
+ setFailingPort(stdPort);
+ useAltPort = true;
}
- setFailingPort(failingPort);
+
}
- //To prevent any failover logic being initiaed when we shutdown the brokers.
+ //To prevent any failover logic being initiated when we shutdown the brokers.
connection.close();
// Shutdown the brokers
- stopBroker(getFailingPort());
- stopBroker(b?getFailingPort()+1 : getFailingPort()-1);
+ stopBroker(altPort);
+ stopBroker(stdPort);
}
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
index f7d8152c83..cc9cfce34b 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
@@ -28,7 +28,7 @@ public class FailoverBaseCase extends QpidTestCase
{
public static int FAILING_VM_PORT = 2;
- public static int FAILING_PORT = DEFAULT_PORT + 1;
+ public static int FAILING_PORT = DEFAULT_PORT + 100;
protected int failingPort;
@@ -42,7 +42,7 @@ public class FailoverBaseCase extends QpidTestCase
}
else
{
- failingPort = FAILING_PORT;
+ failingPort = FAILING_PORT;
}
}
@@ -55,7 +55,7 @@ public class FailoverBaseCase extends QpidTestCase
{
super.setUp();
setSystemProperty("QPID_WORK", System.getProperty("java.io.tmpdir")+"/"+getFailingPort());
- startBroker(getFailingPort());
+ startBroker(FAILING_PORT);
}
/**
@@ -67,14 +67,16 @@ public class FailoverBaseCase extends QpidTestCase
public Connection getConnection() throws Exception
{
Connection conn =
- getConnectionFactory("failover").createConnection("guest", "guest");
+ (Boolean.getBoolean("profile.use_ssl"))?
+ getConnectionFactory("failover.ssl").createConnection("guest", "guest"):
+ getConnectionFactory("failover").createConnection("guest", "guest");
_connections.add(conn);
return conn;
}
public void tearDown() throws Exception
{
- stopBroker(getFailingPort());
+ stopBroker(FAILING_PORT);
super.tearDown();
FileUtils.deleteDirectory(System.getProperty("java.io.tmpdir")+"/"+getFailingPort());
}