Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/activemq/transport/openwire/io/ActiveMQMessageMarshallerTest.java


1   /**
2   * Test case for the marshalling code for Open Wire Format for ActiveMQMessage
3   *
4   *
5   * NOTE!: This file is autogenerated - do not modify!
6   *        if you need to make a change, please see the Groovy scripts in the
7   *        activemq-openwire module
8   */
9   
10  package org.activemq.transport.openwire.io;
11  
12  import org.activemq.io.impl.AbstractPacketMarshaller;
13  import org.activemq.message.*;
14  import org.activemq.message.Packet;
15  import org.activemq.transport.openwire.PacketMarshallerTestSupport;
16  
17  /**
18   * AUTOGENERATED test case for OpenWire command ActiveMQMessage
19  
20   * @version $Revision: 1.1 $
21   */
22  public class ActiveMQMessageMarshallerTest extends PacketMarshallerTestSupport {
23  
24      /**
25       * @return a newly created marshaller
26       */
27      protected AbstractPacketMarshaller createMarshaller() {
28          return new ActiveMQMessageMarshaller();
29      }
30  
31  
32      /**
33       * configures the packet with some test data
34       */
35      protected void populatePacket(Packet packet) throws Exception {
36          super.populatePacket(packet);
37          ActiveMQMessage info = (ActiveMQMessage) packet;
38  
39          info.setConsumerNosAsString("1,54");
40          info.setJMSMessageID("TestString55");
41          info.setJMSTimestamp((long) 56);
42          info.setJMSCorrelationID("TestString57");
43          info.setJMSReplyTo(new ActiveMQQueue("TEST.FOO.BAR.58"));
44          info.setJMSDestination(new ActiveMQQueue("TEST.FOO.BAR.59"));
45          info.setJMSDeliveryMode(60);
46          info.setJMSRedelivered(true);
47          info.setJMSType("TestString62");
48          info.setJMSExpiration((long) 63);
49          info.setJMSPriority(64);
50          info.setProperties(null);
51          info.setEntryBrokerName("TestString66");
52          info.setEntryClusterName("TestString67");
53          info.setJMSClientID("TestString68");
54          info.setSequenceNumber((long) 69);
55          info.setDeliveryCount(70);
56          info.setDispatchedFromDLQ(true);
57          info.setMesssageHandle((short) 72);
58          info.setExternalMessageId(true);
59          info.setProducerKey("TestString74");
60          info.setMessagePart(true);
61          info.setNumberOfParts((short) 76);
62          info.setPartNumber((short) 77);
63          info.setParentMessageID("TestString78");
64          info.setTransactionIDString("TestString79");
65     }
66  
67      /**
68       * Asserts that the read packet has the correct values
69       */
70      protected void assertPacketValid(Packet packet) throws Exception {
71          super.assertPacketValid(packet);
72          ActiveMQMessage info = (ActiveMQMessage) packet;
73          
74          assertEquals("property ConsumerNosAsString", "1,54", info.getConsumerNosAsString());
75          assertEquals("property JMSMessageID", "TestString55", info.getJMSMessageID());
76          assertEquals("property JMSTimestamp", (long) 56, info.getJMSTimestamp());
77          assertEquals("property JMSCorrelationID", "TestString57", info.getJMSCorrelationID());
78          assertEquals("property JMSReplyTo", new ActiveMQQueue("TEST.FOO.BAR.58"), info.getJMSReplyTo());
79          assertEquals("property JMSDestination", new ActiveMQQueue("TEST.FOO.BAR.59"), info.getJMSDestination());
80          assertEquals("property JMSDeliveryMode", 60, info.getJMSDeliveryMode());
81          assertEquals("property JMSRedelivered", true, info.getJMSRedelivered());
82          assertEquals("property JMSType", "TestString62", info.getJMSType());
83          assertEquals("property JMSExpiration", (long) 63, info.getJMSExpiration());
84          assertEquals("property JMSPriority", 64, info.getJMSPriority());
85          assertEquals("property Properties", null, info.getProperties());
86          assertEquals("property EntryBrokerName", "TestString66", info.getEntryBrokerName());
87          assertEquals("property EntryClusterName", "TestString67", info.getEntryClusterName());
88          assertEquals("property JMSClientID", "TestString68", info.getJMSClientID());
89          assertEquals("property SequenceNumber", (long) 69, info.getSequenceNumber());
90          assertEquals("property DeliveryCount", 70, info.getDeliveryCount());
91          assertEquals("property DispatchedFromDLQ", true, info.isDispatchedFromDLQ());
92          assertEquals("property MesssageHandle", (short) 72, info.getMesssageHandle());
93          assertEquals("property ExternalMessageId", true, info.isExternalMessageId());
94          assertEquals("property ProducerKey", "TestString74", info.getProducerKey());
95          assertEquals("property MessagePart", true, info.isMessagePart());
96          assertEquals("property NumberOfParts", (short) 76, info.getNumberOfParts());
97          assertEquals("property PartNumber", (short) 77, info.getPartNumber());
98          assertEquals("property ParentMessageID", "TestString78", info.getParentMessageID());
99          assertEquals("property TransactionIDString", "TestString79", info.getTransactionIDString());
100     }
101 }