You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2008/05/03 04:23:19 UTC
svn commit: r652968 [2/3] - in
/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws:
anytype/tests/ catalog/ client/ client/dispatch/ client/proxy/ description/
dispatch/ nonanonymous/complextype/ provider/ proxy/ rpclit/...
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java Fri May 2 19:23:18 2008
@@ -119,7 +119,7 @@
// Dispatch
TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
- SOAPMessage response = dispatch.invoke(request);
+ SOAPMessage response = dispatch.invoke(request);
// Check for valid content description
assertNotNull(response.getContentDescription());
@@ -132,6 +132,25 @@
// Print out the response
TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
+
+
+ // Try a second time
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ response = dispatch.invoke(request);
+
+ // Check for valid content description
+ assertNotNull(response.getContentDescription());
+ assertEquals(SoapMessageProvider.XML_RESPONSE, response.getContentDescription());
+
+ // Check assertions and get the data element
+ dataElement = assertResponseXML(response, SoapMessageProvider.XML_RESPONSE);
+
+ assertTrue(countAttachments(response) == 0);
+
+ // Print out the response
+ TestLogger.logger.debug(">> Response [" + response.toString() + "]");
}catch(Exception e){
e.printStackTrace();
@@ -172,6 +191,21 @@
// Print out the response
TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+ // Try a second time
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ response = dispatch.invoke(request);
+
+ // Check assertions
+ assertTrue(response !=null);
+ assertTrue(response.getSOAPBody() != null);
+ assertTrue(response.getSOAPBody().getFirstChild() == null); // There should be nothing in the body
+
+ assertTrue(countAttachments(response) == 0);
+
+ // Print out the response
+ TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
}catch(Exception e){
e.printStackTrace();
fail("Caught exception " + e);
@@ -216,6 +250,27 @@
assertTrue(de.getValue().equals("sample detail"));
assertTrue(fault.getFaultActor().equals("sample actor"));
}
+
+ // Try a second time
+ try {
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ SOAPMessage response = dispatch.invoke(request);
+ assertTrue("Expected failure", false);
+ } catch (SOAPFaultException e) {
+ // Okay
+ SOAPFault fault = e.getFault();
+ assertTrue(fault != null);
+ assertTrue(fault.getFaultString().equals("sample fault"));
+ QName expectedFaultCode = new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Client");
+ assertTrue(fault.getFaultCodeAsQName().equals(expectedFaultCode));
+ assertTrue(fault.getDetail() != null);
+ DetailEntry de = (DetailEntry) fault.getDetail().getDetailEntries().next();
+ assertTrue(de != null);
+ assertTrue(de.getLocalName().equals("detailEntry"));
+ assertTrue(de.getValue().equals("sample detail"));
+ assertTrue(fault.getFaultActor().equals("sample actor"));
+ }
}
/**
@@ -246,9 +301,23 @@
SOAPFault fault = e.getFault();
assertTrue(fault != null);
assertTrue(fault.getFaultString().equals("A WSE was thrown"));
- }
+ }
+
+ // Try a second time
+ try {
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ SOAPMessage response = dispatch.invoke(request);
+ assertTrue("Expected failure", false);
+ } catch (SOAPFaultException e) {
+ // Okay...SOAPFaultException should be thrown
+ SOAPFault fault = e.getFault();
+ assertTrue(fault != null);
+ assertTrue(fault.getFaultString().equals("A WSE was thrown"));
+ }
}
+
/**
* Sends an SOAPMessage containing xml data and raw attachments to the web service.
* Receives a response containing xml data and the same raw attachments.
@@ -294,6 +363,28 @@
// Print out the response
TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
+ // Try a second time
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ response = dispatch.invoke(request);
+
+ // Check assertions and get the data element
+ dataElement = assertResponseXML(response, SoapMessageProvider.XML_ATTACHMENT_RESPONSE);
+ assertTrue(countAttachments(response) == 1);
+
+ // Get the Attachment
+ attachmentPart = (AttachmentPart) response.getAttachments().next();
+
+ // Check the attachment
+ contentSS = (StreamSource) attachmentPart.getContent();
+ content = SoapMessageProvider.getAsString(contentSS);
+ assertTrue(content != null);
+ assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
+
+ // Print out the response
+ TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
}catch(Exception e){
e.printStackTrace();
fail("Caught exception " + e);
@@ -346,6 +437,28 @@
// Print out the response
TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
+ // Try a second time
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ response = dispatch.invoke(request);
+
+ // Check assertions and get the data element
+ dataElement = assertResponseXML(response, SoapMessageProvider.XML_MTOM_RESPONSE);
+ assertTrue(countAttachments(response) == 1);
+
+ // Get the Attachment
+ attachmentPart = (AttachmentPart) response.getAttachments().next();
+
+ // Check the attachment
+ contentSS = (StreamSource) attachmentPart.getContent();
+ content = SoapMessageProvider.getAsString(contentSS);
+ assertTrue(content != null);
+ assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
+
+ // Print out the response
+ TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
}catch(Exception e){
e.printStackTrace();
fail("Caught exception " + e);
@@ -394,6 +507,30 @@
// Print out the response
TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
+
+ // Try a second time
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ response = dispatch.invoke(request);
+
+ // Check assertions and get the data element
+ dataElement = assertResponseXML(response, SoapMessageProvider.XML_SWAREF_RESPONSE);
+ assertTrue(countAttachments(response) == 1);
+
+ // Get the Attachment
+ attachmentPart = (AttachmentPart) response.getAttachments().next();
+
+ // Check the attachment
+ contentSS = (StreamSource) attachmentPart.getContent();
+ content = SoapMessageProvider.getAsString(contentSS);
+ assertTrue(content != null);
+ assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
+ assertEquals(SoapMessageProvider.ID, attachmentPart.getContentId());
+
+ // Print out the response
+ TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
}catch(Exception e){
e.printStackTrace();
fail("Caught exception " + e);
@@ -415,6 +552,7 @@
}catch(Exception e){
e.printStackTrace();
}
+
}
/**
@@ -471,6 +609,18 @@
// Print out the response
TestLogger.logger.debug(">> Response [" + response + "]");
+
+
+ // Try a second time
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ response = dispatch.invoke(request);
+
+ // Check assertions and get the data element
+ assertTrue(response.contains(SoapMessageProvider.XML_CHECKHEADERS_RESPONSE));
+
+ // Print out the response
+ TestLogger.logger.debug(">> Response [" + response + "]");
}catch(Exception e){
e.printStackTrace();
@@ -551,6 +701,39 @@
// Print out the response
TestLogger.logger.debug(">> Response [" + response + "]");
+
+
+
+
+ // Try a second time
+ // Dispatch
+ TestLogger.logger.debug(">> Invoking SOAPMessageProviderDispatch");
+ response = dispatch.invoke(request);
+
+ // Check assertions and get the data element
+ assertTrue(response.contains(SoapMessageProvider.XML_CHECKHEADERS_RESPONSE));
+
+ // Check outbound headers
+ responseContext = dispatch.getResponseContext();
+ assertTrue(responseContext != null);
+ responseHeaders = (Map<QName, List<String>>)
+ responseContext.get(Constants.JAXWS_INBOUND_SOAP_HEADERS);
+ assertTrue(responseHeaders != null);
+ assertTrue(responseHeaders.size() >= 2);
+ batHeaders = responseHeaders.get(SoapMessageProvider.BAT_HEADER_QNAME);
+ assertTrue(batHeaders != null && batHeaders.size() == 1);
+ assertTrue(batHeaders.get(0).contains(SoapMessageProvider.BAT_HEADER_CONTENT));
+ barHeaders =responseHeaders.get(SoapMessageProvider.BAR_HEADER_QNAME);
+ assertTrue(barHeaders != null && barHeaders.size() == 2);
+ assertTrue(barHeaders.get(0).contains(SoapMessageProvider.BAR_HEADER_CONTENT1));
+ assertTrue(barHeaders.get(1).contains(SoapMessageProvider.BAR_HEADER_CONTENT2));
+
+ // There should be no foo header in the response
+ fooHeaders = responseHeaders.get(SoapMessageProvider.FOO_HEADER_QNAME);
+ assertTrue(fooHeaders == null);
+
+ // Print out the response
+ TestLogger.logger.debug(">> Response [" + response + "]");
}catch(Exception e){
e.printStackTrace();
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java Fri May 2 19:23:18 2008
@@ -48,21 +48,29 @@
public void testProviderSource(){
try{
- String resourceDir = new File(providerResourceDir, xmlDir).getAbsolutePath();
- String fileName = resourceDir+File.separator+"web.xml";
-
- File file = new File(fileName);
- InputStream inputStream = new FileInputStream(file);
- StreamSource xmlStreamSource = new StreamSource(inputStream);
-
- Service svc = Service.create(serviceName);
- svc.addPort(portName,null, endpointUrl);
- Dispatch<Source> dispatch = svc.createDispatch(portName, Source.class, null);
+ String resourceDir = new File(providerResourceDir, xmlDir).getAbsolutePath();
+ String fileName = resourceDir+File.separator+"web.xml";
+
+ File file = new File(fileName);
+ InputStream inputStream = new FileInputStream(file);
+ StreamSource xmlStreamSource = new StreamSource(inputStream);
+
+ Service svc = Service.create(serviceName);
+ svc.addPort(portName,null, endpointUrl);
+ Dispatch<Source> dispatch = svc.createDispatch(portName, Source.class, null);
+ TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
+ Source response = dispatch.invoke(xmlStreamSource);
+
+ TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
+ // Try again to verify
TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
- Source response = dispatch.invoke(xmlStreamSource);
+ inputStream = new FileInputStream(file);
+ xmlStreamSource = new StreamSource(inputStream);
+ response = dispatch.invoke(xmlStreamSource);
TestLogger.logger.debug(">> Response [" + response.toString() + "]");
-
+
}catch(Exception e){
e.printStackTrace();
fail("Caught exception " + e);
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java Fri May 2 19:23:18 2008
@@ -104,6 +104,13 @@
String response = getString(responseSource);
assertTrue(response.contains(request));
+
+ // Try again to verify
+ requestSource = getSource(request);
+ responseSource = dispatch.invoke(requestSource);
+ response = getString(responseSource);
+
+ assertTrue(response.contains(request));
}
public void testEmptyString() throws Exception {
@@ -121,7 +128,15 @@
// the nothing is echo'ed
assertTrue(response == null);
- //assertTrue(request.equals(response));
+ // Try again to verify
+ requestSource = getSource(request);
+ responseSource = dispatch.invoke(requestSource);
+ response = getString(responseSource);
+
+ // The current belief is that this should return a null indicating
+ // the nothing is echo'ed
+ assertTrue(response == null);
+
}
public void testNullSource() throws Exception {
@@ -136,6 +151,15 @@
// The current belief is that this should return a null indicating
// the nothing is echo'ed
assertTrue(response == null);
+
+
+ // Try again to verify
+ responseSource = dispatch.invoke(null);
+ response = getString(responseSource);
+
+ // The current belief is that this should return a null indicating
+ // the nothing is echo'ed
+ assertTrue(response == null);
}
public void testEmptySource() throws Exception {
@@ -150,6 +174,15 @@
// The current belief is that this should return a null indicating
// the nothing is echo'ed
assertTrue(response == null);
+
+
+ // Try again to verify
+ responseSource = dispatch.invoke(new StreamSource());
+ response = getString(responseSource);
+
+ // The current belief is that this should return a null indicating
+ // the nothing is echo'ed
+ assertTrue(response == null);
}
public void testNonNullString() throws Exception {
@@ -166,6 +199,16 @@
// The current implementation does not send the mixedContent over the wire, so the
// expectation is that the echo'd response is null
assertTrue(response == null);
+
+
+ // Try again to verify
+ requestSource = getSource(request);
+ responseSource = dispatch.invoke(requestSource);
+ response = getString(responseSource);
+
+ // The current implementation does not send the mixedContent over the wire, so the
+ // expectation is that the echo'd response is null
+ assertTrue(response == null);
}
public void testCommentString() throws Exception {
@@ -181,6 +224,15 @@
// The current implementation does not send the comment over the wire, so the
// expectation is that the echo'd response is null
assertTrue(response == null);
+
+
+ // Try again to verify
+ requestSource = getSource(request);
+ responseSource = dispatch.invoke(requestSource);
+ response = getString(responseSource);
+ // The current implementation does not send the comment over the wire, so the
+ // expectation is that the echo'd response is null
+ assertTrue(response == null);
}
public void testTwoElementsString() throws Exception {
@@ -197,6 +249,16 @@
// The current implementatin only sends the first element
// So the echo'd response is just the first one.
assertTrue(response.contains("<a>hello</a>"));
+
+
+ // Try again to verify
+ requestSource = getSource(request);
+ responseSource = dispatch.invoke(requestSource);
+ response = getString(responseSource);
+
+ // The current implementatin only sends the first element
+ // So the echo'd response is just the first one.
+ assertTrue(response.contains("<a>hello</a>"));
}
public void testTwoElementsAndMixedContentString() throws Exception {
@@ -212,6 +274,15 @@
// The current implementation only sends the first element.
// The mixed content (mixed1) interferes and thus nothing is sent.
assertTrue(response == null);
+
+
+ // Try again to verify
+ requestSource = getSource(request);
+ responseSource = dispatch.invoke(requestSource);
+ response = getString(responseSource);
+ // The current implementation only sends the first element.
+ // The mixed content (mixed1) interferes and thus nothing is sent.
+ assertTrue(response == null);
}
public void testException() throws Exception {
@@ -230,25 +301,45 @@
SOAPFault sf = e.getFault();
assertTrue(sf.getFaultString().equals("provider"));
}
+
+ // Try again to verify
+ try {
+ Source requestSource = getSource(request);
+ Source responseSource = dispatch.invoke(requestSource);
+ String response = getString(responseSource);
+ fail("Expected Exception");
+ } catch (SOAPFaultException e) {
+ SOAPFault sf = e.getFault();
+ assertTrue(sf.getFaultString().equals("provider"));
+ }
}
public void testProviderSource(){
try{
- String resourceDir = new File(providerResourceDir, xmlDir).getAbsolutePath();
- String fileName = resourceDir+File.separator+"web.xml";
-
- File file = new File(fileName);
- InputStream inputStream = new FileInputStream(file);
- StreamSource xmlStreamSource = new StreamSource(inputStream);
-
- Service svc = Service.create(serviceName);
- svc.addPort(portName,null, endpointUrl);
- Dispatch<Source> dispatch = svc.createDispatch(portName, Source.class, null);
+ String resourceDir = new File(providerResourceDir, xmlDir).getAbsolutePath();
+ String fileName = resourceDir+File.separator+"web.xml";
+
+ File file = new File(fileName);
+ InputStream inputStream = new FileInputStream(file);
+ StreamSource xmlStreamSource = new StreamSource(inputStream);
+
+ Service svc = Service.create(serviceName);
+ svc.addPort(portName,null, endpointUrl);
+ Dispatch<Source> dispatch = svc.createDispatch(portName, Source.class, null);
TestLogger.logger.debug(">> Invoking Source Provider Dispatch");
- Source response = dispatch.invoke(xmlStreamSource);
+ Source response = dispatch.invoke(xmlStreamSource);
TestLogger.logger.debug(">> Response [" + response.toString() + "]");
-
+
+
+ // Try again to verify
+ inputStream = new FileInputStream(file);
+ xmlStreamSource = new StreamSource(inputStream);
+ TestLogger.logger.debug(">> Invoking Source Provider Dispatch");
+ response = dispatch.invoke(xmlStreamSource);
+
+ TestLogger.logger.debug(">> Response [" + response.toString() + "]");
+
}catch(Exception e){
e.printStackTrace();
fail("Caught exception " + e);
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java Fri May 2 19:23:18 2008
@@ -50,5 +50,11 @@
TestLogger.logger.debug(">> Invoking Dispatch<String> StringMessageProviderService");
String retVal = dispatch.invoke(xmlString);
TestLogger.logger.debug(">> Response [" + retVal + "]");
+
+
+ // Try again to verify
+ TestLogger.logger.debug(">> Invoking Dispatch<String> StringMessageProviderService");
+ retVal = dispatch.invoke(xmlString);
+ TestLogger.logger.debug(">> Response [" + retVal + "]");
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringProviderTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringProviderTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/StringProviderTests.java Fri May 2 19:23:18 2008
@@ -63,6 +63,10 @@
String request = "<invoke>hello world</invoke>";
String response = dispatch.invoke(request);
assertTrue(request.equals(response));
+
+ // Try again to verify
+ response = dispatch.invoke(request);
+ assertTrue(request.equals(response));
}
public void testEmptyString() throws Exception {
@@ -78,7 +82,13 @@
// the nothing is echo'ed
assertTrue(response == null);
- //assertTrue(request.equals(response));
+ // Try again to verify
+ response = dispatch.invoke(request);
+
+ // The current belief is that this should return a null indicating
+ // the nothing is echo'ed
+ assertTrue(response == null);
+
}
public void testNullString() throws Exception {
@@ -93,6 +103,13 @@
// The current belief is that this should return a null indicating
// the nothing is echo'ed
assertTrue(response == null);
+
+ // Try again to verify
+ response = dispatch.invoke(request);
+
+ // The current belief is that this should return a null indicating
+ // the nothing is echo'ed
+ assertTrue(response == null);
}
public void testNonNullString() throws Exception {
@@ -107,6 +124,13 @@
// The current implementation does not send the mixedContent over the wire, so the
// expectation is that the echo'd response is null
assertTrue(response == null);
+
+ // Try again to verifify
+ response = dispatch.invoke(request);
+
+ // The current implementation does not send the mixedContent over the wire, so the
+ // expectation is that the echo'd response is null
+ assertTrue(response == null);
}
public void testCommentString() throws Exception {
@@ -120,6 +144,13 @@
// The current implementation does not send the comment over the wire, so the
// expectation is that the echo'd response is null
assertTrue(response == null);
+
+
+ // Try again to verify
+ response = dispatch.invoke(request);
+ // The current implementation does not send the comment over the wire, so the
+ // expectation is that the echo'd response is null
+ assertTrue(response == null);
}
public void testTwoElementsString() throws Exception {
@@ -134,6 +165,14 @@
// The current implementatin only sends the first element
// So the echo'd response is just the first one.
assertTrue("<a>hello</a>".equals(response));
+
+
+ // Try again to verify
+ response = dispatch.invoke(request);
+
+ // The current implementatin only sends the first element
+ // So the echo'd response is just the first one.
+ assertTrue("<a>hello</a>".equals(response));
}
public void testTwoElementsAndMixedContentString() throws Exception {
@@ -147,6 +186,13 @@
// The current implementation only sends the first element.
// The mixed content (mixed1) interferes and thus nothing is sent.
assertTrue(response == null);
+
+
+ // Try again to verify
+ response = dispatch.invoke(request);
+ // The current implementation only sends the first element.
+ // The mixed content (mixed1) interferes and thus nothing is sent.
+ assertTrue(response == null);
}
public void testException() throws Exception {
@@ -163,5 +209,14 @@
SOAPFault sf = e.getFault();
assertTrue(sf.getFaultString().equals("provider"));
}
+
+ // Try again to verify
+ try {
+ String response = dispatch.invoke(request);
+ fail("Expected Exception");
+ } catch (SOAPFaultException e) {
+ SOAPFault sf = e.getFault();
+ assertTrue(sf.getFaultString().equals("provider"));
+ }
}
}
\ No newline at end of file
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java Fri May 2 19:23:18 2008
@@ -95,6 +95,11 @@
assertTrue(response != null);
assertEquals(response, request);
+ // Try again to verify
+ response = proxy.echoString(request);
+ assertTrue(response != null);
+ assertEquals(response, request);
+
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -111,6 +116,10 @@
String response = proxy.echoString(request);
assertTrue(response == null);
+
+ // Try again to verify
+ response = proxy.echoString(request);
+ assertTrue(response == null);
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -145,6 +154,25 @@
// Check for the package referenced only by an @XmlSeeAlso
assertTrue(observedKey.contains("org.test.stock2"));
}
+
+
+ // Try again to verify
+ JAXBUtilsMonitor.clear();
+ response = proxy.echoString(request);
+ assertTrue(response != null);
+ assertEquals(response, request);
+
+ // Now query the monitor
+ keys = JAXBUtilsMonitor.getPackageKeys();
+ assertTrue(keys != null && keys.size() > 0);
+ for (int i=0; i<keys.size(); i++) {
+ String observedKey = keys.get(i);
+ TestLogger.logger.debug("Observed Key =" + observedKey);
+ // Check for one of the expected (referenced) packages
+ assertTrue(observedKey.contains("org.apache.axis2.jaxws.proxy.gorilla_dlw.data"));
+ // Check for the package referenced only by an @XmlSeeAlso
+ assertTrue(observedKey.contains("org.test.stock2"));
+ }
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -157,6 +185,12 @@
* Testing of StringList (xsd:list of string)
*/
public void testEchoStringList() throws Exception {
+ // Run the test multiple times to verify correct behavior
+ _testEchoStringList();
+ _testEchoStringList();
+ _testEchoStringList();
+ }
+ public void _testEchoStringList() throws Exception {
try{
GorillaInterface proxy = getProxy();
@@ -210,6 +244,13 @@
* SEI is mapped to String[] instead of List<String>
*/
public void testEchoStringListAlt() throws Exception {
+
+ // Run the test multiple times to verify correct behavior
+ _testEchoStringListAlt();
+ _testEchoStringListAlt();
+ _testEchoStringListAlt();
+ }
+ public void _testEchoStringListAlt() throws Exception {
try{
GorillaInterface proxy = getProxy();
@@ -257,6 +298,12 @@
* @throws Exception
*/
public void testEchoIndexedStringArray() throws Exception {
+ // Run the test multiple times to verify correct behavior
+ _testEchoIndexedStringArray();
+ _testEchoIndexedStringArray();
+ _testEchoIndexedStringArray();
+ }
+ public void _testEchoIndexedStringArray() throws Exception {
try{
GorillaInterface proxy = getProxy();
@@ -311,6 +358,13 @@
* @throws Exception
*/
public void testEchoStringArray() throws Exception {
+
+ // Run the test multiple times to verify correct behavior
+ _testEchoStringArray();
+ _testEchoStringArray();
+ _testEchoStringArray();
+ }
+ public void _testEchoStringArray() throws Exception {
try{
GorillaInterface proxy = getProxy();
@@ -365,6 +419,13 @@
* @throws Exception
*/
public void testEchoStringArrayAlt() throws Exception {
+
+ // Run the test multiple times to verify correct behavior
+ _testEchoStringArrayAlt();
+ _testEchoStringArrayAlt();
+ _testEchoStringArrayAlt();
+ }
+ public void _testEchoStringArrayAlt() throws Exception {
try{
GorillaInterface proxy = getProxy();
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java Fri May 2 19:23:18 2008
@@ -69,6 +69,12 @@
assertNotNull(response);
TestLogger.logger.debug(">>Response =" + response.getReturnStr());
+
+ // Try again to verify
+ response = proxy.invoke(invokeObj);
+ assertNotNull(response);
+ TestLogger.logger.debug(">>Response =" + response.getReturnStr());
+
TestLogger.logger.debug("-------------------------------------");
}
@@ -86,6 +92,10 @@
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
ReturnType response = proxy.invoke(invokeObj);
assertNull(response);
+
+ // Try again
+ response = proxy.invoke(invokeObj);
+ assertNull(response);
TestLogger.logger.debug("-------------------------------------");
}
@@ -116,6 +126,16 @@
while(!monitor.isDone()){
Thread.sleep(1000);
}
+
+
+ // Try again
+ TestLogger.logger.debug(">> Invoking Proxy Asynchronous Callback");
+ handler = new AsyncCallback();
+ //Invoke operation Asynchronously.
+ monitor = proxy.invokeAsync(invokeObj, handler);
+ while(!monitor.isDone()){
+ Thread.sleep(1000);
+ }
TestLogger.logger.debug("---------------------------------------");
}catch(Exception e){
e.printStackTrace();
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/ProxyTests.java Fri May 2 19:23:18 2008
@@ -101,6 +101,11 @@
String request = null;
String response = dwp.invoke(request);
TestLogger.logger.debug("Proxy Response =" + response);
+
+
+ // Try again
+ response = dwp.invoke(request);
+ TestLogger.logger.debug("Proxy Response =" + response);
TestLogger.logger.debug("---------------------------------------");
}catch(Exception e){
e.printStackTrace();
@@ -127,6 +132,10 @@
TestLogger.logger.debug(">> Invoking Proxy Synchronously");
String response = dwp.invoke(request);
TestLogger.logger.debug("Proxy Response =" + response);
+
+ // Try again
+ response = dwp.invoke(request);
+ TestLogger.logger.debug("Proxy Response =" + response);
TestLogger.logger.debug("---------------------------------------");
}catch(Exception e){
e.printStackTrace();
@@ -154,6 +163,10 @@
TestLogger.logger.debug(">> Invoking Proxy Synchronously");
String response = dwp.invoke(request);
TestLogger.logger.debug("Proxy Response =" + response);
+
+ // Try again
+ response = dwp.invoke(request);
+ TestLogger.logger.debug("Proxy Response =" + response);
TestLogger.logger.debug("---------------------------------------");
}catch(Exception e){
e.printStackTrace();
@@ -182,6 +195,10 @@
TestLogger.logger.debug(">> Invoking Proxy Asynchronous Callback");
AsyncHandler handler = new AsyncCallback();
Future<?> response = dwp.invokeAsync(request, handler);
+
+ // Try again
+ handler = new AsyncCallback();
+ response = dwp.invokeAsync(request, handler);
TestLogger.logger.debug("---------------------------------------");
}catch(Exception e){
e.printStackTrace();
@@ -214,6 +231,17 @@
ReturnType response = asyncResponse.get();
assertNotNull(response);
+
+ // Try again
+ asyncResponse = proxy.invokeAsync(request);
+
+ while (!asyncResponse.isDone()) {
+ TestLogger.logger.debug(">> Async invocation still not complete");
+ Thread.sleep(1000);
+ }
+
+ response = asyncResponse.get();
+ assertNotNull(response);
}
catch(Exception e) {
e.printStackTrace();
@@ -239,6 +267,10 @@
DocLitWrappedProxy dwp = (DocLitWrappedProxy)proxy;
String response = dwp.twoWay(request);
System.out.println("Response =" + response);
+
+ // Try again
+ response = dwp.twoWay(request);
+ System.out.println("Response =" + response);
} catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -274,6 +306,10 @@
AsyncHandler handler = new AsyncCallback();
Future<?> response = dwp.twoWayAsync(request, handler);
+ // Try again
+ handler = new AsyncCallback();
+ response = dwp.twoWayAsync(request, handler);
+
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCLitSWAProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCLitSWAProxyTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCLitSWAProxyTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCLitSWAProxyTests.java Fri May 2 19:23:18 2008
@@ -157,6 +157,39 @@
assertTrue("The inout attachment holder is null", attachmentINOUT_Holder != null);
assertTrue("The inout attachment is null", attachmentINOUT_Holder.value != null);
// Ensure that this is not the same object
+ assertTrue(attachmentINOUT_Holder.value != attachmentINOUT);
+
+ // ------------------
+ // Try again with the same proxy
+ // ------------------
+ request = "This is a not attachment data";
+
+ attachmentIN = "Data for plain text attachment";
+ attachmentINOUT = getImageDH();
+
+ attachmentINOUT_Holder = new Holder<DataHandler>();
+ attachmentINOUT_Holder.value = attachmentINOUT;
+ response_Holder = new Holder<String>();
+ attachmentOUT_Holder = new Holder<String>();
+
+ proxy.echo(request, attachmentIN, attachmentINOUT_Holder, response_Holder,
+ attachmentOUT_Holder);
+
+ assertTrue("Bad Response Holder", response_Holder != null);
+ assertTrue("Response value is null", response_Holder.value != null);
+ assertTrue("Response is not the same as request. Receive="+response_Holder.value,
+ request.equals(response_Holder.value));
+
+ assertTrue("The output attachment holder is null", attachmentOUT_Holder != null);
+ assertTrue("The output attachment is null", attachmentOUT_Holder.value != null);
+ assertTrue("The output attachment is not the same as the input. Received=" +
+ attachmentOUT_Holder.value,
+ attachmentIN.equals(attachmentOUT_Holder.value));
+
+
+ assertTrue("The inout attachment holder is null", attachmentINOUT_Holder != null);
+ assertTrue("The inout attachment is null", attachmentINOUT_Holder.value != null);
+ // Ensure that this is not the same object
assertTrue(attachmentINOUT_Holder.value != attachmentINOUT);
}
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java Fri May 2 19:23:18 2008
@@ -95,6 +95,11 @@
String response = proxy.testSimple(request);
assertTrue(response != null);
assertTrue(response.equals(request));
+
+ // Try a second time
+ response = proxy.testSimple(request);
+ assertTrue(response != null);
+ assertTrue(response.equals(request));
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -115,6 +120,12 @@
assertTrue(response != null);
assertTrue(response.equals(request));
assertTrue(requestParam.value.equals(request));
+
+ // Try a second time
+ response = proxy.testSimpleInOut(requestParam);
+ assertTrue(response != null);
+ assertTrue(response.equals(request));
+ assertTrue(requestParam.value.equals(request));
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -133,6 +144,11 @@
String response = proxy.testSimple2(request1, request2);
assertTrue(response != null);
assertTrue(response.equals("helloworld"));
+
+ // Try a second time
+ response = proxy.testSimple2(request1, request2);
+ assertTrue(response != null);
+ assertTrue(response.equals("helloworld"));
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -152,15 +168,31 @@
assertTrue(response != null);
assertTrue(response.equals("helloworld"));
+ // Try a second time
+ response = proxy.testHeader(request1, request2);
+ assertTrue(response != null);
+ assertTrue(response.equals("helloworld"));
+
}
/**
* Simple test that ensures that a service fault is thrown correctly
*/
public void testFault() throws Exception {
+ RPCLit proxy = getProxy();
+ try{
+ proxy.testFault();
+ fail("Expected RPCFault");
+ } catch(RPCFault rpcFault){
+ assertTrue(rpcFault.getMessage().equals("Throw RPCFault"));
+ assertTrue(rpcFault.getFaultInfo() == 123);
+ } catch(Exception e){
+ e.printStackTrace();
+ fail("Exception received" + e);
+ }
+
+ // Try a second time
try{
- RPCLit proxy = getProxy();
-
proxy.testFault();
fail("Expected RPCFault");
} catch(RPCFault rpcFault){
@@ -176,8 +208,19 @@
* Simple test that ensures that we can echo a string to an rpc/lit web service
*/
public void testForNull() throws Exception {
- try{
- RPCLit proxy = getProxy();
+ RPCLit proxy = getProxy();
+ try{
+ String request = null;
+
+ String response = proxy.testSimple(request);
+ fail("RPC/LIT should throw webserviceException when operation is invoked with null input parameter");
+ }catch(Exception e){
+ assertTrue(e instanceof WebServiceException);
+ TestLogger.logger.debug(e.getMessage());
+ }
+
+ // Try a second time
+ try{
String request = null;
String response = proxy.testSimple(request);
@@ -192,9 +235,18 @@
* Simple test that ensures that we can echo a string to an rpc/lit web service
*/
public void testForNullReturn() throws Exception {
+
+ RPCLit proxy = getProxy();
+ try{
+ String response = proxy.testSimple("returnNull");
+ fail("RPC/LIT should throw webserviceException when operation is invoked with null out parameter");
+ }catch(Exception e){
+ assertTrue(e instanceof WebServiceException);
+ TestLogger.logger.debug(e.getMessage());
+ }
+
+ // Try a second time
try{
- RPCLit proxy = getProxy();
-
String response = proxy.testSimple("returnNull");
fail("RPC/LIT should throw webserviceException when operation is invoked with null out parameter");
}catch(Exception e){
@@ -227,6 +279,22 @@
assertTrue(!response.contains(":simpleOut")); // Make sure simple out is not namespace qualified
assertTrue(response.contains(":testSimpleResponse")); // Make sure response is namespace qualified
assertTrue(response.contains("PAYLOAD WITH XSI:TYPE"));
+
+ // Try a second time
+ response = dispatch.invoke(request);
+
+ assertNotNull("dispatch invoke returned null", response);
+ TestLogger.logger.debug(response);
+
+ // Check to make sure the content is correct
+ assertTrue(!response.contains("soap"));
+ assertTrue(!response.contains("Envelope"));
+ assertTrue(!response.contains("Body"));
+ assertTrue(!response.contains("Fault"));
+ assertTrue(response.contains("simpleOut"));
+ assertTrue(!response.contains(":simpleOut")); // Make sure simple out is not namespace qualified
+ assertTrue(response.contains(":testSimpleResponse")); // Make sure response is namespace qualified
+ assertTrue(response.contains("PAYLOAD WITH XSI:TYPE"));
}
public void testSimple2_DispatchWithoutXSIType() throws Exception {
@@ -255,6 +323,24 @@
assertTrue(!response.contains(":simple2Out"));// Make sure simpleOut is not namespace qualified
assertTrue(response.contains(":testSimple2Response"));
assertTrue(response.contains("HELLOWORLD"));
+
+
+ // Try a second time
+ response = dispatch.invoke(request);
+
+
+ assertNotNull("dispatch invoke returned null", response);
+ TestLogger.logger.debug(response);
+
+ // Check to make sure the content is correct
+ assertTrue(!response.contains("soap"));
+ assertTrue(!response.contains("Envelope"));
+ assertTrue(!response.contains("Body"));
+ assertTrue(!response.contains("Fault"));
+ assertTrue(response.contains("simple2Out"));
+ assertTrue(!response.contains(":simple2Out"));// Make sure simpleOut is not namespace qualified
+ assertTrue(response.contains(":testSimple2Response"));
+ assertTrue(response.contains("HELLOWORLD"));
}
public void testSimple_DispatchWithoutXSIType() throws Exception {
@@ -280,6 +366,24 @@
assertTrue(!response.contains(":simpleOut")); // Make sure simpleOut is not namespace qualified
assertTrue(response.contains(":testSimpleResponse"));
assertTrue(response.contains("PAYLOAD WITHOUT XSI:TYPE"));
+
+
+ // Try a second time
+ response = dispatch.invoke(request);
+
+
+ assertNotNull("dispatch invoke returned null", response);
+ TestLogger.logger.debug(response);
+
+ // Check to make sure the content is correct
+ assertTrue(!response.contains("soap"));
+ assertTrue(!response.contains("Envelope"));
+ assertTrue(!response.contains("Body"));
+ assertTrue(!response.contains("Fault"));
+ assertTrue(response.contains("simpleOut"));
+ assertTrue(!response.contains(":simpleOut")); // Make sure simpleOut is not namespace qualified
+ assertTrue(response.contains(":testSimpleResponse"));
+ assertTrue(response.contains("PAYLOAD WITHOUT XSI:TYPE"));
}
/**
@@ -295,6 +399,13 @@
assertTrue(response.length==2);
assertTrue(response[0].equals("Hello"));
assertTrue(response[1].equals("World"));
+
+ // Try a second time
+ response = proxy.testStringList2(request);
+ assertTrue(response != null);
+ assertTrue(response.length==2);
+ assertTrue(response[0].equals("Hello"));
+ assertTrue(response[1].equals("World"));
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -323,6 +434,22 @@
assertTrue(response.contains("testStringList2Return"));
assertTrue(response.contains("testStringList2Response"));
assertTrue(response.contains("Hello World"));
+
+
+ // Try a second time
+ response = dispatch.invoke(request);
+
+ assertNotNull("dispatch invoke returned null", response);
+ TestLogger.logger.debug(response);
+
+ // Check to make sure the content is correct
+ assertTrue(!response.contains("soap"));
+ assertTrue(!response.contains("Envelope"));
+ assertTrue(!response.contains("Body"));
+ assertTrue(!response.contains("Fault"));
+ assertTrue(response.contains("testStringList2Return"));
+ assertTrue(response.contains("testStringList2Response"));
+ assertTrue(response.contains("Hello World"));
}
/**
* Currently not enabled due to problems with
@@ -347,6 +474,20 @@
assertTrue(qNames.length==2);
assertTrue(qNames[0].equals(RPCLitImpl.qname1));
assertTrue(qNames[1].equals(RPCLitImpl.qname2));
+
+
+ //Try a second time
+ qNames = proxy.testLists(request,
+ new XMLGregorianCalendar[0],
+ new String[0],
+ new BigInteger[0],
+ new Long[0],
+ new Enum[0],
+ new String[0],
+ new ComplexAll());
+ assertTrue(qNames.length==2);
+ assertTrue(qNames[0].equals(RPCLitImpl.qname1));
+ assertTrue(qNames[1].equals(RPCLitImpl.qname2));
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -369,6 +510,12 @@
assertTrue(cals.length == 2);
assertTrue(cals[0].compare(RPCLitImpl.bday) == 0);
assertTrue(cals[1].compare(RPCLitImpl.holiday) == 0);
+
+ // Try a second time
+ cals = proxy.testCalendarList1(request);
+ assertTrue(cals.length == 2);
+ assertTrue(cals[0].compare(RPCLitImpl.bday) == 0);
+ assertTrue(cals[1].compare(RPCLitImpl.holiday) == 0);
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -384,6 +531,12 @@
assertTrue(ints.length==2);
assertTrue(ints[0].compareTo(RPCLitImpl.bigInt1) == 0);
assertTrue(ints[1].compareTo(RPCLitImpl.bigInt2) == 0);
+
+ // Try a second time
+ ints = proxy.testBigIntegerList3(request);
+ assertTrue(ints.length==2);
+ assertTrue(ints[0].compareTo(RPCLitImpl.bigInt1) == 0);
+ assertTrue(ints[1].compareTo(RPCLitImpl.bigInt2) == 0);
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -400,6 +553,13 @@
assertTrue(longs[0] == 0);
assertTrue(longs[1] == 1);
assertTrue(longs[2] == 2);
+
+ // Try a second time
+ longs = proxy.testLongList4(request);
+ assertTrue(longs.length==3);
+ assertTrue(longs[0] == 0);
+ assertTrue(longs[1] == 1);
+ assertTrue(longs[2] == 2);
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
@@ -416,6 +576,14 @@
assertTrue(enums[0] == Enum.ONE);
assertTrue(enums[1] == Enum.TWO);
assertTrue(enums[2] == Enum.THREE);
+
+
+ // Try a second time
+ enums = proxy.testEnumList5(request);
+ assertTrue(enums.length==3);
+ assertTrue(enums[0] == Enum.ONE);
+ assertTrue(enums[1] == Enum.TWO);
+ assertTrue(enums[2] == Enum.THREE);
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/SOAP12ProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/SOAP12ProxyTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/SOAP12ProxyTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/SOAP12ProxyTests.java Fri May 2 19:23:18 2008
@@ -67,6 +67,14 @@
// validate the results
assertNotNull(response);
assertTrue(!response.equals("FAIL"));
+
+ // Try a second time
+ response = proxy.echo(SEND_SOAP12_RESPONSE);
+ TestLogger.logger.debug("response returned [" + response + "]");
+
+ // validate the results
+ assertNotNull(response);
+ assertTrue(!response.equals("FAIL"));
}
/**
@@ -97,6 +105,19 @@
TestLogger.logger.debug("an exception was thrown, as expected");
TestLogger.logger.debug(wse.getMessage());
}
+
+ // Now do it a second time to confirm the same behavior
+ try {
+ String response = proxy.echo(SEND_SOAP11_RESPONSE);
+ TestLogger.logger.debug("response returned [" + response + "]");
+
+ // if we've gotten this far, then something went wrong.
+ fail();
+ }
+ catch (WebServiceException wse) {
+ TestLogger.logger.debug("an exception was thrown, as expected");
+ TestLogger.logger.debug(wse.getMessage());
+ }
}
public void test() {
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/enumtype/tests/RPCLitEnumTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/enumtype/tests/RPCLitEnumTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/enumtype/tests/RPCLitEnumTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/enumtype/tests/RPCLitEnumTests.java Fri May 2 19:23:18 2008
@@ -44,20 +44,26 @@
TestLogger.logger.debug("------------------------------");
TestLogger.logger.debug("Test : " + getName());
try{
- Service service = new Service();
- PortType portType = service.getPort();
-
- BindingProvider p = (BindingProvider) portType;
- p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+ Service service = new Service();
+ PortType portType = service.getPort();
- Holder<ElementString> pString = new Holder<ElementString>(ElementString.A);
- portType.echoString(pString);
- ElementString es = pString.value;
+ BindingProvider p = (BindingProvider) portType;
+ p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+
+ Holder<ElementString> pString = new Holder<ElementString>(ElementString.A);
+ portType.echoString(pString);
+ ElementString es = pString.value;
+ TestLogger.logger.debug("Response =" + es);
+
+ // Try a second time
+ pString = new Holder<ElementString>(ElementString.A);
+ portType.echoString(pString);
+ es = pString.value;
TestLogger.logger.debug("Response =" + es);
- System.out.print("---------------------------------");
+ System.out.print("---------------------------------");
}catch(Exception e){
- e.printStackTrace();
- fail();
+ e.printStackTrace();
+ fail();
}
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java Fri May 2 19:23:18 2008
@@ -55,6 +55,17 @@
assertEquals(array.getItem().get(i), result.getItem().get(i));
}
+ // Try a second time to verify
+ String[] strArray2 = {"str1", "str2", "str3", "str4 5"};
+ array = new StringArray();
+ array.getItem().addAll(Arrays.asList(strArray2));
+ result = portType.echoStringArray(array);
+
+ assertEquals(array.getItem().size(), result.getItem().size());
+ for (int i = 0; i < array.getItem().size(); i++) {
+ assertEquals(array.getItem().get(i), result.getItem().get(i));
+ }
+
System.out.print("---------------------------------");
}
@@ -77,6 +88,17 @@
for (int i = 0; i < array.getItem().size(); i++) {
assertEquals(array.getItem().get(i) + "return", result.getItem().get(i));
}
+
+ // Try a second time to verify
+ String[]strArray2 = {"str1", "str2", "str3", "str4 5"};
+ array = new StringArray();
+ array.getItem().addAll(Arrays.asList(strArray2));
+ result = portType.echoStringArray(array);
+
+ assertEquals(array.getItem().size(), result.getItem().size());
+ for (int i = 0; i < array.getItem().size(); i++) {
+ assertEquals(array.getItem().get(i) + "return", result.getItem().get(i));
+ }
System.out.print("---------------------------------");
}
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java Fri May 2 19:23:18 2008
@@ -50,7 +50,7 @@
int total = proxy.addNumbers(10, 10);
TestLogger.logger.debug("Total =" + total);
- TestLogger.logger.debug("----------------------------------");
+
assertEquals("sum", 20, total);
assertEquals("http response code",
@@ -58,6 +58,20 @@
Map headers = (Map) p.getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
// the map should contain some headers
assertTrue("http response headers", headers != null && !headers.isEmpty());
+
+
+ // Try the test again
+ total = proxy.addNumbers(10, 10);
+
+ TestLogger.logger.debug("Total =" + total);
+
+
+ assertEquals("sum", 20, total);
+ assertEquals("http response code",
+ new Integer(200), p.getResponseContext().get(MessageContext.HTTP_RESPONSE_CODE));
+ headers = (Map) p.getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
+ // the map should contain some headers
+ assertTrue("http response headers", headers != null && !headers.isEmpty());
}
public void testOneWay() {
@@ -72,6 +86,9 @@
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
axisEndpoint);
proxy.oneWayInt(11);
+
+ // Try it one more time
+ proxy.oneWayInt(11);
TestLogger.logger.debug("----------------------------------");
} catch (Exception e) {
e.printStackTrace();
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddressBookTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddressBookTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddressBookTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddressBookTests.java Fri May 2 19:23:18 2008
@@ -85,12 +85,22 @@
request.setEntry(content);
AddEntryResponse response = (AddEntryResponse) dispatch.invoke(request);
-
+
// Validate the results
assertNotNull(response);
assertTrue(response.isStatus());
- TestLogger.logger.debug("[pass] - valid response received");
- TestLogger.logger.debug("[response] - " + response.isStatus());
+ TestLogger.logger.debug("[pass] - valid response received");
+ TestLogger.logger.debug("[response] - " + response.isStatus());
+
+
+ // Try the dispatch again
+ response = (AddEntryResponse) dispatch.invoke(request);
+
+ // Validate the results
+ assertNotNull(response);
+ assertTrue(response.isStatus());
+ TestLogger.logger.debug("[pass] - valid response received");
+ TestLogger.logger.debug("[response] - " + response.isStatus());
} catch (Exception e) {
e.printStackTrace();
throw e;
@@ -123,6 +133,14 @@
// Validate the results
assertNotNull(added);
assertTrue(added);
+
+
+ // Try the test again
+ added = ab.addEntry(content);
+
+ // Validate the results
+ assertNotNull(added);
+ assertTrue(added);
}
/**
@@ -149,6 +167,16 @@
assertNotNull(result.getLastName());
assertTrue(result.getFirstName().equals(fname));
assertTrue(result.getLastName().equals(lname));
+
+ // Try the invoke again to verify
+ result = ab.findEntryByName(fname, lname);
+
+ // Validate the results
+ assertNotNull(result);
+ assertNotNull(result.getFirstName());
+ assertNotNull(result.getLastName());
+ assertTrue(result.getFirstName().equals(fname));
+ assertTrue(result.getLastName().equals(lname));
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareTests.java Fri May 2 19:23:18 2008
@@ -60,6 +60,10 @@
String request = "Hello World";
String response = proxy.echoString(request);
assertTrue(request.equals(response));
+
+ // Try the test again
+ response = proxy.echoString(request);
+ assertTrue(request.equals(response));
TestLogger.logger.debug("------------------------------");
@@ -81,6 +85,10 @@
String request = XMLCHARS;
String response = proxy.echoString(request);
assertTrue(request.equals(response));
+
+ // Try the test again
+ response = proxy.echoString(request);
+ assertTrue(request.equals(response));
TestLogger.logger.debug("------------------------------");
@@ -103,6 +111,11 @@
String response = proxy.twoWaySimple(10);
TestLogger.logger.debug("Sync Response =" + response);
+
+ // Try the call again
+ response = proxy.twoWaySimple(10);
+
+ TestLogger.logger.debug("Sync Response =" + response);
TestLogger.logger.debug("------------------------------");
}catch(Exception e){
e.printStackTrace();
@@ -123,6 +136,11 @@
String response = proxy.twoWaySimple(10);
TestLogger.logger.debug("Sync Response =" + response);
+
+
+ // Try the call again
+ response = proxy.twoWaySimple(10);
+ TestLogger.logger.debug("Sync Response =" + response);
TestLogger.logger.debug("------------------------------");
}catch(Exception e){
e.printStackTrace();
@@ -147,6 +165,9 @@
p.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ENDPOINT_URL);
proxy.oneWayEmpty();
+
+ // Try the call again
+ proxy.oneWayEmpty();
TestLogger.logger.debug("------------------------------");
}catch(Exception e){
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DLWMinTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DLWMinTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DLWMinTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DLWMinTests.java Fri May 2 19:23:18 2008
@@ -86,6 +86,10 @@
String me = "Scheu";
String response = proxy.greetMe(me);
assertTrue("Hello Scheu".equals(response));
+
+ // Try the call again
+ response = proxy.greetMe(me);
+ assertTrue("Hello Scheu".equals(response));
}
/**
@@ -109,6 +113,16 @@
assertTrue(response.contains(":responseType") ||
response.contains("responseType xmlns=")); // assert that response type is a qualified element
assertTrue(!response.contains("xsi:type")); // xsi:type should not be used
+
+ // Try the call again
+ response = dispatch.invoke(request);
+ TestLogger.logger.debug("Doc/Lit Wrapped Minimal Response =" + response);
+
+ assertTrue(response.contains("Hello Scheu"));
+ assertTrue(response.contains("dlwmin:greetMeResponse"));
+ assertTrue(response.contains(":responseType") ||
+ response.contains("responseType xmlns=")); // assert that response type is a qualified element
+ assertTrue(!response.contains("xsi:type")); // xsi:type should not be used
}
/**
@@ -122,6 +136,10 @@
String request = "hello world";
String response = proxy.testUnqualified(request);
assertTrue("hello world".equals(response));
+
+ // Try the call again
+ response = proxy.testUnqualified(request);
+ assertTrue("hello world".equals(response));
}
/**
@@ -144,6 +162,16 @@
assertTrue(response.contains("dlwmin:testUnqualifiedResponse"));
assertTrue(response.contains("<unqualifiedResponse")); // assert that the child element is an uqualified element
assertTrue(!response.contains("xsi:type")); // xsi:type should not be used
+
+
+ // Try the call again to verify
+ response = dispatch.invoke(request);
+ TestLogger.logger.debug("Doc/Lit Wrapped Minimal Response =" + response);
+
+ assertTrue(response.contains("hello world"));
+ assertTrue(response.contains("dlwmin:testUnqualifiedResponse"));
+ assertTrue(response.contains("<unqualifiedResponse")); // assert that the child element is an uqualified element
+ assertTrue(!response.contains("xsi:type")); // xsi:type should not be used
}
/**
@@ -160,6 +188,13 @@
assertTrue(response != null);
assertTrue(response.getData1().equals("hello world"));
assertTrue(response.getData2() == 10);
+
+
+ // Try the call again to verify
+ response = proxy.process(0, request);
+ assertTrue(response != null);
+ assertTrue(response.getData1().equals("hello world"));
+ assertTrue(response.getData2() == 10);
}
/**
@@ -184,6 +219,20 @@
} catch (Exception e) {
fail("Expected TestException thrown but found " + e.getClass());
}
+
+ // Try the call again to verify
+ try {
+ TestBean response = proxy.process(1, request);
+ fail("Expected TestException thrown");
+ } catch (WebServiceException wse) {
+ // Currently there is no support if the fault bean is missing
+ assertTrue(wse.getMessage().contains("User fault processing is not supported"));
+ } catch (TestException te) {
+ assertTrue(te.getMessage().equals("TestException thrown"));
+ assertTrue(te.getFlag() == 123);
+ } catch (Exception e) {
+ fail("Expected TestException thrown but found " + e.getClass());
+ }
}
/**
@@ -205,6 +254,17 @@
} catch (Exception e) {
fail("Expected TestException2 thrown but found " + e.getClass());
}
+
+ // Try the call again to verify the same behavior
+ try {
+ TestBean response = proxy.process(4, request);
+ fail("Expected TestException2 thrown");
+ } catch (TestException2 te) {
+ assertTrue(te.getMessage().equals("TestException2 thrown"));
+ assertTrue(te.getFlag() == 456);
+ } catch (Exception e) {
+ fail("Expected TestException2 thrown but found " + e.getClass());
+ }
}
/**
@@ -226,6 +286,17 @@
} catch (Exception e) {
fail("Expected TestException3 thrown but found " + e.getClass());
}
+
+ // Try the call again to verify the same behavior
+ try {
+ TestBean response = proxy.process(5, request);
+ fail("Expected TestException3 thrown");
+ } catch (TestException3 te) {
+ assertTrue(te.getMessage().equals("TestException3 thrown"));
+ assertTrue(te.getFaultInfo().getFlag() == 789);
+ } catch (Exception e) {
+ fail("Expected TestException3 thrown but found " + e.getClass());
+ }
}
/**
@@ -246,6 +317,16 @@
} catch (Exception e) {
fail("Expected WebServiceException thrown but found " + e.getClass());
}
+
+ // Try the call again to verify the same behavior
+ try {
+ TestBean response = proxy.process(2, request);
+ fail("Expected WebServiceException thrown");
+ } catch (WebServiceException wse) {
+ assertTrue(wse.getMessage().equals("WebServiceException thrown"));
+ } catch (Exception e) {
+ fail("Expected WebServiceException thrown but found " + e.getClass());
+ }
}
/**
@@ -266,6 +347,16 @@
} catch (Exception e) {
fail("Expected NullPointerException thrown but found " + e.getClass());
}
+
+ // Try the call again to verify the same behavior
+ try {
+ TestBean response = proxy.process(3, request);
+ fail("Expected NullPointerException thrown");
+ } catch (WebServiceException wse) {
+ assertTrue(wse.getMessage().equals("NPE thrown"));
+ } catch (Exception e) {
+ fail("Expected NullPointerException thrown but found " + e.getClass());
+ }
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java Fri May 2 19:23:18 2008
@@ -58,5 +58,10 @@
assertTrue(request.equals(response));
+ // Try the call again to verify behavior
+ response = proxy.echo(request);
+
+ assertTrue(request.equals(response));
+
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org