activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1352984 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3622Test.java
Date Fri, 22 Jun 2012 18:03:34 GMT
Author: tabish
Date: Fri Jun 22 18:03:33 2012
New Revision: 1352984

URL: http://svn.apache.org/viewvc?rev=1352984&view=rev
Log:
apply patch for: https://issues.apache.org/jira/browse/AMQ-3896

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3622Test.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3622Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3622Test.java?rev=1352984&r1=1352983&r2=1352984&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3622Test.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3622Test.java Fri
Jun 22 18:03:33 2012
@@ -16,6 +16,13 @@
  */
 package org.apache.activemq.bugs;
 
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.region.policy.FilePendingSubscriberMessageStoragePolicy;
 import org.apache.activemq.broker.region.policy.LastImageSubscriptionRecoveryPolicy;
@@ -31,15 +38,8 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static org.junit.Assert.fail;
-
 public class AMQ3622Test {
-    
+
     protected BrokerService broker;
     protected AtomicBoolean failed = new AtomicBoolean(false);
     protected String connectionUri;
@@ -72,7 +72,7 @@ public class AMQ3622Test {
         policy.setSubscriptionRecoveryPolicy(new LastImageSubscriptionRecoveryPolicy());
         policy.setExpireMessagesPeriod(500);
         List<PolicyEntry> entries = new ArrayList<PolicyEntry>();
-        
+
         entries.add(policy);
         PolicyMap pMap = new PolicyMap();
         pMap.setPolicyEntries(entries);
@@ -90,16 +90,17 @@ public class AMQ3622Test {
         broker.waitUntilStopped();
         Logger.getRootLogger().removeAppender(appender);
     }
-    
+
     @Test
     public void go() throws Exception {
         StompConnection connection = new StompConnection();
-        connection.open("localhost", Integer.parseInt(connectionUri.replace("stomp://localhost:",
"")));
+        Integer port = Integer.parseInt(connectionUri.split(":")[2]);
+        connection.open("localhost", port);        
         connection.connect("", "");
         connection.subscribe("/topic/foobar", Stomp.Headers.Subscribe.AckModeValues.CLIENT);
         connection.disconnect();
         Thread.sleep(1000);
-        
+
         if (failed.get()) {
             fail("Received NullPointerException");
         }



Mime
View raw message