1 package test.wsdl.interop3.import2; 2 3 import test.wsdl.interop3.import2.definitions.SoapInteropImport2PortType; 4 import test.wsdl.interop3.import2.xsd.SOAPStruct; 5 6 import java.net.URL ; 7 8 27 28 public class Import2TestCase extends junit.framework.TestCase { 29 public static URL url; 30 31 public Import2TestCase(String name) { 32 super(name); 33 } 34 35 public void testStep3() { 36 SoapInteropImport2PortType binding; 37 try { 38 if (url == null) { 39 binding = new Import2Locator().getSoapInteropImport2Port(); 40 } else { 41 binding = new Import2Locator().getSoapInteropImport2Port(url); 42 } 43 } 44 catch (javax.xml.rpc.ServiceException jre) { 45 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 46 } 47 assertTrue("binding is null", binding != null); 48 49 try { 50 SOAPStruct value = new SOAPStruct(); 51 value.setVarString("import2 string"); 52 value.setVarInt(5); 53 value.setVarFloat(4.5F); 54 SOAPStruct result = binding.echoStruct(value); 55 assertEquals("String members didn't match", value.getVarString(), result.getVarString()); 56 assertEquals("int members didn't match", value.getVarInt(), result.getVarInt()); 57 } 59 catch (java.rmi.RemoteException re) { 60 throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); 61 } 62 } 63 64 65 85 86 145 165 166 public static void main(String [] args) { 167 if (args.length == 1) { 168 try { 169 url = new URL (args[0]); 170 } catch (Exception e) { 171 } 172 } 173 174 junit.textui.TestRunner.run(new junit.framework.TestSuite(Import2TestCase.class)); 175 } 177 } 178 179 | Popular Tags |