KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > extension > PlanWSTestCase


1 /**
2  * PlanWSTestCase.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis WSDL2Java emitter.
6  */

7
8 package test.wsdl.extension;
9
10 public class PlanWSTestCase extends junit.framework.TestCase {
11     public PlanWSTestCase(java.lang.String JavaDoc name) {
12         super(name);
13     }
14
15     public void testPlanWSSoapWSDL() throws Exception JavaDoc {
16         javax.xml.rpc.ServiceFactory JavaDoc serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
17         java.net.URL JavaDoc url = new java.net.URL JavaDoc(new test.wsdl.extension.PlanWSLocator().getPlanWSSoapAddress() + "?WSDL");
18         javax.xml.rpc.Service JavaDoc service = serviceFactory.createService(url, new test.wsdl.extension.PlanWSLocator().getServiceName());
19         assertTrue(service != null);
20     }
21
22     public void test1PlanWSSoapGetPlan() throws Exception JavaDoc {
23         test.wsdl.extension.PlanWSSoapStub binding;
24         try {
25             binding = (test.wsdl.extension.PlanWSSoapStub)
26                           new test.wsdl.extension.PlanWSLocator().getPlanWSSoap();
27         }
28         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
29             if(jre.getLinkedCause()!=null)
30                 jre.getLinkedCause().printStackTrace();
31             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
32         }
33         assertNotNull("binding is null", binding);
34
35         // Time out after a minute
36
binding.setTimeout(60000);
37
38         // Test operation
39
test.wsdl.extension.Plan value = null;
40         value = binding.getPlan();
41         // TBD - validate results
42

43         assertEquals(value.getDisposition().getCode(),"CODE #1");
44         assertEquals(value.getDisposition().getDescription(),"CODE #1 Description");
45     }
46
47 }
48
Popular Tags