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/ReceiptMarshallerTest.java


1   /**
2   * Test case for the marshalling code for Open Wire Format for Receipt
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 Receipt
19  
20   * @version $Revision: 1.1 $
21   */
22  public class ReceiptMarshallerTest extends PacketMarshallerTestSupport {
23  
24      /**
25       * @return a newly created marshaller
26       */
27      protected AbstractPacketMarshaller createMarshaller() {
28          return new ReceiptMarshaller();
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          Receipt info = (Receipt) packet;
38  
39          info.setCorrelationId((short) 31);
40          info.setFailed(false);
41          info.setBrokerMessageCapacity(33);
42          info.setBrokerName("TestString34");
43          info.setClusterName("TestString35");
44          info.setExceptionAsString("TestString36");
45     }
46  
47      /**
48       * Asserts that the read packet has the correct values
49       */
50      protected void assertPacketValid(Packet packet) throws Exception {
51          super.assertPacketValid(packet);
52          Receipt info = (Receipt) packet;
53          
54          assertEquals("property CorrelationId", (short) 31, info.getCorrelationId());
55          assertEquals("property Failed", false, info.isFailed());
56          assertEquals("property BrokerMessageCapacity", 33, info.getBrokerMessageCapacity());
57          assertEquals("property BrokerName", "TestString34", info.getBrokerName());
58          assertEquals("property ClusterName", "TestString35", info.getClusterName());
59          assertEquals("property ExceptionAsString", "TestString36", info.getExceptionAsString());
60      }
61  }