1 16 17 23 24 package test.wsdl.interop3.groupE.client; 25 26 import junit.framework.AssertionFailedError; 27 28 import java.net.URL ; 29 30 public class InteropTestListServiceTestCase extends junit.framework.TestCase { 31 public static URL url; 32 33 public InteropTestListServiceTestCase(String name) { 34 super(name); 35 } 36 37 public void testInteropTestListEchoLinkedList() { 38 InteropTestList binding; 39 try { 40 if (url == null) { 41 binding = new InteropTestListServiceLocator().getInteropTestList(); 42 } else { 43 binding = new InteropTestListServiceLocator().getInteropTestList(url); 44 } 45 } catch (javax.xml.rpc.ServiceException jre) { 46 throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 47 } 48 assertTrue("binding is null", binding != null); 49 50 try { 51 List node1 = new List(); 52 node1.setVarInt(1); 53 node1.setVarString("last"); 54 List node2 = new List(); 55 node2.setVarInt(2); 56 node2.setVarString("middle"); 57 node2.setChild(node1); 58 List list = new List(); 59 list.setVarInt(3); 60 list.setVarString("first"); 61 list.setChild(node2); 62 63 List value = binding.echoLinkedList(list); 64 List vnode2 = value.getChild(); 65 List vnode1 = null; 66 if (vnode2 != null) { 67 vnode1 = vnode2.getChild(); 68 } 69 70 if (value.getVarInt() != list.getVarInt() || 71 !value.getVarString().equals(list.getVarString()) || 72 vnode2 == null || 73 vnode2.getVarInt() != node2.getVarInt() || 74 !vnode2.getVarString().equals(node2.getVarString()) || 75 vnode1 == null || 76 vnode1.getVarInt() != node1.getVarInt() || 77 !vnode1.getVarString().equals(node1.getVarString()) || 78 vnode1.getChild() != null) { 79 throw new AssertionFailedError("List echo failed"); 80 } 81 } 82 catch (java.rmi.RemoteException re) { 83 throw new AssertionFailedError("Remote Exception caught: " + re); 84 } 85 } 86 87 } 88 89 | Popular Tags |