1 package test.wsdl.interop3.compound1; 2 3 import test.wsdl.interop3.compound1.xsd.Document; 4 import test.wsdl.interop3.compound1.xsd.Person; 5 6 import java.net.URL ; 7 8 27 28 public class Compound1TestCase extends junit.framework.TestCase { 29 public static URL url; 30 31 public Compound1TestCase(String name) { 32 super(name); 33 } 34 35 protected void setUp() throws Exception { 36 } 37 38 public void testStep3() { 39 SoapInteropCompound1PortType binding; 40 try { 41 if (url != null) { 42 binding = new Compound1Locator().getSoapInteropCompound1Port(url); 43 } else { 44 binding = new Compound1Locator().getSoapInteropCompound1Port(); 45 } 46 } 47 catch (javax.xml.rpc.ServiceException jre) { 48 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 49 } 50 assertTrue("binding is null", binding != null); 51 52 try { 53 Document doc = new Document(); 54 doc.setValue("some value"); 55 doc.setID("myID"); 56 Document newDoc = binding.echoDocument(doc); 57 58 assertEquals("Documents didn't match!", newDoc, doc); 59 60 Person person = new Person(); 61 person.setAge(33); 62 person.setMale(true); 63 person.setName("Frodo"); 64 person.setID(2.345F); 65 Person newPerson = binding.echoPerson(person); 66 67 assertEquals("Returned Person didn't match!", newPerson, person); 68 } 69 catch (java.rmi.RemoteException re) { 70 throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); 71 } 72 } 73 74 140 141 142 public static void main(String [] args) { 143 if (args.length == 1) { 144 try { 145 url = new URL (args[0]); 146 } catch (Exception e) { 147 } 148 } 149 150 junit.textui.TestRunner.run(new junit.framework.TestSuite(Compound1TestCase.class)); 151 } } 153 154 | Popular Tags |