summaryrefslogtreecommitdiff
path: root/java
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
commitf3e4329056f4007d3937e9ff57bb43609064bba9 (patch)
tree513698eac87d20e281e86a20e7d479720fb730fe /java
parent3c110ac0ec200ae998bbbe0ebd474e432bbe98f1 (diff)
downloadqpid-python-f3e4329056f4007d3937e9ff57bb43609064bba9.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/qpid@805267 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java25
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java12
-rw-r--r--java/test-profiles/cpp.ssl.excludes2
-rw-r--r--java/test-profiles/default.testprofile3
-rw-r--r--java/test-profiles/test-provider.properties6
5 files changed, 28 insertions, 20 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
index 9bca1ec39f..dfc3bb7b42 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
+++ b/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/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java b/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
index f7d8152c83..cc9cfce34b 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
+++ b/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());
}
diff --git a/java/test-profiles/cpp.ssl.excludes b/java/test-profiles/cpp.ssl.excludes
index bf21ab9cc7..1828581d55 100644
--- a/java/test-profiles/cpp.ssl.excludes
+++ b/java/test-profiles/cpp.ssl.excludes
@@ -1 +1 @@
-org.apache.qpid.test.client.failover.FailoverTest#*
+#org.apache.qpid.test.client.failover.FailoverTest#*
diff --git a/java/test-profiles/default.testprofile b/java/test-profiles/default.testprofile
index 864cf149d4..49d4a25b82 100644
--- a/java/test-profiles/default.testprofile
+++ b/java/test-profiles/default.testprofile
@@ -19,7 +19,8 @@ log4j.debug=false
test.port=15672
test.mport=18999
test.port.ssl=15671
-test.port.alt=15673
+test.port.alt=15772
+test.port.alt.ssl=15771
test.exclude=true
profile.excludes=08TransientExcludes
diff --git a/java/test-profiles/test-provider.properties b/java/test-profiles/test-provider.properties
index 2479b5a5f0..e5cb18da0b 100644
--- a/java/test-profiles/test-provider.properties
+++ b/java/test-profiles/test-provider.properties
@@ -21,13 +21,17 @@
test.port=5672
test.port.ssl=5671
-test.port.alt=5673
+test.port.alt=5772
+test.port.alt.ssl=5771
connectionfactory.default = amqp://username:password@clientid/test?brokerlist='tcp://localhost:${test.port}'
connectionfactory.default.vm = amqp://username:password@clientid/test?brokerlist='vm://:1'
connectionfactory.ssl = amqp://username:password@clientid/test?brokerlist='tcp://localhost:${test.port.ssl}?ssl='true''
connectionfactory.failover = amqp://username:password@clientid/test?brokerlist='tcp://localhost:${test.port.alt};tcp://localhost:${test.port}'&sync_ack='true'&sync_publish='all'&failover='roundrobin?cyclecount='20''
+
+connectionfactory.failover.ssl = amqp://username:password@clientid/test?brokerlist='tcp://localhost:${test.port.alt.ssl}?ssl='true';tcp://localhost:${test.port.ssl}?ssl='true''&sync_ack='true'&sync_publish='all'&failover='roundrobin?cyclecount='20''
+
connectionfactory.failover.vm = amqp://username:password@clientid/test?brokerlist='vm://:2;vm://:1'
connectionfactory.connection1 = amqp://username:password@clientid/test?brokerlist='tcp://localhost:${test.port}'
connectionfactory.connection2 = amqp://username:password@clientid/test?brokerlist='tcp://localhost:${test.port.alt}'