cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1552315 - in /cxf/trunk: ./ core/ core/src/main/java/org/apache/cxf/bus/blueprint/ core/src/main/java/org/apache/cxf/bus/osgi/ core/src/main/resources/OSGI-INF/blueprint/ osgi/ osgi/itests-felix/ osgi/itests-felix/src/ osgi/itests-felix/sr...
Date Thu, 19 Dec 2013 13:26:25 GMT
Author: cschneider
Date: Thu Dec 19 13:26:25 2013
New Revision: 1552315

URL: http://svn.apache.org/r1552315
Log:
[CXF-4736] Using activator to publish blueprint namespace handlers, making aries blueprint
optional. Adding OSGi tests

Added:
    cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintNameSpaceHandlerFactory.java
    cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
    cxf/trunk/osgi/itests-felix/
    cxf/trunk/osgi/itests-felix/pom.xml
    cxf/trunk/osgi/itests-felix/src/
    cxf/trunk/osgi/itests-felix/src/test/
    cxf/trunk/osgi/itests-felix/src/test/java/
    cxf/trunk/osgi/itests-felix/src/test/java/org/
    cxf/trunk/osgi/itests-felix/src/test/java/org/apache/
    cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/
    cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/
    cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/
    cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
    cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
    cxf/trunk/osgi/pom.xml
Removed:
    cxf/trunk/core/src/main/resources/OSGI-INF/blueprint/
Modified:
    cxf/trunk/core/pom.xml
    cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java
    cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/BasicFeatureTest.java
    cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
    cxf/trunk/pom.xml

Modified: cxf/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/core/pom.xml?rev=1552315&r1=1552314&r2=1552315&view=diff
==============================================================================
--- cxf/trunk/core/pom.xml (original)
+++ cxf/trunk/core/pom.xml Thu Dec 19 13:26:25 2013
@@ -56,7 +56,7 @@
             com.sun.xml.bind.api.impl;resolution:=optional,
             com.sun.xml.internal.bind.api;resolution:=optional,
             com.sun.xml.internal.bind.api.impl;resolution:=optional,
-            org.apache.aries*;version="${cxf.aries.version.range}"
+            org.apache.aries*;version="${cxf.aries.version.range}";resolution:=optional
         </cxf.osgi.import>
         <cxf.osgi.dynamic.import>
             org.apache.cxf.bus,org.apache.cxf.*,com.ctc.wstx.*

Added: cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintNameSpaceHandlerFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintNameSpaceHandlerFactory.java?rev=1552315&view=auto
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintNameSpaceHandlerFactory.java
(added)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintNameSpaceHandlerFactory.java
Thu Dec 19 13:26:25 2013
@@ -0,0 +1,30 @@
+/**
+ * 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.cxf.bus.blueprint;
+
+public interface BlueprintNameSpaceHandlerFactory {
+    /**
+     * Creates aries blueprint NamespaceHandler.
+     * The return type is untyped as aries blueprint is an
+     * optional import
+     *  
+     * @return handler
+     */
+    Object createNamespaceHandler();
+}

Added: cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java?rev=1552315&view=auto
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
(added)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
Thu Dec 19 13:26:25 2013
@@ -0,0 +1,51 @@
+/**
+ * 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.cxf.bus.blueprint;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.cxf.common.logging.LogUtils;
+import org.osgi.framework.BundleContext;
+
+public final class NamespaceHandlerRegisterer {
+    private static final Logger LOG = LogUtils.getL7dLogger(NamespaceHandlerRegisterer.class);
+
+    private NamespaceHandlerRegisterer() {
+    }
+
+    public static void register(BundleContext bc, BlueprintNameSpaceHandlerFactory factory,
+                                String... namespaces) {
+        try {
+            Object handler = factory.createNamespaceHandler();
+            for (String namespace : namespaces) {
+                Dictionary<String, String> properties = new Hashtable<String, String>();
+                properties.put("osgi.service.blueprint.namespace", namespace);
+                bc.registerService(NamespaceHandler.class.getName(), handler, properties);
+                LOG.info("Registered blueprint namespace handler for " + namespace);
+            }
+        } catch (Throwable e) {
+            LOG.log(Level.WARNING, "Aries Blueprint packages not available. So namespaces
will not be registered", e);
+        }
+    }
+
+}

Modified: cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java?rev=1552315&r1=1552314&r2=1552315&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java (original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java Thu Dec 19 13:26:25
2013
@@ -23,8 +23,11 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+import org.apache.cxf.bus.blueprint.BlueprintNameSpaceHandlerFactory;
+import org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer;
 import org.apache.cxf.bus.extension.Extension;
 import org.apache.cxf.bus.extension.ExtensionRegistry;
+import org.apache.cxf.internal.CXFAPINamespaceHandler;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -38,8 +41,9 @@ import org.osgi.util.tracker.ServiceTrac
  * Is called in OSGi on start and stop of the cxf bundle.
  * Manages 
  * - CXFBundleListener
- * - Attaching ManagedWorkqueues tio config admin service
+ * - Attaching ManagedWorkqueues to config admin service
  * - OsgiBusListener
+ * - Blueprint namespaces
  */
 public class CXFActivator implements BundleActivator {
     private List<Extension> extensions;
@@ -72,6 +76,21 @@ public class CXFActivator implements Bun
         extensions.add(createOsgiBusListenerExtension(context));
         extensions.add(createManagedWorkQueueListExtension(workQueues));
         ExtensionRegistry.addExtensions(extensions);
+
+        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+            @Override
+            public Object createNamespaceHandler() {
+                return new CXFAPINamespaceHandler();
+            }
+        };
+        NamespaceHandlerRegisterer.register(context, factory,
+                                            "http://cxf.apache.org/blueprint/core",
+                                            "http://cxf.apache.org/configuration/beans",
+                                            "http://cxf.apache.org/configuration/parameterized-types",
+                                            "http://cxf.apache.org/configuration/security",
+                                            "http://schemas.xmlsoap.org/wsdl/");
+
     }
 
     private ServiceRegistration registerManagedServiceFactory(BundleContext context,

Added: cxf/trunk/osgi/itests-felix/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/osgi/itests-felix/pom.xml?rev=1552315&view=auto
==============================================================================
--- cxf/trunk/osgi/itests-felix/pom.xml (added)
+++ cxf/trunk/osgi/itests-felix/pom.xml Thu Dec 19 13:26:25 2013
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <!--
+
+        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.
+    -->
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+    <groupId>org.apache.cxf.osgi.itests</groupId>
+    <artifactId>org.apache.cxf.osgi.itests-felix</artifactId>
+    <name>Apache CXF :: OSGi :: Integration Tests</name>
+    <packaging>jar</packaging>
+    <properties>
+        <pax.exam.version>3.4.0</pax.exam.version>
+        <pax.url.version>1.2.8</pax.url.version>
+    </properties>
+    <dependencies>
+    	<dependency>
+    		<groupId>org.apache.cxf</groupId>
+    		<artifactId>cxf-core</artifactId>
+    		<version>${project.version}</version>
+    	</dependency>
+    	<dependency>
+    		<groupId>org.apache.ws.xmlschema</groupId>
+    		<artifactId>xmlschema-core</artifactId>
+    	</dependency>
+    	
+    	<dependency>
+    		<groupId>org.apache.aries.blueprint</groupId>
+    		<artifactId>org.apache.aries.blueprint.core</artifactId>
+    	</dependency>
+    
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>1.6.0</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>3.2.2</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+        	<groupId>org.osgi</groupId>
+        	<artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+    </dependencies>
+    <build>
+        <plugins>
+            <!-- generate dependencies versions -->
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-depends-file</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java?rev=1552315&view=auto
==============================================================================
--- cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
(added)
+++ cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
Thu Dec 19 13:26:25 2013
@@ -0,0 +1,48 @@
+/**
+ * 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.cxf.osgi.itests;
+
+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.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class NoAriesBlueprintTest extends OSGiTestSupport {
+    @Test
+    public void testCXFCoreBundle() throws Exception {
+        assertBundleStarted("org.apache.cxf.cxf-core");
+    }
+
+    @Configuration
+    public Option[] config() {
+        return new Option[]{
+                mavenBundle().groupId("org.apache.ws.xmlschema").artifactId("xmlschema-core").versionAsInProject(),
+                mavenBundle().groupId("org.apache.cxf").artifactId("cxf-core").versionAsInProject(),
+                junitBundles()
+        };
+    }
+}

Added: cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
URL: http://svn.apache.org/viewvc/cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java?rev=1552315&view=auto
==============================================================================
--- cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
(added)
+++ cxf/trunk/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
Thu Dec 19 13:26:25 2013
@@ -0,0 +1,52 @@
+/**
+ * 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.cxf.osgi.itests;
+
+
+import javax.inject.Inject;
+
+import org.junit.Assert;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * 
+ */
+public class OSGiTestSupport {
+
+    @Inject
+    protected BundleContext bundleContext;
+    
+    protected void assertBundleStarted(String name) {
+        Bundle bundle = findBundleByName(name);
+        Assert.assertNotNull("Bundle " + name + " should be installed", bundle);
+        Assert.assertEquals("Bundle " + name + " should be started", Bundle.ACTIVE, bundle.getState());
+    }
+    
+    protected Bundle findBundleByName(String symbolicName) {
+        for (Bundle bundle : bundleContext.getBundles()) {
+            if (bundle.getSymbolicName().equals(symbolicName)) {
+                return bundle;
+            }
+        }
+        return null;
+    }
+
+}

Modified: cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/BasicFeatureTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/BasicFeatureTest.java?rev=1552315&r1=1552314&r2=1552315&view=diff
==============================================================================
--- cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/BasicFeatureTest.java (original)
+++ cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/BasicFeatureTest.java Thu
Dec 19 13:26:25 2013
@@ -36,10 +36,12 @@ import static org.ops4j.pax.exam.karaf.o
 public class BasicFeatureTest extends CXFOSGiTestSupport {
     @Test
     public void testCXFFeaturesModule() throws Exception {
-        assertBundleInstalled("org.apache.cxf.cxf-core");
-        assertBlueprintNameSpacePublished("http://cxf.apache.org/blueprint/core");
-        assertBlueprintNameSpacePublished("http://cxf.apache.org/configuration/beans");
-        assertBlueprintNameSpacePublished("http://cxf.apache.org/configuration/parameterized-types");
+        assertBundleStarted("org.apache.cxf.cxf-core");
+        assertBlueprintNameSpacePublished("http://cxf.apache.org/blueprint/core", 1000);
+        assertBlueprintNameSpacePublished("http://cxf.apache.org/configuration/beans", 1000);
+        assertBlueprintNameSpacePublished("http://cxf.apache.org/configuration/parameterized-types",
1000);
+        assertBlueprintNameSpacePublished("http://cxf.apache.org/configuration/security",
1000);
+        assertBlueprintNameSpacePublished("http://schemas.xmlsoap.org/wsdl/", 1000);
     }
 
     @Configuration

Modified: cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
URL: http://svn.apache.org/viewvc/cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java?rev=1552315&r1=1552314&r2=1552315&view=diff
==============================================================================
--- cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
(original)
+++ cxf/trunk/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
Thu Dec 19 13:26:25 2013
@@ -39,7 +39,6 @@ import java.util.concurrent.TimeUnit;
 
 import javax.inject.Inject;
 
-import org.apache.aries.blueprint.NamespaceHandler;
 import org.apache.felix.service.command.CommandProcessor;
 import org.apache.felix.service.command.CommandSession;
 import org.apache.karaf.features.FeaturesService;
@@ -343,7 +342,7 @@ public class CXFOSGiTestSupport {
         return references != null ? Arrays.asList(references) : Collections.<ServiceReference>emptyList();
     }
     
-    protected void assertBundleInstalled(String name) {
+    protected void assertBundleStarted(String name) {
         Bundle bundle = findBundleByName(name);
         Assert.assertNotNull("Bundle " + name + " should be installed", bundle);
         Assert.assertEquals("Bundle " + name + " should be started", Bundle.ACTIVE, bundle.getState());
@@ -358,18 +357,26 @@ public class CXFOSGiTestSupport {
         return null;
     }
     
-    public void assertServicePublished(String filter) {
+    @SuppressWarnings({
+        "rawtypes", "unchecked"
+    })
+    public void assertServicePublished(String filter, int timeout) {
         try {
             Filter serviceFilter = bundleContext.createFilter(filter);
-            ServiceTracker<?, ?> tracker = new ServiceTracker<Object, Object>(bundleContext,
serviceFilter, null);
-            tracker.waitForService(SERVICE_TIMEOUT);
+            ServiceTracker tracker = new ServiceTracker(bundleContext, serviceFilter, null);
+            tracker.open();
+            Object service = tracker.waitForService(timeout);
+            tracker.close();
+            if (service == null) {
+                throw new IllegalStateException("Expected service with filter " + filter
+ " was not found");
+            }
         } catch (Exception e) {
             throw new RuntimeException("Unexpected exception occured" , e);
         }
     }
     
-    public void assertBlueprintNameSpacePublished(String namespace) {
-        assertServicePublished(String.format("(&(objectClass=%s)(osgi.service.blueprint.namespace='%s'))",

-                                             NamespaceHandler.class.getName(), namespace));
+    public void assertBlueprintNameSpacePublished(String namespace, int timeout) {
+        assertServicePublished(String.format("(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)"
+                                             + "(osgi.service.blueprint.namespace=%s))",
namespace), timeout);
     }
 }

Added: cxf/trunk/osgi/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/osgi/pom.xml?rev=1552315&view=auto
==============================================================================
--- cxf/trunk/osgi/pom.xml (added)
+++ cxf/trunk/osgi/pom.xml Thu Dec 19 13:26:25 2013
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>cxf-osgi</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache CXF OSGi parent</name>
+    <description>Apache CXF OSGi parent</description>
+    <url>http://cxf.apache.org</url>
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+    <modules>
+        <module>bundle</module>
+        <module>itests</module>
+        <module>itests-felix</module>
+        <module>karaf</module>
+    </modules>
+</project>

Modified: cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/pom.xml?rev=1552315&r1=1552314&r2=1552315&view=diff
==============================================================================
--- cxf/trunk/pom.xml (original)
+++ cxf/trunk/pom.xml Thu Dec 19 13:26:25 2013
@@ -171,8 +171,7 @@
         <module>integration</module>
         <module>maven-plugins</module>
         <module>services</module>
-        <module>osgi/karaf</module>
-        <module>osgi/bundle</module>
+        <module>osgi</module>
         <module>systests</module>
     </modules>
     <profiles>



Mime
View raw message