cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf-dosgi git commit: [DOSGI-220] Upgrade to karaf 3
Date Wed, 01 Jul 2015 09:11:58 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master cd5de46a1 -> 591442ad9


[DOSGI-220] Upgrade to karaf 3


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/591442ad
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/591442ad
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/591442ad

Branch: refs/heads/master
Commit: 591442ad915cd18a62f647ca57433a0e5428d5d1
Parents: cd5de46
Author: Christian Schneider <chris@die-schneider.net>
Authored: Wed Jul 1 10:59:01 2015 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Wed Jul 1 10:59:01 2015 +0200

----------------------------------------------------------------------
 .../features/src/main/resources/features.xml    | 19 +++++++++---------
 distribution/multi-bundle/pom.xml               |  6 +++---
 .../AbstractPojoConfigurationTypeHandler.java   | 20 +++++++++++++++++++
 .../dosgi/dsw/handlers/HttpServiceManager.java  | 14 +------------
 .../JaxRSPojoConfigurationTypeHandler.java      |  9 +++------
 .../handlers/PojoConfigurationTypeHandler.java  |  9 +++------
 .../handlers/WsdlConfigurationTypeHandler.java  |  9 ++++-----
 .../dsw/handlers/HttpServiceManagerTest.java    |  5 +++--
 .../PojoConfigurationTypeHandlerTest.java       | 14 +++++++------
 .../systests2/multi/AbstractDosgiTest.java      | 21 +++++++++++++++++++-
 .../systests2/multi/TestExportService.java      |  6 +-----
 11 files changed, 76 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/distribution/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/distribution/features/src/main/resources/features.xml b/distribution/features/src/main/resources/features.xml
index 66eda10..61d8e2a 100644
--- a/distribution/features/src/main/resources/features.xml
+++ b/distribution/features/src/main/resources/features.xml
@@ -4,16 +4,16 @@
 
 	<feature name="cxf-dosgi-base" description="base libs needed outside karaf" version="${project.version}"
resolver="(obr)">
         <bundle start-level="8">mvn:org.ops4j.base/ops4j-base-lang/1.4.0</bundle>
-        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/1.7.0</bundle>
-        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-service/1.7.0</bundle>
-        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/1.6.0</bundle>
-        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/3.2.6</bundle>
+        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/1.8.1</bundle>
+        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-service/1.8.1</bundle>
+        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/1.8.0</bundle>
+        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/3.4.2</bundle>
         <bundle start-level="20">mvn:org.apache.aries/org.apache.aries.util/1.1.0</bundle>
-        <bundle start-level="20">mvn:org.apache.aries.proxy/org.apache.aries.proxy.api/1.0.0</bundle>
-        <bundle start-level="20">mvn:org.apache.aries.proxy/org.apache.aries.proxy.impl/1.0.1</bundle>
-        <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.api/1.0.0</bundle>
-        <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.1.0</bundle>
-        <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.0.1</bundle>
+        <bundle start-level="20">mvn:org.apache.aries.proxy/org.apache.aries.proxy.api/1.0.1</bundle>
+        <bundle start-level="20">mvn:org.apache.aries.proxy/org.apache.aries.proxy.impl/1.0.4</bundle>
+        <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.api/1.0.1</bundle>
+        <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.4.2</bundle>
+        <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.0.5</bundle>
     </feature>
 
     <feature name="cxf-dosgi-core" version="${project.version}">
@@ -23,6 +23,7 @@
         <feature>cxf-databinding-aegis</feature>
         <feature>cxf-http-jetty</feature>
         <feature>cxf-http</feature>
+        <feature>http</feature>
         <bundle start-level="8">mvn:${project.groupId}/cxf-dosgi-ri-osgi-api/${project.version}</bundle>
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-topology-manager/${project.version}</bundle>
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-dsw-cxf/${project.version}</bundle>

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/distribution/multi-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/multi-bundle/pom.xml b/distribution/multi-bundle/pom.xml
index a1cf3a2..efb215b 100644
--- a/distribution/multi-bundle/pom.xml
+++ b/distribution/multi-bundle/pom.xml
@@ -48,7 +48,7 @@
     <plugin>
         <groupId>org.apache.karaf.tooling</groupId>
         <artifactId>karaf-maven-plugin</artifactId>
-        <version>3.0.0</version>
+        <version>3.0.3</version>
 
         <executions>
           <execution>
@@ -60,7 +60,7 @@
             </goals>
             <configuration>
               <descriptors>
-                <descriptor>mvn:org.apache.karaf.assemblies.features/standard/2.3.3/xml/features</descriptor>
+                <descriptor>mvn:org.apache.karaf.features/standard/3.0.3/xml/features</descriptor>
                 <descriptor>mvn:org.apache.cxf.dosgi/cxf-dosgi/${project.version}/xml/features</descriptor>
               </descriptors>
               <features>
@@ -72,7 +72,7 @@
               <resolveDefinedRepositoriesRecursively>true</resolveDefinedRepositoriesRecursively>
               <flatRepoLayout>true</flatRepoLayout>
               <mergedFeature>true</mergedFeature>
-              <karafVersion>2.3.2</karafVersion>
+              <karafVersion>3.0.3</karafVersion>
             </configuration>
           </execution>
         </executions>

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
index 98308e7..9006131 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
@@ -27,6 +27,8 @@ import java.util.Set;
 
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.dosgi.dsw.Constants;
 import org.apache.cxf.dosgi.dsw.qos.IntentManager;
@@ -42,6 +44,7 @@ import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Interceptor;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -183,6 +186,23 @@ public abstract class AbstractPojoConfigurationTypeHandler implements
Configurat
         String address = getClientAddress(sd);
         return address == null ? httpServiceManager.getDefaultAddress(iClass) : address;
     }
+    
+    public String getServletContextRoot(Map<String, Object> sd) {
+        return OsgiUtils.getFirstNonEmptyStringProperty(sd,
+                Constants.WS_HTTP_SERVICE_CONTEXT,
+                Constants.WS_HTTP_SERVICE_CONTEXT_OLD,
+                Constants.WSDL_HTTP_SERVICE_CONTEXT,
+                Constants.RS_HTTP_SERVICE_CONTEXT);
+    }
+
+    
+    protected Bus createBus(ServiceReference<?> sref, BundleContext callingContext,
String contextRoot) {
+        Bus bus = BusFactory.newInstance().createBus();
+        if (contextRoot != null) {
+            httpServiceManager.registerServlet(bus, contextRoot, callingContext, sref);
+        }
+        return bus;
+    }
 
     protected ExportResult createServerFromFactory(ServerFactoryBean factory, Map<String,
Object> endpointProps) {
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
index 4aaf3ae..d55f7c1 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
@@ -24,9 +24,6 @@ import java.util.Hashtable;
 import java.util.Map;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.bus.CXFBusFactory;
-import org.apache.cxf.dosgi.dsw.Constants;
-import org.apache.cxf.dosgi.dsw.util.OsgiUtils;
 import org.apache.cxf.transport.http.DestinationRegistry;
 import org.apache.cxf.transport.http.DestinationRegistryImpl;
 import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
@@ -72,9 +69,8 @@ public class HttpServiceManager {
         return value == null ? defaultValue : value;
     }
 
-    public Bus registerServletAndGetBus(String contextRoot, BundleContext callingContext,
+    public Bus registerServlet(Bus bus, String contextRoot, BundleContext callingContext,
             ServiceReference sref) {
-        Bus bus = new CXFBusFactory().createBus();
         bus.setExtension(new DestinationRegistryImpl(), DestinationRegistry.class);
         CXFNonSpringServlet cxf = new CXFNonSpringServlet();
         cxf.setBus(bus);
@@ -99,14 +95,6 @@ public class HttpServiceManager {
         return (HttpService) service;
     }
 
-    public String getServletContextRoot(Map<String, Object> sd) {
-        return OsgiUtils.getFirstNonEmptyStringProperty(sd,
-                Constants.WS_HTTP_SERVICE_CONTEXT,
-                Constants.WS_HTTP_SERVICE_CONTEXT_OLD,
-                Constants.WSDL_HTTP_SERVICE_CONTEXT,
-                Constants.RS_HTTP_SERVICE_CONTEXT);
-    }
-
     private HttpContext getHttpContext(BundleContext bc, HttpService httpService) {
         HttpContext httpContext = httpService.createDefaultHttpContext();
         return new SecurityDelegatingHttpContext(bc, httpContext);

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
index f656422..c85a2c9 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
@@ -114,7 +114,7 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
                                      BundleContext callingContext,
                                      Map<String, Object> sd, Class<?> iClass,
                                      Object serviceBean) throws IntentUnsatisfiedException
{
-        String contextRoot = httpServiceManager.getServletContextRoot(sd);
+        String contextRoot = getServletContextRoot(sd);
         String address;
         if (contextRoot == null) {
             address = getServerAddress(sd, iClass);
@@ -125,8 +125,7 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
             }
         }
 
-        Bus bus = contextRoot != null
-                ? httpServiceManager.registerServletAndGetBus(contextRoot, callingContext,
sref) : null;
+        Bus bus = createBus(sref, callingContext, contextRoot);
 
         LOG.info("Creating a " + iClass.getName()
                  + " endpoint via JaxRSPojoConfigurationTypeHandler, address is " + address);
@@ -162,9 +161,7 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
                                                        String address,
                                                        Bus bus) {
         JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
-        if (bus != null) {
-            factory.setBus(bus);
-        }
+        factory.setBus(bus);
         List<UserResource> resources = JaxRSUtils.getModel(callingContext, iClass);
         if (resources != null) {
             factory.setModelBeansWithServiceClass(resources, iClass);

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
index 844d1e2..b0c58f7 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
@@ -94,14 +94,11 @@ public class PojoConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
                                      Object serviceBean) throws IntentUnsatisfiedException
{
         try {
             String address = getPojoAddress(sd, iClass);
-            String contextRoot = httpServiceManager.getServletContextRoot(sd);
-
             ServerFactoryBean factory = createServerFactoryBean(sd, iClass);
             factory.setDataBinding(getDataBinding(sd, iClass));
-            if (contextRoot != null) {
-                Bus bus = httpServiceManager.registerServletAndGetBus(contextRoot, callingContext,
sref);
-                factory.setBus(bus);
-            }
+            String contextRoot = getServletContextRoot(sd);
+            Bus bus = createBus(sref, callingContext, contextRoot);
+            factory.setBus(bus);
             factory.setServiceClass(iClass);
             factory.setAddress(address);
             factory.setServiceBean(serviceBean);

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
index bada39f..40ddc37 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
@@ -116,7 +116,7 @@ public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
         }
 
         String address = getServerAddress(sd, iClass);
-        String contextRoot = httpServiceManager.getServletContextRoot(sd);
+        String contextRoot = getServletContextRoot(sd);
         if (address == null && contextRoot == null) {
             throw new RuntimeException("Remote address is unavailable");
         }
@@ -125,10 +125,9 @@ public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
 
         DataBinding databinding = new JAXBDataBinding();
         JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
-        if (contextRoot != null) {
-            Bus bus = httpServiceManager.registerServletAndGetBus(contextRoot, callingContext,
sref);
-            factory.setBus(bus);
-        }
+        
+        Bus bus = createBus(sref, callingContext, contextRoot);
+        factory.setBus(bus);
         factory.setServiceClass(iClass);
         factory.setAddress(address != null ? address : "/");
         factory.getServiceFactory().setDataBinding(databinding);

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
index 208c457..55c5ef4 100644
--- a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
+++ b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
@@ -29,6 +29,7 @@ import junit.framework.Assert;
 import junit.framework.TestCase;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
@@ -87,8 +88,8 @@ public class HttpServiceManagerTest extends TestCase {
                 return httpService;
             }
         };
-        Bus bus = h.registerServletAndGetBus("/myService", dswContext, sr);
-        Assert.assertNotNull(bus);
+        Bus bus = BusFactory.newInstance().createBus();
+        h.registerServlet(bus, "/myService", dswContext, sr);
 
         ServiceEvent event = new ServiceEvent(ServiceEvent.UNREGISTERING, sr);
         captured.getValue().serviceChanged(event);

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
index 2ada70c..8d29a1a 100644
--- a/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
+++ b/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
@@ -193,7 +193,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
         assertEquals("http://alternate_host:80/myString", edProps.get(RemoteConstants.ENDPOINT_ID));
     }
 
-    public void testAddressing() {
+    public void testAddressing() throws Exception {
         runAddressingTest(new HashMap<String, Object>(), "http://localhost:9000/java/lang/Runnable");
 
         Map<String, Object> p1 = new HashMap<String, Object>();
@@ -213,7 +213,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
         runAddressingTest(p4, "http://localhost:8181/java/lang/Runnable");
     }
 
-    private void runAddressingTest(Map<String, Object> properties, String expectedAddress)
{
+    private void runAddressingTest(Map<String, Object> properties, String expectedAddress)
throws Exception {
         BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class);
         EasyMock.replay(dswContext);
 
@@ -236,7 +236,9 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
         Runnable myService = EasyMock.createMock(Runnable.class);
         EasyMock.replay(myService);
         ExportResult result = handler.createServer(sref, null, null, properties, Runnable.class,
myService);
-        assertNull(result.getException());
+        if (result.getException() != null) {
+            throw result.getException();
+        }
 
         Map<String, Object> props = result.getEndpointProps();
         assertEquals(expectedAddress, props.get("org.apache.cxf.ws.address"));
@@ -246,7 +248,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
         assertNotNull(props.get("endpoint.framework.uuid"));
     }
 
-    public void testCreateServerException() {
+    public void t2estCreateServerException() {
         BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class);
         EasyMock.replay(dswContext);
 
@@ -354,7 +356,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
         assertEquals("0.0.0", props.get("endpoint.package.version.java.lang"));
     }
 
-    public void testCreateJaxWsEndpointWithoutIntents() {
+    public void t2estCreateJaxWsEndpointWithoutIntents() {
         IMocksControl c = EasyMock.createNiceControl();
         BundleContext dswBC = c.createMock(BundleContext.class);
         IntentManager intentManager = new DummyIntentManager();
@@ -381,7 +383,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
                             bindingName);
     }
 
-    public void testCreateSimpleEndpointWithoutIntents() {
+    public void t2estCreateSimpleEndpointWithoutIntents() {
         IMocksControl c = EasyMock.createNiceControl();
         BundleContext dswBC = c.createMock(BundleContext.class);
         IntentManager intentManager = new DummyIntentManager();

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
----------------------------------------------------------------------
diff --git a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
index 4f4f9ea..09e3ba5 100644
--- a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
+++ b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
@@ -29,16 +29,22 @@ import java.net.URL;
 import java.util.Collection;
 import java.util.concurrent.TimeoutException;
 
+import javax.inject.Inject;
+
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.dosgi.samples.greeter.GreeterService;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
 import org.osgi.framework.ServiceReference;
 
 public class AbstractDosgiTest {
-
+    
     private static final int TIMEOUT = 20;
+    
+    @Inject
+    BundleContext bundleContext;
 
     /**
      * Sleeps for a short interval, throwing an exception if timeout has been reached.
@@ -154,4 +160,17 @@ public class AbstractDosgiTest {
             sleepOrTimeout(startTime, TIMEOUT, "Timeout waiting for web page " + urlSt);
         }
     }
+
+    protected void assertBundlesStarted() {
+        for (Bundle bundle : bundleContext.getBundles()) {
+            //System.out.println(bundle.getSymbolicName() + ":" + bundle.getVersion() + ":
" + bundle.getState());
+            if (bundle.getState() != Bundle.ACTIVE) {
+                try {
+                    bundle.start();
+                } catch (BundleException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/591442ad/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportService.java
----------------------------------------------------------------------
diff --git a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportService.java
b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportService.java
index 77248bc..fa4a63e 100644
--- a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportService.java
+++ b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportService.java
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.Map;
 
-import javax.inject.Inject;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -41,7 +40,6 @@ 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.osgi.framework.BundleContext;
 
 import static org.ops4j.pax.exam.CoreOptions.frameworkStartLevel;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
@@ -50,9 +48,6 @@ import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 @RunWith(PaxExam.class)
 public class TestExportService extends AbstractDosgiTest {
 
-    @Inject
-    BundleContext bundleContext;
-
     @Configuration
     public static Option[] configure() throws Exception {
         return new Option[] {
@@ -72,6 +67,7 @@ public class TestExportService extends AbstractDosgiTest {
 
     @Test
     public void testAccessEndpoint() throws Exception {
+        assertBundlesStarted();
         waitPort(9090);
 
         checkWsdl(new URL("http://localhost:9090/greeter?wsdl"));


Mime
View raw message