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
this.sslBroker.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;
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;
}
}

View File

@ -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"