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/02/15 13:18:18 UTC

[1/5] aries-rsa git commit: Add missing eventadmin feature

Repository: aries-rsa
Updated Branches:
  refs/heads/master d5bfc3769 -> aafd325ea


Add missing eventadmin feature


Project: http://git-wip-us.apache.org/repos/asf/aries-rsa/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-rsa/commit/722d81c4
Tree: http://git-wip-us.apache.org/repos/asf/aries-rsa/tree/722d81c4
Diff: http://git-wip-us.apache.org/repos/asf/aries-rsa/diff/722d81c4

Branch: refs/heads/master
Commit: 722d81c441fca588056e86c0c5de3f80c089d617
Parents: d5bfc37
Author: Christian Schneider <cs...@adobe.com>
Authored: Thu Feb 15 13:58:50 2018 +0100
Committer: Christian Schneider <cs...@adobe.com>
Committed: Thu Feb 15 13:58:50 2018 +0100

----------------------------------------------------------------------
 features/src/main/resources/features.xml | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/722d81c4/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/features/src/main/resources/features.xml b/features/src/main/resources/features.xml
index 5a1e2fb..34b102a 100644
--- a/features/src/main/resources/features.xml
+++ b/features/src/main/resources/features.xml
@@ -3,14 +3,12 @@
 
     <feature name="aries-rsa-core" version="${project.version}">
         <feature>scr</feature>
+        <feature>eventadmin</feature>
         <bundle>mvn:org.apache.aries.rsa/org.apache.aries.rsa.spi/${project.version}</bundle>
         <bundle>mvn:org.apache.aries.rsa/org.apache.aries.rsa.core/${project.version}</bundle>
         <bundle>mvn:org.apache.aries.rsa/org.apache.aries.rsa.topology-manager/${project.version}</bundle>
         <bundle>mvn:org.apache.aries.rsa.discovery/org.apache.aries.rsa.discovery.command/${project.version}</bundle>
-        <conditional>
-            <condition>eventadmin</condition>
-            <bundle>mvn:org.apache.aries.rsa/org.apache.aries.rsa.eapub/${project.version}</bundle>
-        </conditional>
+        <bundle>mvn:org.apache.aries.rsa/org.apache.aries.rsa.eapub/${project.version}</bundle>
     </feature>
     
     <feature name="aries-rsa-provider-tcp" version="${project.version}">


[2/5] aries-rsa git commit: Improve Tests

Posted by cs...@apache.org.
Improve Tests


Project: http://git-wip-us.apache.org/repos/asf/aries-rsa/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-rsa/commit/736a259b
Tree: http://git-wip-us.apache.org/repos/asf/aries-rsa/tree/736a259b
Diff: http://git-wip-us.apache.org/repos/asf/aries-rsa/diff/736a259b

Branch: refs/heads/master
Commit: 736a259b4b8bb47af594d774da76537c4f0b66c5
Parents: 722d81c
Author: Christian Schneider <cs...@adobe.com>
Authored: Thu Feb 15 14:00:42 2018 +0100
Committer: Christian Schneider <cs...@adobe.com>
Committed: Thu Feb 15 14:00:42 2018 +0100

----------------------------------------------------------------------
 .../aries/rsa/itests/felix/RsaTestBase.java     |  1 -
 .../felix/fastbin/TestFastbinRoundTrip.java     | 12 ++-
 .../itests/felix/tcp/TestDiscoveryImport.java   | 94 ++++++++++++++++++++
 .../rsa/itests/felix/tcp/TestFindHook.java      |  2 +-
 4 files changed, 104 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/736a259b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java
----------------------------------------------------------------------
diff --git a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java
index 051884b..e2e56f0 100644
--- a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java
+++ b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java
@@ -140,7 +140,6 @@ public class RsaTestBase {
     
     protected static Option rsaDiscoveryZookeeper() {
         return composite(
-                         systemProperty("zkPort").value("15201"),
                          mvn("org.apache.zookeeper", "zookeeper"),
                          mvn("org.apache.aries.rsa.discovery", "org.apache.aries.rsa.discovery.zookeeper")
                          );

http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/736a259b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/fastbin/TestFastbinRoundTrip.java
----------------------------------------------------------------------
diff --git a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/fastbin/TestFastbinRoundTrip.java b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/fastbin/TestFastbinRoundTrip.java
index afd8cf9..1790951 100644
--- a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/fastbin/TestFastbinRoundTrip.java
+++ b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/fastbin/TestFastbinRoundTrip.java
@@ -35,11 +35,17 @@ import org.ops4j.pax.exam.Option;
 
 @RunWith(TwoContainerPaxExam.class)
 public class TestFastbinRoundTrip extends RsaTestBase {
-    private static final String FASTBIN_PORT_SERVER = "2544";
-    private static final String FASTBIN_PORT_CLIENT = "2545";
+    private static String FASTBIN_PORT_SERVER = "2544";
+    private static String FASTBIN_PORT_CLIENT = "2545";
+    
     @Inject
     EchoService echoService;
-
+    
+    public TestFastbinRoundTrip() throws IOException {
+        FASTBIN_PORT_CLIENT = "" + getFreePort();
+        FASTBIN_PORT_SERVER = "" + getFreePort();
+    }
+    
     @ServerConfiguration
     public static Option[] remoteConfig() throws IOException {
         return new Option[] //

http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/736a259b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java
----------------------------------------------------------------------
diff --git a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java
new file mode 100644
index 0000000..d7424ea
--- /dev/null
+++ b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.rsa.itests.felix.tcp;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import javax.inject.Inject;
+
+import org.apache.aries.rsa.discovery.zookeeper.repository.ZookeeperEndpointRepository;
+import org.apache.aries.rsa.itests.felix.RsaTestBase;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.util.Filter;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.remoteserviceadmin.EndpointDescription;
+import org.osgi.service.remoteserviceadmin.EndpointEvent;
+import org.osgi.service.remoteserviceadmin.EndpointEventListener;
+import org.osgi.service.remoteserviceadmin.RemoteConstants;
+
+@RunWith(PaxExam.class)
+public class TestDiscoveryImport extends RsaTestBase {
+    @Inject
+    ZookeeperEndpointRepository repository;
+    
+    @Inject
+    BundleContext context;
+    
+    @Configuration
+    public static Option[] configure() throws Exception {
+        return new Option[] {
+                rsaCore(),
+                rsaProviderTcp(),
+                rsaDiscoveryZookeeper(),
+                localRepo(),
+                configZKDiscovery(),
+                configZKServer()
+        };
+    }
+
+    @Test
+    public void testDiscoveryImport() throws Exception {
+        final Semaphore sem = new Semaphore(0);
+        final List<EndpointEvent> events = new ArrayList<>();
+        EndpointEventListener listener = new EndpointEventListener() {
+            
+            @Override
+            public void endpointChanged(EndpointEvent event, String filter) {
+                events.add(event);
+                sem.release();
+            }
+        };
+        Dictionary<String, Object> eprops = new Hashtable<>();
+        eprops.put(EndpointEventListener.ENDPOINT_LISTENER_SCOPE, "(objectClass=*)");
+        context.registerService(EndpointEventListener.class, listener, eprops);
+        Map<String, Object> props = new HashMap<>();
+        props.put(Constants.OBJECTCLASS, new String[]{"my"});
+        props.put(RemoteConstants.ENDPOINT_ID, "myid");
+        props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "myconfig");
+        EndpointDescription endpoint = new EndpointDescription(props);
+        repository.add(endpoint);
+        assertTrue(sem.tryAcquire(10, TimeUnit.SECONDS));
+        //assertThat(events.get(0), samePropertyValuesAs(new EndpointEvent(EndpointEvent.ADDED, endpoint)));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/736a259b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestFindHook.java
----------------------------------------------------------------------
diff --git a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestFindHook.java b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestFindHook.java
index 8d4ab97..19f481a 100644
--- a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestFindHook.java
+++ b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestFindHook.java
@@ -31,6 +31,7 @@ import org.apache.aries.rsa.itests.felix.RsaTestBase;
 import org.apache.aries.rsa.itests.felix.ServerConfiguration;
 import org.apache.aries.rsa.itests.felix.TwoContainerPaxExam;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
@@ -99,7 +100,6 @@ public class TestFindHook extends RsaTestBase {
 
     @Test
     public void testFind() throws Exception {
-        Thread.sleep(1000); // FIXME Why does it only work if we wait? 
         ServiceReference<EchoService> ref = tryTo("get EchoService", new Callable<ServiceReference<EchoService>>() {
 
             @Override


[3/5] aries-rsa git commit: Rename to clarify the purpose

Posted by cs...@apache.org.
Rename to clarify the purpose


Project: http://git-wip-us.apache.org/repos/asf/aries-rsa/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-rsa/commit/7cc50e8c
Tree: http://git-wip-us.apache.org/repos/asf/aries-rsa/tree/7cc50e8c
Diff: http://git-wip-us.apache.org/repos/asf/aries-rsa/diff/7cc50e8c

Branch: refs/heads/master
Commit: 7cc50e8c214b99a4497a4708b8e5b43c93ed9531
Parents: 736a259
Author: Christian Schneider <cs...@adobe.com>
Authored: Thu Feb 15 14:01:15 2018 +0100
Committer: Christian Schneider <cs...@adobe.com>
Committed: Thu Feb 15 14:01:15 2018 +0100

----------------------------------------------------------------------
 .../aries/rsa/topologymanager/importer/local/RSFindHook.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/7cc50e8c/topology-manager/src/main/java/org/apache/aries/rsa/topologymanager/importer/local/RSFindHook.java
----------------------------------------------------------------------
diff --git a/topology-manager/src/main/java/org/apache/aries/rsa/topologymanager/importer/local/RSFindHook.java b/topology-manager/src/main/java/org/apache/aries/rsa/topologymanager/importer/local/RSFindHook.java
index 1d73ad7..c9875ac 100644
--- a/topology-manager/src/main/java/org/apache/aries/rsa/topologymanager/importer/local/RSFindHook.java
+++ b/topology-manager/src/main/java/org/apache/aries/rsa/topologymanager/importer/local/RSFindHook.java
@@ -60,11 +60,11 @@ public class RSFindHook implements FindHook {
             LOG.debug("Skipping import request for excluded class [{}]", className);
             return;
         }
-        String exFilter = extendFilter(fullFilter);
+        String exFilter = excludeLocalServices(fullFilter);
         serviceInterestListener.addServiceInterest(exFilter);
     }
 
-    String extendFilter(String filter) {
+    String excludeLocalServices(String filter) {
         return "(&" + filter + "(!(" + RemoteConstants.ENDPOINT_FRAMEWORK_UUID + "=" + frameworkUUID + ")))";
     }
 }


[4/5] aries-rsa git commit: Update maven bundle plugin version

Posted by cs...@apache.org.
Update maven bundle plugin version


Project: http://git-wip-us.apache.org/repos/asf/aries-rsa/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-rsa/commit/bbe8b804
Tree: http://git-wip-us.apache.org/repos/asf/aries-rsa/tree/bbe8b804
Diff: http://git-wip-us.apache.org/repos/asf/aries-rsa/diff/bbe8b804

Branch: refs/heads/master
Commit: bbe8b804468690afa02ac295717dcb623e34a84d
Parents: 7cc50e8
Author: Christian Schneider <cs...@adobe.com>
Authored: Thu Feb 15 14:01:41 2018 +0100
Committer: Christian Schneider <cs...@adobe.com>
Committed: Thu Feb 15 14:01:41 2018 +0100

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/bbe8b804/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index fd4e1a5..9b7be55 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -215,7 +215,7 @@
                 <plugin>
                     <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
-                    <version>3.3.0</version>
+                    <version>3.5.0</version>
                     <extensions>true</extensions>
                 </plugin>
                 <plugin>


[5/5] aries-rsa git commit: Ignore test

Posted by cs...@apache.org.
Ignore test


Project: http://git-wip-us.apache.org/repos/asf/aries-rsa/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-rsa/commit/aafd325e
Tree: http://git-wip-us.apache.org/repos/asf/aries-rsa/tree/aafd325e
Diff: http://git-wip-us.apache.org/repos/asf/aries-rsa/diff/aafd325e

Branch: refs/heads/master
Commit: aafd325eaa2962936ae9deecda3fc768c711ea24
Parents: bbe8b80
Author: Christian Schneider <cs...@adobe.com>
Authored: Thu Feb 15 14:13:04 2018 +0100
Committer: Christian Schneider <cs...@adobe.com>
Committed: Thu Feb 15 14:13:04 2018 +0100

----------------------------------------------------------------------
 .../apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/aafd325e/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java
----------------------------------------------------------------------
diff --git a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java
index d7424ea..e735f55 100644
--- a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java
+++ b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/tcp/TestDiscoveryImport.java
@@ -33,12 +33,12 @@ import javax.inject.Inject;
 
 import org.apache.aries.rsa.discovery.zookeeper.repository.ZookeeperEndpointRepository;
 import org.apache.aries.rsa.itests.felix.RsaTestBase;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.util.Filter;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.service.remoteserviceadmin.EndpointDescription;
@@ -66,6 +66,7 @@ public class TestDiscoveryImport extends RsaTestBase {
         };
     }
 
+    @Ignore
     @Test
     public void testDiscoveryImport() throws Exception {
         final Semaphore sem = new Semaphore(0);