Author: veithen
Date: Sat Aug 13 12:39:49 2011
New Revision: 1157373

URL: http://svn.apache.org/viewvc?rev=1157373&view=rev
Log:
Eliminated an instance of the catch-and-fail JUnit anti-pattern.

Modified:
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF16Tests.java

Modified: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF16Tests.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF16Tests.java?rev=1157373&r1=1157372&r2=1157373&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF16Tests.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/string/JAXBStringUTF16Tests.java
 Sat Aug 13 12:39:49 2011
@@ -6,7 +6,6 @@ import org.apache.axis2.jaxws.TestLogger
 import org.apache.axis2.jaxws.framework.AbstractTestCase;
 
 import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
 
 public class JAXBStringUTF16Tests extends AbstractTestCase {
     String axisEndpoint = 
"http://localhost:6060/axis2/services/JAXBStringService.JAXBStringPortTypeImplPort";;
@@ -88,24 +87,19 @@ public class JAXBStringUTF16Tests extend
     }
     private void runTestWithEncoding(String input, String output, String 
encoding, String endpoint) {
         TestLogger.logger.debug("Test : " + getName());
-        try {
-            JAXBStringPortType myPort = (new 
JAXBStringService()).getJAXBStringPort();
-            BindingProvider p = (BindingProvider) myPort;
-            
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
-
-            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, 
endpoint);
+
+        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());
     }
 }
 


Reply via email to