1 22 package org.jboss.test.webservice.jbws720; 23 24 import javax.naming.InitialContext ; 25 import javax.xml.rpc.Service ; 26 import javax.xml.soap.SOAPElement ; 27 import javax.xml.soap.SOAPFactory ; 28 29 import junit.framework.Test; 30 31 import org.jboss.test.webservice.WebserviceTestBase; 32 33 40 public class JBWS720TestCase extends WebserviceTestBase 41 { 42 private static TestEndpoint port; 43 44 public JBWS720TestCase(String name) 45 { 46 super(name); 47 } 48 49 50 public static Test suite() throws Exception 51 { 52 return getDeploySetup(JBWS720TestCase.class, "ws4ee-jbws720.war, ws4ee-jbws720-client.jar"); 53 } 54 55 public void setUp() throws Exception 56 { 57 super.setUp(); 58 if (port == null) 59 { 60 InitialContext iniCtx = getClientContext(); 61 Service service = (Service )iniCtx.lookup("java:comp/env/service/TestService"); 62 port = (TestEndpoint)service.getPort(TestEndpoint.class); 63 } 64 } 65 66 public void testLangEmptyAny() throws Exception 67 { 68 GetProperty inObj = new GetProperty(); 69 inObj.setStrElement("someElement"); 70 inObj.setStrAttr("someAttr"); 71 inObj.setLang("en"); 72 inObj.set_any(new SOAPElement [] {}); 73 74 GetPropertyResponse outObj = port.getProperty(inObj); 75 assertEquals(inObj.toString(), outObj.getResult()); 76 } 77 78 public void testEmptyLangEmptyAny() throws Exception 79 { 80 GetProperty inObj = new GetProperty(); 81 inObj.setStrElement("someElement"); 82 inObj.setStrAttr("someAttr"); 83 inObj.set_any(new SOAPElement [] {}); 84 85 GetPropertyResponse outObj = port.getProperty(inObj); 86 assertEquals(inObj.toString(), outObj.getResult()); 87 } 88 89 public void testLangAnyWithNamespace() throws Exception 90 { 91 SOAPFactory factory = SOAPFactory.newInstance(); 92 93 GetProperty inObj = new GetProperty(); 94 inObj.setStrElement("someElement"); 95 inObj.setStrAttr("someAttr"); 96 inObj.setLang("en"); 97 98 SOAPElement el1 = factory.createElement("el1", "nsany", "http://somens"); 100 SOAPElement el2 = factory.createElement("el2", "nsany", "http://somens"); 101 inObj.set_any(new SOAPElement [] { el1, el2 }); 102 103 GetPropertyResponse outObj = port.getProperty(inObj); 104 assertEquals(inObj.toString(), outObj.getResult()); 105 } 106 107 public void testLangAnyWithoutNamespace() throws Exception 108 { 109 SOAPFactory factory = SOAPFactory.newInstance(); 110 111 GetProperty inObj = new GetProperty(); 112 inObj.setStrElement("someElement"); 113 inObj.setStrAttr("someAttr"); 114 inObj.setLang("en"); 115 116 SOAPElement el1 = factory.createElement("el1"); 118 SOAPElement el2 = factory.createElement("el2"); 119 inObj.set_any(new SOAPElement [] { el1, el2 }); 120 121 GetPropertyResponse outObj = port.getProperty(inObj); 122 assertEquals(inObj.toString(), outObj.getResult()); 123 } 124 125 public void testAllNull() throws Exception 126 { 127 GetProperty inObj = new GetProperty(); 128 129 GetPropertyResponse outObj = port.getProperty(inObj); 130 assertEquals(inObj.toString(), outObj.getResult()); 131 } 132 } 133 | Popular Tags |