activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1462210 - in /activemq/trunk: activemq-broker/src/main/java/org/apache/activemq/security/ activemq-unit-tests/src/test/java/org/apache/activemq/bugs/ activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/
Date Thu, 28 Mar 2013 16:36:58 GMT
Author: tabish
Date: Thu Mar 28 16:36:57 2013
New Revision: 1462210

URL: http://svn.apache.org/r1462210
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-4364

Modified:
    activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/security/JaasDualAuthenticationBroker.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4126Test.java
    activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml

Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/security/JaasDualAuthenticationBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/security/JaasDualAuthenticationBroker.java?rev=1462210&r1=1462209&r2=1462210&view=diff
==============================================================================
--- activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/security/JaasDualAuthenticationBroker.java
(original)
+++ activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/security/JaasDualAuthenticationBroker.java
Thu Mar 28 16:36:57 2013
@@ -131,5 +131,7 @@ public class JaasDualAuthenticationBroke
         // Give both a chance to clear out their contexts
         this.sslBroker.removeDestination(context, destination, timeout);
         this.nonSslBroker.removeDestination(context, destination, timeout);
+
+        super.removeDestination(context, destination, timeout);
     }
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4126Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4126Test.java?rev=1462210&r1=1462209&r2=1462210&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4126Test.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4126Test.java
Thu Mar 28 16:36:57 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.activemq.bugs;
 
-import java.io.File;
 import java.net.Socket;
 import java.net.URI;
 
+import javax.management.ObjectName;
 import javax.net.SocketFactory;
 import javax.net.ssl.SSLSocketFactory;
 
@@ -49,7 +49,7 @@ public class AMQ4126Test {
     protected String certBase = "src/test/resources/org/apache/activemq/security";
     protected String JaasStompSSLBroker_xml = "JaasStompSSLBroker.xml";
     protected StompConnection stompConnection = new StompConnection();
-
+    private final static String destinationName = "TEST.QUEUE";
     protected String oldLoginConf = null;
 
     @Before
@@ -60,6 +60,8 @@ public class AMQ4126Test {
         System.setProperty(java_security_auth_login_config, confBase + "/login.config");
         broker = BrokerFactory.createBroker(xbean + confBase + "/" + JaasStompSSLBroker_xml);
 
+        broker.setDeleteAllMessagesOnStartup(true);
+        broker.setUseJmx(true);
         broker.start();
         broker.waitUntilStarted();
     }
@@ -155,4 +157,24 @@ public class AMQ4126Test {
     public void testOpenwireNIOSSLWithCertificate() throws Exception {
         openwireConnectTo("openwire+nio+ssl", null, null);
     }
+
+    @Test
+    public void testJmx() throws Exception {
+        TestCase.assertFalse(findDestination(destinationName));
+        broker.getAdminView().addQueue(destinationName);
+        TestCase.assertTrue(findDestination(destinationName));
+        broker.getAdminView().removeQueue(destinationName);
+        TestCase.assertFalse(findDestination(destinationName));
+    }
+
+    private boolean findDestination(String name) throws Exception {
+        ObjectName[] destinations = broker.getAdminView().getQueues();
+        for (ObjectName destination : destinations) {
+            if (destination.toString().contains(name)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml?rev=1462210&r1=1462209&r2=1462210&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml
Thu Mar 28 16:36:57 2013
@@ -16,19 +16,19 @@
     limitations under the License.
 -->
 
-<beans 
+<beans
   xmlns="http://www.springframework.org/schema/beans"
   xmlns:amq="http://activemq.apache.org/schema/core"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
   http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
 
-  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker" id="broker"
useJmx="false" persistent="false">
+  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker" id="broker"
useJmx="true" persistent="false">
 
     <plugins>
         <jaasDualAuthenticationPlugin configuration="activemq-domain" sslConfiguration="activemq-ssl-domain"/>
     </plugins>
-    
+
     <sslContext>
       <sslContext
         keyStore="./src/test/resources/org/apache/activemq/security/broker1.ks"   keyStorePassword="password"



Mime
View raw message