KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > openwire > v1 > MessageTestSupport


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.openwire.v1;
19
20 import java.io.DataInputStream JavaDoc;
21 import java.io.DataOutputStream JavaDoc;
22 import java.io.IOException JavaDoc;
23
24 import org.apache.activemq.openwire.*;
25 import org.apache.activemq.command.*;
26
27
28 /**
29  * Test case for the OpenWire marshalling for Message
30  *
31  *
32  * NOTE!: This file is auto generated - do not modify!
33  * if you need to make a change, please see the modify the groovy scripts in the
34  * under src/gram/script and then use maven openwire:generate to regenerate
35  * this file.
36  *
37  * @version $Revision: 439111 $
38  */

39 public abstract class MessageTestSupport extends BaseCommandTestSupport {
40
41     
42     protected void populateObject(Object JavaDoc object) throws Exception JavaDoc {
43             super.populateObject(object);
44             Message info = (Message) object;
45         info.setProducerId(createProducerId("ProducerId:1"));
46         info.setDestination(createActiveMQDestination("Destination:2"));
47         info.setTransactionId(createTransactionId("TransactionId:3"));
48         info.setOriginalDestination(createActiveMQDestination("OriginalDestination:4"));
49         info.setMessageId(createMessageId("MessageId:5"));
50         info.setOriginalTransactionId(createTransactionId("OriginalTransactionId:6"));
51         info.setGroupID("GroupID:7");
52         info.setGroupSequence(1);
53         info.setCorrelationId("CorrelationId:8");
54         info.setPersistent(true);
55         info.setExpiration(1);
56         info.setPriority((byte) 1);
57         info.setReplyTo(createActiveMQDestination("ReplyTo:9"));
58         info.setTimestamp(2);
59         info.setType("Type:10");
60         
61             {
62                 byte data[] = "Content:11".getBytes();
63                 info.setContent(new org.apache.activemq.util.ByteSequence(data,0,data.length));
64             }
65             
66         
67             {
68                 byte data[] = "MarshalledProperties:12".getBytes();
69                 info.setMarshalledProperties(new org.apache.activemq.util.ByteSequence(data,0,data.length));
70             }
71             
72         info.setDataStructure(createDataStructure("DataStructure:13"));
73         info.setTargetConsumerId(createConsumerId("TargetConsumerId:14"));
74         info.setCompressed(false);
75         info.setRedeliveryCounter(2);
76         
77                 {
78                 BrokerId value[] = new BrokerId[2];
79                 for( int i=0; i < 2; i++ ) {
80                     value[i] = createBrokerId("BrokerPath:15");
81                 }
82                 info.setBrokerPath(value);
83             }
84         info.setArrival(3);
85         info.setUserID("UserID:16");
86         info.setRecievedByDFBridge(true);
87
88             }
89         }
90
Popular Tags