git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1462210 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-03-28 16:36:57 +00:00
parent 734b9babba
commit b52c371cd9
3 changed files with 29 additions and 5 deletions

View File

@ -131,5 +131,7 @@ public class JaasDualAuthenticationBroker extends BrokerFilter {
// Give both a chance to clear out their contexts // Give both a chance to clear out their contexts
this.sslBroker.removeDestination(context, destination, timeout); this.sslBroker.removeDestination(context, destination, timeout);
this.nonSslBroker.removeDestination(context, destination, timeout); this.nonSslBroker.removeDestination(context, destination, timeout);
super.removeDestination(context, destination, timeout);
} }
} }

View File

@ -16,10 +16,10 @@
*/ */
package org.apache.activemq.bugs; package org.apache.activemq.bugs;
import java.io.File;
import java.net.Socket; import java.net.Socket;
import java.net.URI; import java.net.URI;
import javax.management.ObjectName;
import javax.net.SocketFactory; import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.SSLSocketFactory;
@ -49,7 +49,7 @@ public class AMQ4126Test {
protected String certBase = "src/test/resources/org/apache/activemq/security"; protected String certBase = "src/test/resources/org/apache/activemq/security";
protected String JaasStompSSLBroker_xml = "JaasStompSSLBroker.xml"; protected String JaasStompSSLBroker_xml = "JaasStompSSLBroker.xml";
protected StompConnection stompConnection = new StompConnection(); protected StompConnection stompConnection = new StompConnection();
private final static String destinationName = "TEST.QUEUE";
protected String oldLoginConf = null; protected String oldLoginConf = null;
@Before @Before
@ -60,6 +60,8 @@ public class AMQ4126Test {
System.setProperty(java_security_auth_login_config, confBase + "/login.config"); System.setProperty(java_security_auth_login_config, confBase + "/login.config");
broker = BrokerFactory.createBroker(xbean + confBase + "/" + JaasStompSSLBroker_xml); broker = BrokerFactory.createBroker(xbean + confBase + "/" + JaasStompSSLBroker_xml);
broker.setDeleteAllMessagesOnStartup(true);
broker.setUseJmx(true);
broker.start(); broker.start();
broker.waitUntilStarted(); broker.waitUntilStarted();
} }
@ -155,4 +157,24 @@ public class AMQ4126Test {
public void testOpenwireNIOSSLWithCertificate() throws Exception { public void testOpenwireNIOSSLWithCertificate() throws Exception {
openwireConnectTo("openwire+nio+ssl", null, null); 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;
}
} }

View File

@ -23,7 +23,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 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"> 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> <plugins>
<jaasDualAuthenticationPlugin configuration="activemq-domain" sslConfiguration="activemq-ssl-domain"/> <jaasDualAuthenticationPlugin configuration="activemq-domain" sslConfiguration="activemq-ssl-domain"/>