Source code: org/miamm/soapmmil/SoapmmilMessageTest.java
1 package org.miamm.soapmmil;
2
3 import junit.framework.TestCase;
4 // JUnitDoclet begin import
5
6 import java.io.StringReader;
7
8 import javax.xml.soap.SOAPMessage;
9
10 import junit.framework.TestCase;
11 import junit.framework.TestCase;
12
13 import org.miamm.castor.headerblock.MiammSoapHeaderBlock;
14 import org.miamm.castor.headerblock.types.MsgContentType;
15 import org.miamm.soapmmil.SoapmmilMessage;
16 // JUnitDoclet end import
17
18 /**
19 * Generated by JUnitDoclet, a tool provided by
20 * ObjectFab GmbH under LGPL.
21 * Please see www.junitdoclet.org, www.gnu.org
22 * and www.objectfab.de for informations about
23 * the tool, the licence and the authors.
24 */
25
26
27 public class SoapmmilMessageTest
28 // JUnitDoclet begin extends_implements
29 extends SoapmmilTestCase
30 // JUnitDoclet end extends_implements
31 {
32 // JUnitDoclet begin class
33 org.miamm.soapmmil.SoapmmilMessage soapmmilmessage = null;
34 // JUnitDoclet end class
35
36 public SoapmmilMessageTest(String name) {
37 // JUnitDoclet begin method SoapmmilMessageTest
38 super(name);
39 // JUnitDoclet end method SoapmmilMessageTest
40 }
41
42 public org.miamm.soapmmil.SoapmmilMessage createInstance() throws Exception {
43 // JUnitDoclet begin method testcase.createInstance
44 return new SoapmmilMessage(MsgContentType.NOTHING,
45 new StringReader("<nothing/>"));
46 // JUnitDoclet end method testcase.createInstance
47 }
48
49 protected void setUp() throws Exception {
50 // JUnitDoclet begin method testcase.setUp
51 super.setUp();
52 soapmmilmessage = createInstance();
53 // JUnitDoclet end method testcase.setUp
54 }
55
56 protected void tearDown() throws Exception {
57 // JUnitDoclet begin method testcase.tearDown
58 soapmmilmessage = null;
59 super.tearDown();
60 // JUnitDoclet end method testcase.tearDown
61 }
62
63 public void testClone() throws Exception {
64 // JUnitDoclet begin method clone
65 // JUnitDoclet end method clone
66 }
67
68 public void testGetMisoh() throws Exception {
69 // JUnitDoclet begin method getMisoh
70 // JUnitDoclet end method getMisoh
71 }
72
73 public void testGetContents() throws Exception {
74 // JUnitDoclet begin method getContents
75 // JUnitDoclet end method getContents
76 }
77
78 public void testGetMsgType() throws Exception {
79 // JUnitDoclet begin method getMsgType
80 // JUnitDoclet end method getMsgType
81 }
82
83 public void testSetGetMsgId() throws Exception {
84 // JUnitDoclet begin method setMsgId getMsgId
85 java.lang.String[] tests = {"", " ", "a", "A", "Š", "§", "0123456789", "012345678901234567890", "\n", null};
86
87 for (int i = 0; i < tests.length; i++) {
88 soapmmilmessage.setMsgId(tests[i]);
89 assertEquals(tests[i], soapmmilmessage.getMsgId());
90 }
91 // JUnitDoclet end method setMsgId getMsgId
92 }
93
94 public void testSetGetSender() throws Exception {
95 // JUnitDoclet begin method setSender getSender
96 java.lang.String[] tests = {"", " ", "a", "A", "Š", "§", "0123456789", "012345678901234567890", "\n", null};
97
98 for (int i = 0; i < tests.length; i++) {
99 soapmmilmessage.setSender(tests[i]);
100 assertEquals(tests[i], soapmmilmessage.getSender());
101 }
102 // JUnitDoclet end method setSender getSender
103 }
104
105 public void testToSOAPMessage() throws Exception {
106 // JUnitDoclet begin method toSOAPMessage
107 SoapmmilMessage emptyMessage =
108 new SoapmmilMessage(MsgContentType.TOY_EVENT_Z,
109 getBigMessage());
110 emptyMessage.setMsgId("m1");
111 SOAPMessage soapMessage =
112 emptyMessage.toSOAPMessage("nobody");
113 assertTrue(soapMessage != null);
114
115 SoapmmilMessage responseMessage =
116 new SoapmmilMessage(emptyMessage,
117 MsgContentType.TOY_EVENT_Z,
118 getEmptyMessage());
119 responseMessage.setMsgId("m2");
120 SOAPMessage responseSoapMessage =
121 responseMessage.toSOAPMessage("nobody");
122 assertTrue(responseMessage != null);
123 // JUnitDoclet end method toSOAPMessage
124 }
125
126
127
128 /**
129 * JUnitDoclet moves marker to this method, if there is not match
130 * for them in the regenerated code and if the marker is not empty.
131 * This way, no test gets lost when regenerating after renaming.
132 * Method testVault is supposed to be empty.
133 */
134 public void testVault() throws Exception {
135 // JUnitDoclet begin method testcase.testVault
136 // JUnitDoclet begin method toSOAPMessage
137 // JUnitDoclet end method toSOAPMessage
138 // JUnitDoclet end method testcase.testVault
139 }
140
141 public static void main(String[] args) {
142 // JUnitDoclet begin method testcase.main
143 junit.textui.TestRunner.run(SoapmmilMessageTest.class);
144 // JUnitDoclet end method testcase.main
145 }
146 }