Repository: aries-jax-rs-whiteboard
Updated Branches:
  refs/heads/master 9c7620caf -> f28fc0d38


stabilize factory tests

Signed-off-by: Raymond Auge <rotty3...@apache.org>


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

Branch: refs/heads/master
Commit: 92705d07e732719a192c467464eff5fd0c760bf1
Parents: 9c7620c
Author: Raymond Auge <rotty3...@apache.org>
Authored: Thu Aug 10 13:04:38 2017 -0400
Committer: Raymond Auge <rotty3...@apache.org>
Committed: Thu Aug 10 13:06:00 2017 -0400

----------------------------------------------------------------------
 .../src/main/java/test/WhiteboardFactoryTest.java   | 16 +++++++++++++++-
 .../jax/rs/whiteboard/internal/TargetFilter.java    |  2 +-
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/92705d07/jax-rs.itests/src/main/java/test/WhiteboardFactoryTest.java
----------------------------------------------------------------------
diff --git a/jax-rs.itests/src/main/java/test/WhiteboardFactoryTest.java 
b/jax-rs.itests/src/main/java/test/WhiteboardFactoryTest.java
index 8a3d01e..1534fb9 100644
--- a/jax-rs.itests/src/main/java/test/WhiteboardFactoryTest.java
+++ b/jax-rs.itests/src/main/java/test/WhiteboardFactoryTest.java
@@ -20,6 +20,7 @@ package test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static 
org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN;
 import static 
org.osgi.service.jaxrs.whiteboard.JaxRSWhiteboardConstants.JAX_RS_APPLICATION_BASE;
 import static 
org.osgi.service.jaxrs.whiteboard.JaxRSWhiteboardConstants.JAX_RS_RESOURCE;
 
@@ -29,6 +30,7 @@ import java.util.Hashtable;
 
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
@@ -97,10 +99,22 @@ public class WhiteboardFactoryTest {
             Configuration configuration = admin.createFactoryConfiguration(
                 "org.apache.aries.jax.rs.whiteboard", "?");
 
-            configuration.update(new Hashtable<>());
+            Dictionary<String, Object> properties = new Hashtable<>();
+
+            properties.put(
+                HTTP_WHITEBOARD_SERVLET_PATTERN,
+                "/new-whiteboard");
+            properties.put(Constants.SERVICE_RANKING, 1000);
+
+            configuration.update(properties);
 
             do {
                 Thread.sleep(50);
+
+                if (!"/new-whiteboard".equals(
+                        
runtimeTracker.getServiceReference().getProperty(HTTP_WHITEBOARD_SERVLET_PATTERN)))
 {
+                    trackingCount = runtimeTracker.getTrackingCount();
+                }
             }
             while (runtimeTracker.getTrackingCount() <= trackingCount);
 

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/92705d07/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/TargetFilter.java
----------------------------------------------------------------------
diff --git 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/TargetFilter.java
 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/TargetFilter.java
index d83caa8..901f23a 100644
--- 
a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/TargetFilter.java
+++ 
b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/TargetFilter.java
@@ -32,7 +32,7 @@ public class TargetFilter<T> implements 
Predicate<ServiceReference<T>>  {
         }
         catch (InvalidSyntaxException ise) {
             if (_log.isErrorEnabled()) {
-                _log.error("Invalid '{}' syntax in {}", 
JAX_RS_WHITEBOARD_TARGET, ref, ise);
+                _log.error("Invalid '{}' filter syntax in {}", 
JAX_RS_WHITEBOARD_TARGET, ref);
             }
 
             return false;

Reply via email to