You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2012/08/12 15:26:08 UTC

svn commit: r1372091 - in /activemq/activemq-apollo/trunk: apollo-dto/src/test/java/org/apache/activemq/apollo/dto/ apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/

Author: chirino
Date: Sun Aug 12 13:26:07 2012
New Revision: 1372091

URL: http://svn.apache.org/viewvc?rev=1372091&view=rev
Log:
Fixes APLO-235 Invalid apollo.xsd

I've also now added a test case which validates the XSD so that this does not happen again in the future.

Modified:
    activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java

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=1372091&r1=1372090&r2=1372091&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 Sun Aug 12 13:26:07 2012
@@ -17,8 +17,14 @@
 package org.apache.activemq.apollo.dto;
 
 import org.junit.Test;
+import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
 import java.io.InputStream;
+import java.io.StringReader;
 
 import static junit.framework.Assert.*;
 
@@ -35,6 +41,13 @@ public class XmlCodecTest {
     }
 
     @Test
+    public void validateXSD() throws SAXException {
+        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+        Schema schema = factory.newSchema(XmlCodec.class.getResource("apollo.xsd"));
+        assertNotNull(schema);
+    }
+
+    @Test
     public void unmarshalling() throws Exception {
         BrokerDTO dto = XmlCodec.decode(BrokerDTO.class, resource("XmlCodecTest.xml"));
         assertNotNull(dto);

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java?rev=1372091&r1=1372090&r2=1372091&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java Sun Aug 12 13:26:07 2012
@@ -53,6 +53,7 @@ public class DestinationLoadDTO {
     @XmlAttribute(name="message_size_dequeue_counter")
     public Long message_size_dequeue_counter;
 
+    @XmlElement(name="consumer")
     public ArrayList<ConsumerLoadDTO> consumers = new ArrayList<ConsumerLoadDTO>();
 
 }

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java?rev=1372091&r1=1372090&r2=1372091&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java Sun Aug 12 13:26:07 2012
@@ -36,9 +36,9 @@ public class LoadStatusDTO {
     @XmlAttribute(name="timestamp")
     public long timestamp;
 
-    @XmlElementRef(name="queue")
+    @XmlElement(name="queue")
     public ArrayList<DestinationLoadDTO> queues = new ArrayList<DestinationLoadDTO>();
 
-    @XmlElementRef(name="topic")
+    @XmlElement(name="topic")
     public ArrayList<DestinationLoadDTO> topics = new ArrayList<DestinationLoadDTO>();
 }