activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1126609 - in /activemq/activemq-apollo/trunk: apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/ apollo-dto/src/test/java/org/apache/activemq/apollo/dto/ apollo-dto/src/te...
Date Mon, 23 May 2011 17:33:36 GMT
Author: chirino
Date: Mon May 23 17:33:34 2011
New Revision: 1126609

URL: http://svn.apache.org/viewvc?rev=1126609&view=rev
Log:
Fixes https://issues.apache.org/jira/browse/APLO-25 : Move STOMP specific protocol bits from
the dto module into the stomp module.

Added:
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/stomp/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/stomp/dto/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/stomp/dto/jaxb.index
      - copied, changed from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala
      - copied, changed from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.java
      - copied, changed from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
      - copied, changed from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompDTO.java
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/package-info.java
      - copied, changed from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade
      - copied, changed from r1126512, activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/stomp/
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/stomp/dto/
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/stomp/dto/simple.xml
      - copied, changed from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/dto/
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/dto/XmlCodecTest.java
Removed:
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompDTO.java
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.jade
Modified:
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
    activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java
    activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
    activemq/activemq-apollo/trunk/apollo-stomp/pom.xml
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java?rev=1126609&r1=1126608&r2=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
Mon May 23 17:33:34 2011
@@ -18,13 +18,14 @@ package org.apache.activemq.apollo.dto;
 
 import org.codehaus.jackson.annotate.JsonTypeInfo;
 
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.*;
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
+@XmlType (name = "protocol_type")
 @JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
-public abstract class ProtocolDTO {
-
+@XmlRootElement(name="protocol")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ProtocolDTO {
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index?rev=1126609&r1=1126608&r2=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
Mon May 23 17:33:34 2011
@@ -36,7 +36,6 @@ StringIdListDTO
 TimeMetricDTO
 VirtualHostDTO
 VirtualHostStatusDTO
-StompConnectionStatusDTO
 KeyStorageDTO
 SimpleStoreStatusDTO
 NullStoreDTO
@@ -44,6 +43,5 @@ QueueDTO
 TopicDTO
 LinkDTO
 QueueConsumerStatusDTO
-StompDTO
 ValueDTO
 StringListDTO
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java?rev=1126609&r1=1126608&r2=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java
Mon May 23 17:33:34 2011
@@ -39,18 +39,6 @@ public class XmlCodecTest {
     public void unmarshalling() throws Exception {
         BrokerDTO dto = XmlCodec.decode(BrokerDTO.class, resource("XmlCodecTest.xml"));
         assertNotNull(dto);
-        assertEquals(1, dto.connectors.size());
-        ConnectorDTO connector = dto.connectors.get(0);
-        assertEquals(1, connector.protocols.size());
-        ProtocolDTO stomp = connector.protocols.get(0);
-        assertTrue(stomp instanceof StompDTO);
-        assertEquals("JMSXUserID", ((StompDTO) stomp).add_user_header);
-
-        List<AddUserHeaderDTO> add_user_headers = ((StompDTO) stomp).add_user_headers;
-        assertEquals(2, add_user_headers.size());
-        assertEquals("GroupId", add_user_headers.get(0).name);
-        assertEquals("UserId", add_user_headers.get(1).name);
-        assertEquals("UserPrincipal", add_user_headers.get(1).kind);
 
         VirtualHostDTO host = dto.virtual_hosts.get(0);
         assertNotNull(host.acl);

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml?rev=1126609&r1=1126608&r2=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
Mon May 23 17:33:34 2011
@@ -33,10 +33,5 @@
     <durable_subscription name="durable_subscription1"/>
 
   </virtual_host>
-  <connector bind="tcp://0.0.0.0:61616" enabled="true" id="port-61616">
-    <stomp add_user_header="JMSXUserID">
-      <add_user_header>GroupId</add_user_header>
-      <add_user_header kind="UserPrincipal">UserId</add_user_header>
-    </stomp>
-  </connector>
+
 </broker>

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala?rev=1126609&r1=1126608&r2=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
Mon May 23 17:33:34 2011
@@ -41,6 +41,7 @@ import security.SecurityContext
 import tcp.TcpTransport
 import codec.OpenWireFormat
 import command._
+import org.apache.activemq.apollo.stomp.dto.StompConnectionStatusDTO
 import org.apache.activemq.apollo.dto.{TopicDestinationDTO, DurableSubscriptionDestinationDTO,
DestinationDTO, StompConnectionStatusDTO}
 
 object OpenwireProtocolHandler extends Log {

Modified: activemq/activemq-apollo/trunk/apollo-stomp/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/pom.xml?rev=1126609&r1=1126608&r2=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/pom.xml Mon May 23 17:33:34 2011
@@ -143,8 +143,23 @@
           </execution>
         </executions>
       </plugin>
+
+      <plugin>
+        <groupId>org.fusesource.scalate</groupId>
+        <artifactId>maven-scalate-plugin</artifactId>
+        <version>${scalate-version}</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>precompile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      
     </plugins>
-  </build>  
+  </build>
+  
   <profiles>
     
     <profile>

Added: activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index?rev=1126609&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
(added)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
Mon May 23 17:33:34 2011
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+org.apache.activemq.apollo.stomp.ExtensionModule
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/stomp/dto/jaxb.index
(from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/stomp/dto/jaxb.index?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/stomp/dto/jaxb.index&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index&r1=1126512&r2=1126609&rev=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/org/apache/activemq/apollo/stomp/dto/jaxb.index
Mon May 23 17:33:34 2011
@@ -14,36 +14,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # ------------------------------------------------------------------------
-BrokerDTO
-BrokerStatusDTO
-ConnectionStatusDTO
-ConnectorDTO
-ConnectorStatusDTO
-TopicStatusDTO
-EntryStatusDTO
-IntMetricDTO
-LongIdDTO
-LongIdLabeledDTO
-LongIdListDTO
-QueueStatusDTO
-ServiceDTO
-ServiceStatusDTO
-StoreDTO
-StoreStatusDTO
-StringIdDTO
-StringIdLabeledDTO
-StringIdListDTO
-TimeMetricDTO
-VirtualHostDTO
-VirtualHostStatusDTO
-StompConnectionStatusDTO
-KeyStorageDTO
-SimpleStoreStatusDTO
-NullStoreDTO
-QueueDTO
-TopicDTO
-LinkDTO
-QueueConsumerStatusDTO
 StompDTO
-ValueDTO
-StringListDTO
\ No newline at end of file
+StompConnectionStatusDTO

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala
(from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java&r1=1126512&r2=1126609&rev=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala
Mon May 23 17:33:34 2011
@@ -1,3 +1,5 @@
+package org.apache.activemq.apollo.stomp
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,17 +16,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
-
-import org.codehaus.jackson.annotate.JsonTypeInfo;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
+import org.apache.activemq.apollo.util.Module
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
-public abstract class ProtocolDTO {
-
-}
+class ExtensionModule extends Module {
+  override def xml_packages = Array("org.apache.activemq.apollo.stomp.dto")
+}
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1126609&r1=1126608&r2=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Mon May 23 17:33:34 2011
@@ -17,6 +17,7 @@
 package org.apache.activemq.apollo.stomp
 
 import _root_.org.fusesource.hawtbuf._
+import dto.{StompConnectionStatusDTO, StompDTO}
 import org.fusesource.hawtdispatch._
 
 import Buffer._

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.java
(from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.java?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.java&r1=1126512&r2=1126609&rev=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.java
Mon May 23 17:33:34 2011
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
+package org.apache.activemq.apollo.stomp.dto;
+
+import org.apache.activemq.apollo.dto.ConnectionStatusDTO;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
(from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompDTO.java&r1=1126512&r2=1126609&rev=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StompDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
Mon May 23 17:33:34 2011
@@ -14,7 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
+package org.apache.activemq.apollo.stomp.dto;
+
+import org.apache.activemq.apollo.dto.AddUserHeaderDTO;
+import org.apache.activemq.apollo.dto.ProtocolDTO;
 
 import javax.xml.bind.annotation.*;
 import java.util.ArrayList;

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/package-info.java
(from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/package-info.java?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/package-info.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java&r1=1126512&r2=1126609&rev=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ProtocolDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/package-info.java
Mon May 23 17:33:34 2011
@@ -14,17 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
-
-import org.codehaus.jackson.annotate.JsonTypeInfo;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
 
 /**
- * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ * The JAXB POJOs for the
+ * The JAXB POJOs for the
+ * <a href="http://activemq.apache.org/schema/activemq/apollo/xml-configuration.html">XML
Configuration</a>
+ * of the ActiveMQ Broker.
  */
-@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
-public abstract class ProtocolDTO {
+@javax.xml.bind.annotation.XmlSchema(
+        namespace = "http://activemq.apache.org/schema/activemq/apollo",
+        elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.activemq.apollo.stomp.dto;
 
-}

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade
(from r1126512, activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.jade)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade&p1=activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/StompConnectionStatusDTO.jade&r1=1126512&r2=1126609&rev=1126609&view=diff
==============================================================================
    (empty)

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/stomp/dto/simple.xml
(from r1126512, activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/stomp/dto/simple.xml?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/stomp/dto/simple.xml&p1=activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml&r1=1126512&r2=1126609&rev=1126609&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/org/apache/activemq/apollo/stomp/dto/simple.xml
Mon May 23 17:33:34 2011
@@ -16,24 +16,10 @@
     limitations under the License.
 -->
 <broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
-
-  <acl>
-    <admin allow="hiram"/>
-    <admin allow="james"/>
-    <admin allow="admins" kind="org.apache.activemq.jaas.GroupPrincipal"/>
-  </acl>
-
   <virtual_host id="vh-local">
-    <acl/>
-    <host_name>localhost</host_name>
-    <host_name>example.com</host_name>
-
-    <queue name="queue1"/>
-    <topic name="topic1"/>
-    <durable_subscription name="durable_subscription1"/>
-
   </virtual_host>
-  <connector bind="tcp://0.0.0.0:61616" enabled="true" id="port-61616">
+
+  <connector bind="tcp://0.0.0.0:61616" id="port-61616">
     <stomp add_user_header="JMSXUserID">
       <add_user_header>GroupId</add_user_header>
       <add_user_header kind="UserPrincipal">UserId</add_user_header>

Added: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/dto/XmlCodecTest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/dto/XmlCodecTest.java?rev=1126609&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/dto/XmlCodecTest.java
(added)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/dto/XmlCodecTest.java
Mon May 23 17:33:34 2011
@@ -0,0 +1,60 @@
+/**
+ * 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.
+ */
+package org.apache.activemq.apollo.stomp.dto;
+
+import org.apache.activemq.apollo.dto.*;
+import org.junit.Test;
+
+import java.io.InputStream;
+import java.util.List;
+
+import static junit.framework.Assert.*;
+import static junit.framework.Assert.assertEquals;
+
+
+/**
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+
+public class XmlCodecTest {
+
+    private InputStream resource(String path) {
+        return getClass().getResourceAsStream(path);
+    }
+
+    @Test
+    public void unmarshalling() throws Exception {
+        BrokerDTO dto = XmlCodec.decode(BrokerDTO.class, resource("simple.xml"));
+        assertNotNull(dto);
+
+        assertEquals(1, dto.connectors.size());
+        ConnectorDTO connector = dto.connectors.get(0);
+        assertEquals(1, connector.protocols.size());
+        ProtocolDTO stomp = connector.protocols.get(0);
+        assertTrue(stomp instanceof StompDTO);
+        assertEquals("JMSXUserID", ((StompDTO) stomp).add_user_header);
+
+        List<AddUserHeaderDTO> add_user_headers = ((StompDTO) stomp).add_user_headers;
+        assertEquals(2, add_user_headers.size());
+        assertEquals("GroupId", add_user_headers.get(0).name);
+        assertEquals("UserId", add_user_headers.get(1).name);
+        assertEquals("UserPrincipal", add_user_headers.get(1).kind);
+
+    }
+
+
+}



Mime
View raw message