Author: veithen
Date: Mon Dec 25 19:40:18 2017
New Revision: 1819255
URL: http://svn.apache.org/viewvc?rev=1819255&view=rev
Log:
Eliminate an instance of the catch-and-fail testing anti-pattern.
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java?rev=1819255&r1=1819254&r2=1819255&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java
(original)
+++
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF8Tests.java
Mon Dec 25 19:40:18 2017
@@ -6,7 +6,6 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
public class JAXBStringUTF8Tests extends AbstractTestCase {
String axisEndpoint =
"http://localhost:6060/axis2/services/JAXBStringService.JAXBStringPortTypeImplPort";
@@ -89,24 +88,20 @@ public class JAXBStringUTF8Tests extends
private void runTestWithEncoding(String input, String output, String
encoding) {
TestLogger.logger.debug("Test : " + getName());
- try {
- JAXBStringPortType myPort = (new
JAXBStringService()).getJAXBStringPort();
- BindingProvider p = (BindingProvider) myPort;
-
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
axisEndpoint);
-
- if (encoding != null) {
-
p.getRequestContext().put(org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING,
encoding);
- }
-
- Echo request = new Echo();
- request.setArg(input);
- EchoResponse response = myPort.echoString(request);
- TestLogger.logger.debug(response.getResponse());
- assertEquals(output, response.getResponse());
- } catch (WebServiceException webEx) {
- webEx.printStackTrace();
- fail();
+
+ JAXBStringPortType myPort = (new
JAXBStringService()).getJAXBStringPort();
+ BindingProvider p = (BindingProvider) myPort;
+ p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
axisEndpoint);
+
+ if (encoding != null) {
+
p.getRequestContext().put(org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING,
encoding);
}
+
+ Echo request = new Echo();
+ request.setArg(input);
+ EchoResponse response = myPort.echoString(request);
+ TestLogger.logger.debug(response.getResponse());
+ assertEquals(output, response.getResponse());
}
}