1 package test.wsdl.interop3.import3; 2 3 4 import test.wsdl.interop3.import3.xsd.SOAPStruct; 5 6 import java.net.URL ; 7 8 27 28 public class Import3TestCase extends junit.framework.TestCase { 29 public static URL url; 30 31 public Import3TestCase(String name) { 32 super(name); 33 } 34 35 public void testStep3EchoStruct() { 36 SoapInteropImport3PortType binding; 37 try { 38 if (url == null) { 39 binding = new Import3Locator().getSoapInteropImport3Port(); 40 } else { 41 binding = new Import3Locator().getSoapInteropImport3Port(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 } 58 catch (java.rmi.RemoteException re) { 59 throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); 60 } 61 } 62 63 public void testStep3EchoStructArray() { 64 SoapInteropImport3PortType binding; 65 try { 66 if (url == null) { 67 binding = new Import3Locator().getSoapInteropImport3Port(); 68 } else { 69 binding = new Import3Locator().getSoapInteropImport3Port(url); 70 } 71 } 72 catch (javax.xml.rpc.ServiceException jre) { 73 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 74 } 75 assertTrue("binding is null", binding != null); 76 77 try { 78 SOAPStruct[] value = null; 79 value = binding.echoStructArray(new SOAPStruct[0]); 80 } 81 catch (java.rmi.RemoteException re) { 82 throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); 83 } 84 } 85 86 public static void main(String [] args) { 87 if (args.length == 1) { 88 try { 89 url = new URL (args[0]); 90 } catch (Exception e) { 91 } 92 } 93 94 junit.textui.TestRunner.run(new junit.framework.TestSuite(Import3TestCase.class)); 95 } 97 } 98 99 | Popular Tags |