📄 round4xsdtesttestcase.java
字号:
/** * Round4XSDTestTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */package test.wsdl.interop4.groupi;import java.net.URL;import java.util.Arrays;import java.util.TimeZone;public class Round4XSDTestTestCase extends junit.framework.TestCase { public static URL url = null; public static void main(String[] args) throws Exception { if (args.length == 1) { url = new URL(args[0]); } else { url = new URL(new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoapAddress()); } junit.textui.TestRunner.run(new junit.framework.TestSuite(Round4XSDTestTestCase.class)); } // main public Round4XSDTestTestCase(java.lang.String name) throws Exception { super(name); if (url == null) { url = new URL(new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoapAddress()); } } public void test1Round4XSDTestSoapEchoVoid() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { jre.printStackTrace(); if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { binding.echoVoid(); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test2Round4XSDTestSoapEchoInteger() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { int value = binding.echoInteger(1500); assertEquals(value, 1500); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test3Round4XSDTestSoapEchoFloat() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { float value = binding.echoFloat(1500); assertEquals(1500, value, 0.001F); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test4Round4XSDTestSoapEchoString() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { java.lang.String value = null; value = binding.echoString(new java.lang.String("Hello World")); assertEquals("Hello World", value); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test5Round4XSDTestSoapEchoBase64() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { byte[] input = new byte[] {0xC, 0xA, 0xF, 0xE, 0xB, 0xA, 0xB, 0xE}; byte[] value = null; value = binding.echoBase64(input); assertTrue("Array values do not match", Arrays.equals(input, value)); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test6Round4XSDTestSoapEchoDate() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { java.util.Calendar input = java.util.Calendar.getInstance(); input.setTimeZone(TimeZone.getTimeZone("GMT")); java.util.Calendar value = null; value = binding.echoDate(input); value.setTimeZone(TimeZone.getTimeZone("GMT")); assertEquals(input, value); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test7Round4XSDTestSoapEchoComplexType() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { test.wsdl.interop4.groupi.xsd.SOAPComplexType input = new test.wsdl.interop4.groupi.xsd.SOAPComplexType(); input.setVarFloat(1024); input.setVarInt(2048); input.setVarString("Hello World"); test.wsdl.interop4.groupi.xsd.SOAPComplexType value = binding.echoComplexType(input); assertEquals(input, value); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test8Round4XSDTestSoapEchoIntegerMultiOccurs() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { test.wsdl.interop4.groupi.ArrayOfInt input = new test.wsdl.interop4.groupi.ArrayOfInt(); int[] input2 = new int[3]; input2[0] = 512; input2[1] = 1024; input2[2] = 2048; input.set_int(input2); int[] value = null; value = binding.echoIntegerMultiOccurs(input); assertEquals(input2.length, value.length); for(int i=0;i<input2.length;i++) { assertEquals("EchoIntegerMultiOccurs: Array values don't match", input2[i], value[i]); } assertTrue("Array values don't match", Arrays.equals(input2, value)); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test9Round4XSDTestSoapEchoFloatMultiOccurs() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { test.wsdl.interop4.groupi.ArrayOfFloat input = new test.wsdl.interop4.groupi.ArrayOfFloat(); float[] input2 = new float[3]; input2[0] = 512; input2[1] = 1024; input2[2] = 2048; input.set_float(input2); float[] value = null; value = binding.echoFloatMultiOccurs(input); assertTrue("Array values don't match", Arrays.equals(input2, value)); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test10Round4XSDTestSoapEchoStringMultiOccurs() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { test.wsdl.interop4.groupi.ArrayOfString input = new test.wsdl.interop4.groupi.ArrayOfString(); String[] input2 = new String[3]; input2[0] = "512"; input2[1] = "1024"; input2[2] = "2048"; input.setString(input2); java.lang.String[] value = null; value = binding.echoStringMultiOccurs(input); assertTrue("Array values don't match", Arrays.equals(input2, value)); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test11Round4XSDTestSoapEchoComplexTypeMultiOccurs() { test.wsdl.interop4.groupi.Round4XSDTestSoap binding; try { binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { test.wsdl.interop4.groupi.xsd.ArrayOfSOAPComplexType input = new test.wsdl.interop4.groupi.xsd.ArrayOfSOAPComplexType(); input.setSOAPComplexType(new test.wsdl.interop4.groupi.xsd.SOAPComplexType[1]); test.wsdl.interop4.groupi.xsd.SOAPComplexType input2 = new test.wsdl.interop4.groupi.xsd.SOAPComplexType(); input2.setVarFloat(1024); input2.setVarInt(2048); input2.setVarString("Hello World"); input.setSOAPComplexType(0,input2); test.wsdl.interop4.groupi.xsd.SOAPComplexType[] value = null; value = binding.echoComplexTypeMultiOccurs(input); assertTrue("Array values don't match", Arrays.equals(input.getSOAPComplexType(), value)); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -