Skip to content

Commit e415631

Browse files
committed
Test case cleanup.
1 parent 32edb5e commit e415631

1 file changed

Lines changed: 46 additions & 167 deletions

File tree

Lines changed: 46 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
1-
/**
2-
* AttachmentTestCase.java
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
39
*
4-
* This file was auto-generated from WSDL
5-
* by the Apache Axis WSDL2Java emitter.
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
618
*/
7-
819
package test.wsdl.attachments;
920

1021
import javax.mail.internet.MimeBodyPart;
1122
import javax.mail.internet.MimeMultipart;
1223

24+
import org.apache.axis.attachments.OctetStream;
25+
1326
import test.HttpTestUtil;
1427

1528
import java.util.Arrays;
1629

17-
public class AttachmentTestCase extends junit.framework.TestCase {
18-
public AttachmentTestCase(java.lang.String name) {
19-
super(name);
20-
}
30+
import junit.framework.TestCase;
2131

32+
public class AttachmentTestCase extends TestCase {
33+
private static Pt1 getBinding() throws Exception {
34+
AttachmentLocator loc = new AttachmentLocator();
35+
return loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
36+
}
37+
2238
private MimeMultipart createMimeMultipart(String data) throws Exception {
2339
// create the root multipart
2440
MimeMultipart mpRoot = new MimeMultipart("mixed");
@@ -30,187 +46,50 @@ private MimeMultipart createMimeMultipart(String data) throws Exception {
3046
return mpRoot;
3147
}
3248

33-
public void test1AttachmentPortRPCGetCompanyInfo2() throws Exception {
34-
test.wsdl.attachments.Pt1 binding;
35-
try {
36-
AttachmentLocator loc = new AttachmentLocator();
37-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
38-
} catch (javax.xml.rpc.ServiceException jre) {
39-
if (jre.getLinkedCause() != null)
40-
jre.getLinkedCause().printStackTrace();
41-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
42-
}
43-
assertTrue("binding is null", binding != null);
44-
45-
// Test operation
46-
java.lang.String value = null;
47-
value = binding.getCompanyInfo2(0, new java.lang.String("GetCompanyInfo2"), null);
48-
assertEquals(value, "GetCompanyInfo2");
49+
public void testGetCompanyInfo2() throws Exception {
50+
assertEquals("GetCompanyInfo2", getBinding().getCompanyInfo2(0, "GetCompanyInfo2", null));
4951
}
5052

51-
public void test2AttachmentPortRPCInputPlainText() throws Exception {
52-
test.wsdl.attachments.Pt1 binding;
53-
try {
54-
AttachmentLocator loc = new AttachmentLocator();
55-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
56-
} catch (javax.xml.rpc.ServiceException jre) {
57-
if (jre.getLinkedCause() != null)
58-
jre.getLinkedCause().printStackTrace();
59-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
60-
}
61-
assertTrue("binding is null", binding != null);
62-
63-
// Test operation
64-
binding.inputPlainText(new java.lang.String("InputPlainText"));
53+
public void testInputPlainText() throws Exception {
54+
getBinding().inputPlainText("InputPlainText");
6555
// TBD - validate results
6656
}
6757

68-
public void test3AttachmentPortRPCInoutPlainText() throws Exception {
69-
test.wsdl.attachments.Pt1 binding;
70-
try {
71-
AttachmentLocator loc = new AttachmentLocator();
72-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
73-
} catch (javax.xml.rpc.ServiceException jre) {
74-
if (jre.getLinkedCause() != null)
75-
jre.getLinkedCause().printStackTrace();
76-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
77-
}
78-
assertTrue("binding is null", binding != null);
79-
80-
// Test operation
81-
java.lang.String value = null;
82-
value = binding.inoutPlainText(new java.lang.String("InoutPlainText"));
83-
// TBD - validate results
84-
assertEquals(value, "InoutPlainText");
58+
public void testInoutPlainText() throws Exception {
59+
assertEquals("InoutPlainText", getBinding().inoutPlainText("InoutPlainText"));
8560
}
8661

87-
public void test4AttachmentPortRPCEchoPlainText() throws Exception {
88-
test.wsdl.attachments.Pt1 binding;
89-
try {
90-
AttachmentLocator loc = new AttachmentLocator();
91-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
92-
} catch (javax.xml.rpc.ServiceException jre) {
93-
if (jre.getLinkedCause() != null)
94-
jre.getLinkedCause().printStackTrace();
95-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
96-
}
97-
assertTrue("binding is null", binding != null);
98-
99-
// Test operation
100-
java.lang.String value = null;
101-
value = binding.echoPlainText(new java.lang.String("EchoPlainText"));
102-
// TBD - validate results
103-
assertEquals(value, "EchoPlainText");
62+
public void testEchoPlainText() throws Exception {
63+
assertEquals("EchoPlainText", getBinding().echoPlainText("EchoPlainText"));
10464
}
10565

106-
public void test5AttachmentPortRPCOutputPlainText() throws Exception {
107-
test.wsdl.attachments.Pt1 binding;
108-
try {
109-
AttachmentLocator loc = new AttachmentLocator();
110-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
111-
} catch (javax.xml.rpc.ServiceException jre) {
112-
if (jre.getLinkedCause() != null)
113-
jre.getLinkedCause().printStackTrace();
114-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
115-
}
116-
assertTrue("binding is null", binding != null);
117-
118-
// Test operation
119-
java.lang.String value = null;
120-
value = binding.outputPlainText();
121-
// TBD - validate results
122-
assertEquals(value, "OutputPlainText");
66+
public void testOutputPlainText() throws Exception {
67+
assertEquals("OutputPlainText", getBinding().outputPlainText());
12368
}
12469

125-
public void test6AttachmentPortRPCInputMimeMultipart() throws Exception {
126-
test.wsdl.attachments.Pt1 binding;
127-
try {
128-
AttachmentLocator loc = new AttachmentLocator();
129-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
130-
} catch (javax.xml.rpc.ServiceException jre) {
131-
if (jre.getLinkedCause() != null)
132-
jre.getLinkedCause().printStackTrace();
133-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
134-
}
135-
assertTrue("binding is null", binding != null);
136-
137-
// Test operation
138-
binding.inputMimeMultipart(createMimeMultipart("InputMimeMultipart"));
70+
public void testInputMimeMultipart() throws Exception {
71+
getBinding().inputMimeMultipart(createMimeMultipart("InputMimeMultipart"));
13972
// TBD - validate results
14073
}
14174

142-
public void test7AttachmentPortRPCInoutMimeMultipart() throws Exception {
143-
test.wsdl.attachments.Pt1 binding;
144-
try {
145-
AttachmentLocator loc = new AttachmentLocator();
146-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
147-
} catch (javax.xml.rpc.ServiceException jre) {
148-
if (jre.getLinkedCause() != null)
149-
jre.getLinkedCause().printStackTrace();
150-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
151-
}
152-
assertTrue("binding is null", binding != null);
153-
154-
// Test operation
155-
javax.mail.internet.MimeMultipart value = null;
156-
value = binding.inoutMimeMultipart(createMimeMultipart("InoutMimeMultipart"));
75+
public void testInoutMimeMultipart() throws Exception {
76+
MimeMultipart value = getBinding().inoutMimeMultipart(createMimeMultipart("InoutMimeMultipart"));
15777
// TBD - validate results
15878
}
15979

160-
public void test8AttachmentPortRPCEchoMimeMultipart() throws Exception {
161-
test.wsdl.attachments.Pt1 binding;
162-
try {
163-
AttachmentLocator loc = new AttachmentLocator();
164-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
165-
} catch (javax.xml.rpc.ServiceException jre) {
166-
if (jre.getLinkedCause() != null)
167-
jre.getLinkedCause().printStackTrace();
168-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
169-
}
170-
assertTrue("binding is null", binding != null);
171-
172-
// Test operation
173-
javax.mail.internet.MimeMultipart value = null;
174-
value = binding.echoMimeMultipart(createMimeMultipart("EchoMimeMultipart"));
80+
public void testEchoMimeMultipart() throws Exception {
81+
MimeMultipart value = getBinding().echoMimeMultipart(createMimeMultipart("EchoMimeMultipart"));
17582
// TBD - validate results
17683
}
17784

178-
public void test9AttachmentPortRPCOutputMimeMultipart() throws Exception {
179-
test.wsdl.attachments.Pt1 binding;
180-
try {
181-
AttachmentLocator loc = new AttachmentLocator();
182-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
183-
} catch (javax.xml.rpc.ServiceException jre) {
184-
if (jre.getLinkedCause() != null)
185-
jre.getLinkedCause().printStackTrace();
186-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
187-
}
188-
assertTrue("binding is null", binding != null);
189-
190-
// Test operation
191-
javax.mail.internet.MimeMultipart value = null;
192-
value = binding.outputMimeMultipart();
85+
public void testOutputMimeMultipart() throws Exception {
86+
MimeMultipart value = getBinding().outputMimeMultipart();
19387
// TBD - validate results
19488
}
19589

196-
public void test10AttachmentPortRPCEchoAttachment() throws Exception {
197-
test.wsdl.attachments.Pt1 binding;
198-
try {
199-
AttachmentLocator loc = new AttachmentLocator();
200-
binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress()));
201-
}
202-
catch (javax.xml.rpc.ServiceException jre) {
203-
if(jre.getLinkedCause()!=null)
204-
jre.getLinkedCause().printStackTrace();
205-
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
206-
}
207-
assertTrue("binding is null", binding != null);
208-
209-
// Test operation
210-
org.apache.axis.attachments.OctetStream input = new org.apache.axis.attachments.OctetStream("EchoAttachment".getBytes());
211-
org.apache.axis.attachments.OctetStream output = null;
212-
output = binding.echoAttachment(input);
213-
// TBD - validate results
90+
public void testEchoAttachment() throws Exception {
91+
OctetStream input = new OctetStream("EchoAttachment".getBytes());
92+
OctetStream output = getBinding().echoAttachment(input);
21493
assertTrue(Arrays.equals(input.getBytes(), output.getBytes()));
21594
}
21695
}

0 commit comments

Comments
 (0)