You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2018/06/18 09:55:49 UTC
[3/3] aries-jax-rs-whiteboard git commit: Improve tests
Improve tests
Project: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/commit/cd85e670
Tree: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/tree/cd85e670
Diff: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/diff/cd85e670
Branch: refs/heads/master
Commit: cd85e6706fe002af75536b478a6dff4c86e42a46
Parents: bee2c6e
Author: Carlos Sierra <cs...@apache.org>
Authored: Mon Jun 18 11:25:53 2018 +0200
Committer: Carlos Sierra <cs...@apache.org>
Committed: Mon Jun 18 11:25:53 2018 +0200
----------------------------------------------------------------------
jax-rs.itests/src/main/java/test/JaxrsTest.java | 23 +++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/cd85e670/jax-rs.itests/src/main/java/test/JaxrsTest.java
----------------------------------------------------------------------
diff --git a/jax-rs.itests/src/main/java/test/JaxrsTest.java b/jax-rs.itests/src/main/java/test/JaxrsTest.java
index 66cc44e..b4f412d 100644
--- a/jax-rs.itests/src/main/java/test/JaxrsTest.java
+++ b/jax-rs.itests/src/main/java/test/JaxrsTest.java
@@ -403,6 +403,9 @@ public class JaxrsTest extends TestHelper {
@Test
public void testApplicationReadd() throws InterruptedException {
+ assertEquals(0, getRuntimeDTO().applicationDTOs.length);
+ assertEquals(0, getRuntimeDTO().failedApplicationDTOs.length);
+
WebTarget webTarget = createDefaultTarget().path("/test-application");
Runnable testCase = () -> {
@@ -626,14 +629,17 @@ public class JaxrsTest extends TestHelper {
throws InterruptedException {
assertEquals(0, getRuntimeDTO().applicationDTOs.length);
+ assertEquals(0, getRuntimeDTO().failedApplicationDTOs.length);
- registerApplication(
- new TestApplication(),
- JAX_RS_EXTENSION_SELECT,
- String.format("(%s=%s)", JAX_RS_NAME, "Filter"), "propertyKey",
- "propertyValue");
+ ServiceRegistration<Application> serviceRegistration =
+ registerApplication(
+ new TestApplication(),
+ JAX_RS_EXTENSION_SELECT,
+ String.format("(%s=%s)", JAX_RS_NAME, "Filter"), "propertyKey",
+ "propertyValue");
assertEquals(0, getRuntimeDTO().applicationDTOs.length);
+ assertEquals(1, getRuntimeDTO().failedApplicationDTOs.length);
WebTarget webTarget = createDefaultTarget().path("/test-application");
@@ -645,6 +651,7 @@ public class JaxrsTest extends TestHelper {
"Filter", JAX_RS_APPLICATION_SELECT, "(propertyKey=propertyValue)");
assertEquals(1, getRuntimeDTO().applicationDTOs.length);
+ assertEquals(0, getRuntimeDTO().failedApplicationDTOs.length);
response = webTarget.request().get();
@@ -653,10 +660,16 @@ public class JaxrsTest extends TestHelper {
filterRegistration.unregister();
assertEquals(0, getRuntimeDTO().applicationDTOs.length);
+ assertEquals(1, getRuntimeDTO().failedApplicationDTOs.length);
response = webTarget.request().get();
assertEquals(404, response.getStatus());
+
+ serviceRegistration.unregister();
+
+ assertEquals(0, getRuntimeDTO().applicationDTOs.length);
+ assertEquals(0, getRuntimeDTO().failedApplicationDTOs.length);
}
@Test