Author: darran.lofthouse(a)jboss.com
Date: 2010-07-19 14:40:19 -0400 (Mon, 19 Jul 2010)
New Revision: 12657
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/JBWS3071TestCase.java
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/TestEndpointImpl.java
Log:
[JBPAPP-4610] Ensure Response is also set on handler after an Exception.
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2010-07-19
18:35:58 UTC (rev 12656)
+++
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2010-07-19
18:40:19 UTC (rev 12657)
@@ -256,15 +256,15 @@
log.debug("Finished task " + getTaskID().toString() + ":
" + result);
response.set(result);
-
- // Call the handler if available
- if (handler != null)
- handler.handleResponse(response);
}
catch (Exception ex)
{
handleAsynInvokeException(ex);
}
+
+ // Call the handler if available
+ if (handler != null)
+ handler.handleResponse(response);
}
// 2.3.4.5 Conformance (Asychronous fault cause): An ExecutionException that is
thrown by the get method
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/JBWS3071TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/JBWS3071TestCase.java 2010-07-19
18:35:58 UTC (rev 12656)
+++
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/JBWS3071TestCase.java 2010-07-19
18:40:19 UTC (rev 12657)
@@ -130,4 +130,26 @@
}
}
+ public void testEchoFailAsyncFuture_isDone() throws Exception
+ {
+ StringHandler handler = new StringHandler();
+
+ Future future = port.echoAsync("FAIL SLEEP", handler);
+ while (future.isDone() == false)
+ {
+ Thread.sleep(200);
+ }
+
+ try
+ {
+ handler.getResponse().get();
+ fail("Expected 'ExecutionException' not thrown.");
+ }
+ catch (ExecutionException ee)
+ {
+ Exception cause = (Exception)ee.getCause();
+ assertEquals("Cause Type", TestException.class, cause.getClass());
+ }
+ }
+
}
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/TestEndpointImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/TestEndpointImpl.java 2010-07-19
18:35:58 UTC (rev 12656)
+++
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-4610/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3071/TestEndpointImpl.java 2010-07-19
18:40:19 UTC (rev 12657)
@@ -34,8 +34,20 @@
public String echo(String message) throws TestException
{
- if ("FAIL".equals(message))
+ if (message.contains("SLEEP"))
{
+ try
+ {
+ Thread.sleep(5000);
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException("Unable to sleep", e);
+ }
+ }
+
+ if (message.contains("FAIL"))
+ {
throw new TestException(message);
}