You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2009/08/18 05:39:05 UTC

svn commit: r805267 - in /qpid/trunk/qpid/java: systests/src/main/java/org/apache/qpid/test/client/failover/ systests/src/main/java/org/apache/qpid/test/utils/ test-profiles/

Author: rajith
Date: Tue Aug 18 03:39:04 2009
New Revision: 805267

URL: http://svn.apache.org/viewvc?rev=805267&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
    qpid/trunk/qpid/java/test-profiles/cpp.ssl.excludes
    qpid/trunk/qpid/java/test-profiles/default.testprofile
    qpid/trunk/qpid/java/test-profiles/test-provider.properties

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java?rev=805267&r1=805266&r2=805267&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java Tue Aug 18 03:39:04 2009
@@ -333,8 +333,9 @@
         }
         
         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 @@
             _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);
         
     }  
     

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java?rev=805267&r1=805266&r2=805267&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java Tue Aug 18 03:39:04 2009
@@ -28,7 +28,7 @@
 {
 
     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 @@
         }
         else
         {
-            failingPort = FAILING_PORT;
+        	failingPort = FAILING_PORT;
         }
     }
     
@@ -55,7 +55,7 @@
     {
         super.setUp();
         setSystemProperty("QPID_WORK", System.getProperty("java.io.tmpdir")+"/"+getFailingPort());
-        startBroker(getFailingPort());
+        startBroker(FAILING_PORT);
     }
 
     /**
@@ -67,14 +67,16 @@
     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());
     }

Modified: qpid/trunk/qpid/java/test-profiles/cpp.ssl.excludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/cpp.ssl.excludes?rev=805267&r1=805266&r2=805267&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/cpp.ssl.excludes (original)
+++ qpid/trunk/qpid/java/test-profiles/cpp.ssl.excludes Tue Aug 18 03:39:04 2009
@@ -1 +1 @@
-org.apache.qpid.test.client.failover.FailoverTest#*
+#org.apache.qpid.test.client.failover.FailoverTest#*

Modified: qpid/trunk/qpid/java/test-profiles/default.testprofile
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/default.testprofile?rev=805267&r1=805266&r2=805267&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/default.testprofile (original)
+++ qpid/trunk/qpid/java/test-profiles/default.testprofile Tue Aug 18 03:39:04 2009
@@ -19,7 +19,8 @@
 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

Modified: qpid/trunk/qpid/java/test-profiles/test-provider.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/test-provider.properties?rev=805267&r1=805266&r2=805267&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/test-provider.properties (original)
+++ qpid/trunk/qpid/java/test-profiles/test-provider.properties Tue Aug 18 03:39:04 2009
@@ -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}'



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Re: svn commit: r805267 - in /qpid/trunk/qpid/java: systests/src/main/java/org/apache/qpid/test/client/failover/ systests/src/main/java/org/apache/qpid/test/utils/ test-profiles/

Posted by Rajith Attapattu <ra...@gmail.com>.
Aidan,

Should be good now.

Regards,

Rajith

On Tue, Aug 18, 2009 at 11:01 AM, Rajith Attapattu<ra...@gmail.com> wrote:
> Aidan,
>
> Let me investigate this. All though I thought I tested this on the
> default profiles.
>
> Regards,
>
> Rajith
>
> On Tue, Aug 18, 2009 at 10:56 AM, Aidan Skinner<ai...@gmail.com> wrote:
>> On Tue, Aug 18, 2009 at 4:39 AM, <ra...@apache.org> wrote:
>>
>>> Author: rajith
>>> Date: Tue Aug 18 03:39:04 2009
>>> New Revision: 805267
>>>
>>> URL: http://svn.apache.org/viewvc?rev=805267&view=rev
>>> Log:
>>> 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.
>>
>> The changes to FailoverBaseCase have broken
>> QueueBrowser*Test.testFailover* and FailoverTest when running in
>> either of the java test profiles. :(
>>
>> - Aidan
>>
>> --
>> Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
>> "A witty saying proves nothing" - Voltaire
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>>
>>
>
>
>
> --
> Regards,
>
> Rajith Attapattu
> Red Hat
> http://rajith.2rlabs.com/
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: svn commit: r805267 - in /qpid/trunk/qpid/java: systests/src/main/java/org/apache/qpid/test/client/failover/ systests/src/main/java/org/apache/qpid/test/utils/ test-profiles/

Posted by Rajith Attapattu <ra...@gmail.com>.
Aidan,

Let me investigate this. All though I thought I tested this on the
default profiles.

Regards,

Rajith

On Tue, Aug 18, 2009 at 10:56 AM, Aidan Skinner<ai...@gmail.com> wrote:
> On Tue, Aug 18, 2009 at 4:39 AM, <ra...@apache.org> wrote:
>
>> Author: rajith
>> Date: Tue Aug 18 03:39:04 2009
>> New Revision: 805267
>>
>> URL: http://svn.apache.org/viewvc?rev=805267&view=rev
>> Log:
>> 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.
>
> The changes to FailoverBaseCase have broken
> QueueBrowser*Test.testFailover* and FailoverTest when running in
> either of the java test profiles. :(
>
> - Aidan
>
> --
> Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
> "A witty saying proves nothing" - Voltaire
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: svn commit: r805267 - in /qpid/trunk/qpid/java: systests/src/main/java/org/apache/qpid/test/client/failover/ systests/src/main/java/org/apache/qpid/test/utils/ test-profiles/

Posted by Aidan Skinner <ai...@gmail.com>.
On Tue, Aug 18, 2009 at 4:39 AM, <ra...@apache.org> wrote:

> Author: rajith
> Date: Tue Aug 18 03:39:04 2009
> New Revision: 805267
>
> URL: http://svn.apache.org/viewvc?rev=805267&view=rev
> Log:
> 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.

The changes to FailoverBaseCase have broken
QueueBrowser*Test.testFailover* and FailoverTest when running in
either of the java test profiles. :(

- Aidan

-- 
Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
"A witty saying proves nothing" - Voltaire

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org