aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csie...@apache.org
Subject [1/2] aries-jax-rs-whiteboard git commit: Extract application registration
Date Wed, 30 Nov 2016 19:04:57 GMT
Repository: aries-jax-rs-whiteboard
Updated Branches:
  refs/heads/master e0b4a8665 -> 3dae7ed72


Extract application registration


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/840cce2e
Tree: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/tree/840cce2e
Diff: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/diff/840cce2e

Branch: refs/heads/master
Commit: 840cce2ea2e3337b122965d23dca4a04d4a7387d
Parents: e0b4a86
Author: Carlos Sierra <csierra@apache.org>
Authored: Wed Nov 30 20:01:58 2016 +0100
Committer: Carlos Sierra <csierra@apache.org>
Committed: Wed Nov 30 20:04:20 2016 +0100

----------------------------------------------------------------------
 jax-rs.itests/src/main/java/test/JaxrsTest.java | 46 ++++++++------------
 1 file changed, 18 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/840cce2e/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 d52d523..b81d5da 100644
--- a/jax-rs.itests/src/main/java/test/JaxrsTest.java
+++ b/jax-rs.itests/src/main/java/test/JaxrsTest.java
@@ -48,15 +48,7 @@ public class JaxrsTest {
         ServiceRegistration<?> serviceRegistration = null;
 
         try {
-            TestApplication testApplication = new TestApplication();
-
-            Dictionary<String, Object> properties = new Hashtable<>();
-
-            properties.put(
-                "osgi.jaxrs.application.base", "/test-application");
-
-            serviceRegistration = bundleContext.registerService(
-                Application.class, testApplication, properties);
+            serviceRegistration = registerApplication();
 
             Client client = createClient();
 
@@ -83,19 +75,12 @@ public class JaxrsTest {
         ServiceRegistration<?> serviceRegistration = null;
 
         try {
-            TestApplication testApplication = new TestApplication();
+            applicationRegistration = registerApplication();
 
-            Dictionary<String, Object> properties = new Hashtable<>();
-
-            properties.put(
-                "osgi.jaxrs.application.base", "/test-application");
-
-            applicationRegistration = bundleContext.registerService(
-                Application.class, testApplication, properties);
 
             TestAddon testAddon = new TestAddon();
 
-            properties = new Hashtable<>();
+            Dictionary<String, Object> properties = new Hashtable<>();
 
             properties.put(
                 "jaxrs.application.select",
@@ -133,19 +118,11 @@ public class JaxrsTest {
         ServiceRegistration<?> filterRegistration = null;
 
         try {
-            TestApplication testApplication = new TestApplication();
-
-            Dictionary<String, Object> properties = new Hashtable<>();
-
-            properties.put(
-                "osgi.jaxrs.application.base", "/test-application");
-
-            applicationRegistration = bundleContext.registerService(
-                Application.class, testApplication, properties);
+            applicationRegistration = registerApplication();
 
             TestFilter testFilter = new TestFilter();
 
-            properties = new Hashtable<>();
+            Dictionary<String, Object> properties = new Hashtable<>();
 
             properties.put(
                 "jaxrs.application.select",
@@ -277,4 +254,17 @@ public class JaxrsTest {
         }
     }
 
+
+    private ServiceRegistration<?> registerApplication() {
+        TestApplication testApplication = new TestApplication();
+
+        Dictionary<String, Object> properties = new Hashtable<>();
+
+        properties.put(
+            "osgi.jaxrs.application.base", "/test-application");
+
+        return bundleContext.registerService(
+            Application.class, testApplication, properties);
+    }
+
 }


Mime
View raw message