This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 407eeb0 cxf-systests-jaxrs: detailed message on test failure
407eeb0 is described below
commit 407eeb0dea157eaa0635d0c37a7ed95463b5638f
Author: Alexey Markevich <[email protected]>
AuthorDate: Tue Nov 12 13:47:14 2019 +0300
cxf-systests-jaxrs: detailed message on test failure
---
.../apache/cxf/systest/jaxrs/AsyncResource2.java | 5 ++---
.../jaxrs/JAXRSContinuationsServlet3Test.java | 21 ++++++---------------
2 files changed, 8 insertions(+), 18 deletions(-)
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AsyncResource2.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AsyncResource2.java
index f8b317f..82ac8a7 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AsyncResource2.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AsyncResource2.java
@@ -37,9 +37,8 @@ public class AsyncResource2 {
@GET
@Path("/setTimeOut")
- public String setTimeOut() {
- boolean setTimeout = asyncResponse.setTimeout(2, TimeUnit.SECONDS);
- return String.valueOf(setTimeout);
+ public boolean setTimeOut() {
+ return asyncResponse.setTimeout(2L, TimeUnit.SECONDS);
}
}
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsServlet3Test.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsServlet3Test.java
index bcf36cb..1d120d1 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsServlet3Test.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSContinuationsServlet3Test.java
@@ -87,30 +87,21 @@ public class JAXRSContinuationsServlet3Test extends
AbstractJAXRSContinuationsTe
}
@Test
- public void testSuspendSetTimeoutt() throws Exception {
+ // FIXME: standalone test run failed, eg
-Dtest=JAXRSContinuationsServlet3Test#testSuspendSetTimeout
+ public void testSuspendSetTimeout() throws Exception {
final String base = "http://localhost:" + getPort() +
"/async/resource2/";
Future<Response> suspend = invokeRequest(base + "suspend");
- Thread t = new Thread(new Runnable() {
- public void run() {
- Future<Response> timeout = invokeRequest(base + "setTimeOut");
- try {
- assertString(timeout, "true");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- });
- t.start();
- t.join();
- assertEquals(503, suspend.get().getStatus());
+ Future<Response> timeout = invokeRequest(base + "setTimeOut");
+ assertString(timeout, "true");
+ assertEquals(503, suspend.get().getStatus());
}
private static void assertString(Future<Response> future, String check)
throws Exception {
Response response = future.get();
- assertEquals(Status.OK.getStatusCode(), response.getStatus());
String content = response.readEntity(String.class);
+ assertEquals(content, Status.OK.getStatusCode(), response.getStatus());
assertEquals(check, content);
}