activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r732672 - in /activemq/trunk/activemq-core/src/test: java/org/apache/activemq/transport/stomp/ resources/org/apache/activemq/transport/stomp/
Date Thu, 08 Jan 2009 10:05:52 GMT
Author: dejanb
Date: Thu Jan  8 02:05:51 2009
New Revision: 732672

URL: http://svn.apache.org/viewvc?rev=732672&view=rev
Log:
fix for https://issues.apache.org/activemq/browse/AMQ-998

Added:
    activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/transport/stomp/sslstomp-auth-broker.xml
  (with props)
Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java?rev=732672&r1=732671&r2=732672&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSslTest.java
Thu Jan  8 02:05:51 2009
@@ -29,7 +29,14 @@
 public class StompSslTest extends StompTest {
 
     protected void setUp() throws Exception {
-        bindAddress = "stomp+ssl://localhost:0";
+        bindAddress = "stomp+ssl://localhost:61612";
+        confUri = "xbean:org/apache/activemq/transport/stomp/sslstomp-auth-broker.xml";
+        System.setProperty("javax.net.ssl.trustStore", "src/test/resources/client.keystore");
+        System.setProperty("javax.net.ssl.trustStorePassword", "password");
+        System.setProperty("javax.net.ssl.trustStoreType", "jks");
+        System.setProperty("javax.net.ssl.keyStore", "src/test/resources/server.keystore");
+        System.setProperty("javax.net.ssl.keyStorePassword", "password");
+        System.setProperty("javax.net.ssl.keyStoreType", "jks");  
         super.setUp();
     }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java?rev=732672&r1=732671&r2=732672&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java
Thu Jan  8 02:05:51 2009
@@ -20,6 +20,7 @@
 import java.io.DataInput;
 import java.io.DataInputStream;
 import java.io.IOException;
+import java.net.Socket;
 
 import javax.jms.Connection;
 import javax.jms.Message;
@@ -27,6 +28,7 @@
 import javax.jms.Session;
 
 import junit.framework.TestCase;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.command.ActiveMQQueue;
@@ -66,7 +68,7 @@
         session.close();
         connection.close();
 
-        stompConnection.open("localhost", STOMP_PORT);
+        stompConnection.open(new Socket("localhost", STOMP_PORT));
 
         String connectFrame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n" + "\n";
         stompConnection.sendFrame(connectFrame);
@@ -93,7 +95,7 @@
         Thread.sleep(1000);
         stompConnection.close();
 
-        stompConnection.open("localhost", STOMP_PORT);
+        stompConnection.open(new Socket("localhost", STOMP_PORT));
 
         connectFrame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n" + "\n";
         stompConnection.sendFrame(connectFrame);

Added: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/transport/stomp/sslstomp-auth-broker.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/transport/stomp/sslstomp-auth-broker.xml?rev=732672&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/transport/stomp/sslstomp-auth-broker.xml
(added)
+++ activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/transport/stomp/sslstomp-auth-broker.xml
Thu Jan  8 02:05:51 2009
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- this file can only be parsed using the xbean-spring library -->
+<!-- START SNIPPET: example -->
+<beans>
+  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+  
+  <bean class="org.apache.activemq.util.XStreamFactoryBean" name="xstream">
+        <property name="annotatedClass"><value>org.apache.activemq.transport.stomp.SamplePojo</value></property>
+  </bean>
+
+  <broker useJmx="true" persistent="false" xmlns="http://activemq.org/config/1.0" populateJMSXUserID="true">
+
+    <transportConnectors>
+      <transportConnector name="stomp+ssl"   uri="stomp+ssl://localhost:61612"/>
+    </transportConnectors>
+
+    <plugins>
+		<simpleAuthenticationPlugin>
+			<users>
+				<authenticationUser username="system" password="manager"
+					groups="users,admins"/>
+				<authenticationUser username="user" password="password"
+					groups="users"/>
+				<authenticationUser username="guest" password="password" groups="guests"/>
+			</users>
+		</simpleAuthenticationPlugin>
+
+
+      <!--  lets configure a destination based authorization mechanism -->
+      <authorizationPlugin>
+        <map>
+          <authorizationMap>
+            <authorizationEntries>
+              <authorizationEntry queue=">" read="admins" write="admins" admin="admins"
/>
+              <authorizationEntry queue="USERS.>" read="users" write="users" admin="users"
/>
+              <authorizationEntry queue="GUEST.>" read="guests" write="guests,users"
admin="guests,users" />
+              
+              <authorizationEntry topic=">" read="admins" write="admins" admin="admins"
/>
+              <authorizationEntry topic="USERS.>" read="users" write="users" admin="users"
/>
+              <authorizationEntry topic="GUEST.>" read="guests" write="guests,users"
admin="guests,users" />
+              
+              <authorizationEntry topic="ActiveMQ.Advisory.>" read="guests,users" write="guests,users"
admin="guests,users"/>
+            </authorizationEntries>
+          </authorizationMap>
+        </map>
+      </authorizationPlugin>
+    </plugins>
+  </broker>
+
+</beans>
\ No newline at end of file

Propchange: activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/transport/stomp/sslstomp-auth-broker.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message