Repository: cxf-dosgi Updated Branches: refs/heads/master ccf5a7a73 -> f0dea5061
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java ---------------------------------------------------------------------- diff --git a/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java new file mode 100644 index 0000000..050c642 --- /dev/null +++ b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java @@ -0,0 +1,229 @@ +/** + * 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.dosgi.dsw.handlers.rest; + +import static org.apache.cxf.dosgi.common.util.OsgiUtils.getMultiValueProperty; +import static org.osgi.service.remoteserviceadmin.RemoteConstants.REMOTE_CONFIGS_SUPPORTED; +import static org.osgi.service.remoteserviceadmin.RemoteConstants.REMOTE_INTENTS_SUPPORTED; + +import java.net.URL; +import java.util.Collection; +import java.util.Map; + +import org.apache.aries.rsa.spi.DistributionProvider; +import org.apache.aries.rsa.spi.Endpoint; +import org.apache.aries.rsa.spi.IntentUnsatisfiedException; +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.apache.cxf.common.util.ProxyClassLoader; +import org.apache.cxf.dosgi.common.httpservice.HttpServiceManager; +import org.apache.cxf.dosgi.common.intent.IntentManager; +import org.apache.cxf.dosgi.common.proxy.ProxyFactory; +import org.apache.cxf.dosgi.common.util.OsgiUtils; +import org.apache.cxf.dosgi.common.util.ServerWrapper; +import org.apache.cxf.endpoint.AbstractEndpointFactory; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.jaxrs.client.Client; +import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean; +import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.remoteserviceadmin.EndpointDescription; +import org.osgi.service.remoteserviceadmin.RemoteConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Component(property = // +{// + REMOTE_CONFIGS_SUPPORTED + "=" + RsConstants.RS_CONFIG_TYPE, + REMOTE_INTENTS_SUPPORTED + "=" +}) +public class RsProvider implements DistributionProvider { + + private static final Logger LOG = LoggerFactory.getLogger(RsProvider.class); + private IntentManager intentManager; + private HttpServiceManager httpServiceManager; + + @Reference + public void setHttpServiceManager(HttpServiceManager httpServiceManager) { + this.httpServiceManager = httpServiceManager; + } + + @Reference + public void setIntentManager(IntentManager intentManager) { + this.intentManager = intentManager; + } + + public String[] getSupportedTypes() { + return new String[] {RsConstants.RS_CONFIG_TYPE}; + } + + @SuppressWarnings("rawtypes") + public Object importEndpoint(ClassLoader consumerLoader, + BundleContext consumerContext, + Class[] interfaces, + EndpointDescription endpoint) { + intentManager.assertAllIntentsSupported(endpoint.getProperties()); + Class<?> iClass = interfaces[0]; + String address = OsgiUtils.getProperty(endpoint, RsConstants.RS_ADDRESS_PROPERTY); + if (address == null) { + LOG.warn("Remote address is unavailable"); + return null; + } + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(JAXRSClientFactoryBean.class.getClassLoader()); + return createJaxrsProxy(address, consumerContext, iClass, null, endpoint); + } catch (Throwable e) { + Thread.currentThread().setContextClassLoader(oldClassLoader); + } + + try { + ProxyClassLoader cl = new ProxyClassLoader(iClass.getClassLoader()); + cl.addLoader(Client.class.getClassLoader()); + return createJaxrsProxy(address, consumerContext, iClass, cl, endpoint); + } catch (Throwable e) { + LOG.warn("proxy creation failed", e); + } + + return null; + } + + protected Object createJaxrsProxy(String address, + BundleContext callingContext, + Class<?> iClass, + ClassLoader loader, + EndpointDescription endpoint) { + JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); + bean.setAddress(address); + if (loader != null) { + bean.setClassLoader(loader); + } + addContextProperties(bean, endpoint.getProperties(), RsConstants.RS_CONTEXT_PROPS_PROP_KEY); + bean.setServiceClass(iClass); + intentManager.applyIntents(bean.getFeatures(), bean, endpoint.getProperties()); + return ProxyFactory.create(bean.create(), iClass); + } + + @SuppressWarnings("rawtypes") + public Endpoint exportService(Object serviceBean, + BundleContext callingContext, + Map<String, Object> endpointProps, + Class[] exportedInterfaces) throws IntentUnsatisfiedException { + if (!configTypeSupported(endpointProps, RsConstants.RS_CONFIG_TYPE)) { + return null; + } + String contextRoot = OsgiUtils.getProperty(endpointProps, RsConstants.RS_HTTP_SERVICE_CONTEXT); + String address; + Class<?> iClass = exportedInterfaces[0]; + if (contextRoot == null) { + address = getServerAddress(endpointProps, iClass); + } else { + address = OsgiUtils.getProperty(endpointProps, RsConstants.RS_ADDRESS_PROPERTY); + if (address == null) { + address = "/"; + } + } + final Long sid = (Long) endpointProps.get(RemoteConstants.ENDPOINT_SERVICE_ID); + intentManager.assertAllIntentsSupported(endpointProps); + Bus bus = BusFactory.newInstance().createBus(); + if (contextRoot != null) { + httpServiceManager.registerServlet(bus, contextRoot, callingContext, sid); + } + LOG.info("Creating JAXRS endpoint for " + iClass.getName() + " with address " + address); + + JAXRSServerFactoryBean factory = createServerFactory(callingContext, endpointProps, + iClass, serviceBean, address, bus); + String[] intents = intentManager.applyIntents(factory.getFeatures(), factory, endpointProps); + String completeEndpointAddress = httpServiceManager.getAbsoluteAddress(contextRoot, address); + EndpointDescription epd = createEndpointDesc(endpointProps, new String[] {RsConstants.RS_CONFIG_TYPE}, + completeEndpointAddress, intents); + return createServerFromFactory(factory, epd); + } + + private boolean configTypeSupported(Map<String, Object> endpointProps, String configType) { + Collection<String> configs = getMultiValueProperty(endpointProps.get(RemoteConstants.SERVICE_EXPORTED_CONFIGS)); + return configs == null || configs.isEmpty() || configs.contains(configType); + } + + private Endpoint createServerFromFactory(JAXRSServerFactoryBean factory, + EndpointDescription epd) { + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(JAXRSServerFactoryBean.class.getClassLoader()); + Server server = factory.create(); + return new ServerWrapper(epd, server); + } finally { + Thread.currentThread().setContextClassLoader(oldClassLoader); + } + } + + private JAXRSServerFactoryBean createServerFactory(BundleContext callingContext, + Map<String, Object> sd, + Class<?> iClass, + Object serviceBean, + String address, + Bus bus) { + JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean(); + factory.setBus(bus); + factory.setServiceClass(iClass); + factory.setResourceProvider(iClass, new SingletonResourceProvider(serviceBean)); + factory.setAddress(address); + addContextProperties(factory, sd, RsConstants.RS_CONTEXT_PROPS_PROP_KEY); + String location = OsgiUtils.getProperty(sd, RsConstants.RS_WADL_LOCATION); + setWadlLocation(callingContext, factory, location); + return factory; + } + + private void setWadlLocation(BundleContext callingContext, JAXRSServerFactoryBean factory, + String location) { + if (location != null) { + URL wadlURL = callingContext.getBundle().getResource(location); + if (wadlURL != null) { + factory.setDocLocation(wadlURL.toString()); + } + } + } + + protected EndpointDescription createEndpointDesc(Map<String, Object> props, + String[] importedConfigs, + String address, + String[] intents) { + props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, importedConfigs); + props.put(RsConstants.RS_ADDRESS_PROPERTY, address); + props.put(RemoteConstants.SERVICE_INTENTS, intents); + props.put(RemoteConstants.ENDPOINT_ID, address); + return new EndpointDescription(props); + } + + protected String getServerAddress(Map<String, Object> sd, Class<?> iClass) { + String address = OsgiUtils.getProperty(sd, RsConstants.RS_ADDRESS_PROPERTY); + return address == null ? httpServiceManager.getDefaultAddress(iClass) : address; + } + + private static void addContextProperties(AbstractEndpointFactory factory, Map<String, Object> sd, String propName) { + @SuppressWarnings("unchecked") + Map<String, Object> props = (Map<String, Object>)sd.get(propName); + if (props != null) { + factory.getProperties(true).putAll(props); + } + } +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/bnd.bnd ---------------------------------------------------------------------- diff --git a/provider-ws/bnd.bnd b/provider-ws/bnd.bnd new file mode 100644 index 0000000..99f067a --- /dev/null +++ b/provider-ws/bnd.bnd @@ -0,0 +1,3 @@ +Import-Package: javax.servlet;version='[2,4)', javax.servlet.http;version='[2,4)', * + +Private-Package: org.apache.cxf.dosgi.dsw.* http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/pom.xml ---------------------------------------------------------------------- diff --git a/provider-ws/pom.xml b/provider-ws/pom.xml new file mode 100644 index 0000000..21e741f --- /dev/null +++ b/provider-ws/pom.xml @@ -0,0 +1,61 @@ +<?xml version='1.0' encoding='UTF-8' ?> +<!-- + 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-dosgi-ri-provider-ws</artifactId> + <packaging>bundle</packaging> + <name>CXF dOSGi provider ws</name> + + <parent> + <groupId>org.apache.cxf.dosgi</groupId> + <artifactId>cxf-dosgi-ri-parent</artifactId> + <version>2.0-SNAPSHOT</version> + <relativePath>../parent/pom.xml</relativePath> + </parent> + + <properties> + <topDirectoryLocation>..</topDirectoryLocation> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.cxf.dosgi</groupId> + <artifactId>cxf-dosgi-ri-common</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-core</artifactId> + <version>${cxf.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxws</artifactId> + <version>${cxf.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-databinding-aegis</artifactId> + <version>${cxf.version}</version> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsConstants.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsConstants.java b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsConstants.java new file mode 100644 index 0000000..196a0e5 --- /dev/null +++ b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsConstants.java @@ -0,0 +1,46 @@ +/** + * 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.dosgi.dsw.handlers.ws; + +public final class WsConstants { + public static final String WS_CONFIG_TYPE = "org.apache.cxf" + ".ws"; + public static final String WS_ADDRESS_PROPERTY = WS_CONFIG_TYPE + ".address"; + public static final String WS_PORT_PROPERTY = WS_CONFIG_TYPE + ".port"; + public static final String WS_HTTP_SERVICE_CONTEXT = WS_CONFIG_TYPE + ".httpservice.context"; + + public static final String WS_FRONTEND_PROP_KEY = WS_CONFIG_TYPE + ".frontend"; + public static final String WS_FRONTEND_JAXWS = "jaxws"; + public static final String WS_FRONTEND_SIMPLE = "simple"; + + public static final String WS_CONTEXT_PROPS_PROP_KEY = WS_CONFIG_TYPE + ".context.properties"; + + public static final String WS_DATABINDING_PROP_KEY = WS_CONFIG_TYPE + ".databinding"; + public static final String WS_DATABINDING_BEAN_PROP_KEY = WS_DATABINDING_PROP_KEY + ".bean"; + public static final String WS_DATA_BINDING_JAXB = "jaxb"; + public static final String WS_DATA_BINDING_AEGIS = "aegis"; + + public static final String WS_WSDL_SERVICE_NAMESPACE = WS_CONFIG_TYPE + ".service.ns"; + public static final String WS_WSDL_SERVICE_NAME = WS_CONFIG_TYPE + ".service.name"; + public static final String WS_WSDL_PORT_NAME = WS_CONFIG_TYPE + ".port.name"; + public static final String WS_WSDL_LOCATION = WS_CONFIG_TYPE + ".wsdl.location"; + + private WsConstants() { + // never constructed + } +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java new file mode 100644 index 0000000..e4cbcdc --- /dev/null +++ b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java @@ -0,0 +1,244 @@ +/** + * 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.dosgi.dsw.handlers.ws; + +import static org.apache.cxf.dosgi.common.util.OsgiUtils.getMultiValueProperty; +import static org.osgi.service.remoteserviceadmin.RemoteConstants.REMOTE_CONFIGS_SUPPORTED; +import static org.osgi.service.remoteserviceadmin.RemoteConstants.REMOTE_INTENTS_SUPPORTED; + +import java.util.Collection; +import java.util.Map; + +import javax.jws.WebService; + +import org.apache.aries.rsa.spi.DistributionProvider; +import org.apache.aries.rsa.spi.Endpoint; +import org.apache.aries.rsa.spi.IntentUnsatisfiedException; +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.apache.cxf.aegis.databinding.AegisDatabinding; +import org.apache.cxf.binding.soap.SoapBindingConfiguration; +import org.apache.cxf.databinding.DataBinding; +import org.apache.cxf.dosgi.common.httpservice.HttpServiceManager; +import org.apache.cxf.dosgi.common.intent.IntentManager; +import org.apache.cxf.dosgi.common.proxy.ProxyFactory; +import org.apache.cxf.dosgi.common.util.OsgiUtils; +import org.apache.cxf.dosgi.common.util.ServerWrapper; +import org.apache.cxf.endpoint.AbstractEndpointFactory; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.frontend.ClientProxyFactoryBean; +import org.apache.cxf.frontend.ServerFactoryBean; +import org.apache.cxf.jaxb.JAXBDataBinding; +import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; +import org.apache.cxf.jaxws.JaxWsServerFactoryBean; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.remoteserviceadmin.EndpointDescription; +import org.osgi.service.remoteserviceadmin.RemoteConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Component(configurationPid = "cxf-dsw", property = // +{// + REMOTE_CONFIGS_SUPPORTED + "=" + WsConstants.WS_CONFIG_TYPE, + REMOTE_INTENTS_SUPPORTED + "=" +}) +public class WsProvider implements DistributionProvider { + private static final Logger LOG = LoggerFactory.getLogger(WsProvider.class); + protected BundleContext bundleContext; + protected IntentManager intentManager; + protected HttpServiceManager httpServiceManager; + + @Reference + public void setHttpServiceManager(HttpServiceManager httpServiceManager) { + this.httpServiceManager = httpServiceManager; + } + + @Reference + public void setIntentManager(IntentManager intentManager) { + this.intentManager = intentManager; + } + + @Activate + public void activate(BundleContext context) { + this.bundleContext = context; + } + + public String[] getSupportedTypes() { + return new String[] {WsConstants.WS_CONFIG_TYPE}; + } + + @SuppressWarnings("rawtypes") + public Object importEndpoint(ClassLoader consumerLoader, + BundleContext consumerContext, + Class[] interfaces, + EndpointDescription endpoint) throws IntentUnsatisfiedException { + Class<?> iClass = interfaces[0]; + Map<String, Object> sd = endpoint.getProperties(); + String address = getClientAddress(sd); + LOG.info("Creating a " + iClass.getName() + " client, endpoint address is " + address); + + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + try { + ClientProxyFactoryBean factory = createClientProxyFactoryBean(sd, iClass); + factory.setDataBinding(getDataBinding(sd, iClass)); + factory.setBindingConfig(new SoapBindingConfiguration()); + factory.setServiceClass(iClass); + factory.setAddress(address); + addContextProperties(factory.getClientFactoryBean(), sd, WsConstants.WS_CONTEXT_PROPS_PROP_KEY); + WsdlSupport.setWsdlProperties(factory.getClientFactoryBean(), bundleContext, sd); + + intentManager.assertAllIntentsSupported(sd); + intentManager.applyIntents(factory.getFeatures(), factory.getClientFactoryBean(), sd); + + Thread.currentThread().setContextClassLoader(ClientProxyFactoryBean.class.getClassLoader()); + return ProxyFactory.create(factory.create(), iClass); + } catch (Exception e) { + LOG.warn("proxy creation failed", e); + } finally { + Thread.currentThread().setContextClassLoader(oldClassLoader); + } + return null; + } + + @SuppressWarnings("rawtypes") + public Endpoint exportService(Object serviceO, + BundleContext serviceContext, + Map<String, Object> endpointProps, + Class[] exportedInterfaces) throws IntentUnsatisfiedException { + if (!configTypeSupported(endpointProps, WsConstants.WS_CONFIG_TYPE)) { + return null; + } + Class<?> iClass = exportedInterfaces[0]; + String address = getPojoAddress(endpointProps, iClass); + ServerFactoryBean factory = createServerFactoryBean(endpointProps, iClass); + String contextRoot = OsgiUtils.getProperty(endpointProps, WsConstants.WS_HTTP_SERVICE_CONTEXT); + + final Long sid = (Long) endpointProps.get(RemoteConstants.ENDPOINT_SERVICE_ID); + intentManager.assertAllIntentsSupported(endpointProps); + Bus bus = createBus(sid, serviceContext, contextRoot); + factory.setDataBinding(getDataBinding(endpointProps, iClass)); + factory.setBindingConfig(new SoapBindingConfiguration()); + factory.setBus(bus); + factory.setServiceClass(iClass); + factory.setAddress(address); + factory.setServiceBean(serviceO); + addContextProperties(factory, endpointProps, WsConstants.WS_CONTEXT_PROPS_PROP_KEY); + WsdlSupport.setWsdlProperties(factory, serviceContext, endpointProps); + String[] intents = intentManager.applyIntents(factory.getFeatures(), factory, endpointProps); + + String completeEndpointAddress = httpServiceManager.getAbsoluteAddress(contextRoot, address); + EndpointDescription epd = createEndpointDesc(endpointProps, + new String[]{WsConstants.WS_CONFIG_TYPE}, + completeEndpointAddress, intents); + return createServerFromFactory(factory, epd); + } + + private boolean configTypeSupported(Map<String, Object> endpointProps, String configType) { + Collection<String> configs = getMultiValueProperty(endpointProps.get(RemoteConstants.SERVICE_EXPORTED_CONFIGS)); + return configs == null || configs.isEmpty() || configs.contains(configType); + } + + protected EndpointDescription createEndpointDesc(Map<String, Object> props, + String[] importedConfigs, + String address, + String[] intents) { + props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, importedConfigs); + props.put(WsConstants.WS_ADDRESS_PROPERTY, address); + props.put(RemoteConstants.SERVICE_INTENTS, intents); + props.put(RemoteConstants.ENDPOINT_ID, address); + return new EndpointDescription(props); + } + + private String getPojoAddress(Map<String, Object> sd, Class<?> iClass) { + String address = getClientAddress(sd); + if (address != null) { + return address; + } + + // If the property is not of type string this will cause an ClassCastException which + // will be propagated to the ExportRegistration exception property. + Object port = sd.get(WsConstants.WS_PORT_PROPERTY); + if (port == null) { + port = "9000"; + } + + address = "http://localhost:" + port + "/" + iClass.getName().replace('.', '/'); + LOG.info("Using a default address: " + address); + return address; + } + + protected String getClientAddress(Map<String, Object> sd) { + return OsgiUtils.getFirstNonEmptyStringProperty(sd, WsConstants.WS_ADDRESS_PROPERTY, + RemoteConstants.ENDPOINT_ID); + } + + protected String getServerAddress(Map<String, Object> sd, Class<?> iClass) { + String address = getClientAddress(sd); + return address == null ? httpServiceManager.getDefaultAddress(iClass) : address; + } + + protected Bus createBus(Long sid, BundleContext callingContext, String contextRoot) { + Bus bus = BusFactory.newInstance().createBus(); + if (contextRoot != null) { + httpServiceManager.registerServlet(bus, contextRoot, callingContext, sid); + } + return bus; + } + + protected Endpoint createServerFromFactory(ServerFactoryBean factory, EndpointDescription epd) { + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(ServerFactoryBean.class.getClassLoader()); + Server server = factory.create(); + return new ServerWrapper(epd, server); + } finally { + Thread.currentThread().setContextClassLoader(oldClassLoader); + } + } + + protected static void addContextProperties(AbstractEndpointFactory factory, + Map<String, Object> sd, String propName) { + @SuppressWarnings("unchecked") + Map<String, Object> props = (Map<String, Object>)sd.get(propName); + if (props != null) { + factory.getProperties(true).putAll(props); + } + } + + private DataBinding getDataBinding(Map<String, Object> sd, Class<?> iClass) { + return isJAXWS(sd, iClass) ? new JAXBDataBinding() : new AegisDatabinding(); + } + + // Isolated so that it can be substituted for testing + protected ClientProxyFactoryBean createClientProxyFactoryBean(Map<String, Object> sd, Class<?> iClass) { + return isJAXWS(sd, iClass) ? new JaxWsProxyFactoryBean() : new ClientProxyFactoryBean(); + } + + // Isolated so that it can be substituted for testing + protected ServerFactoryBean createServerFactoryBean(Map<String, Object> sd, Class<?> iClass) { + return isJAXWS(sd, iClass) ? new JaxWsServerFactoryBean() : new ServerFactoryBean(); + } + + private boolean isJAXWS(Map<String, Object> sd, Class<?> iClass) { + return iClass.getAnnotation(WebService.class) != null; + } +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java new file mode 100644 index 0000000..810e445 --- /dev/null +++ b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java @@ -0,0 +1,82 @@ +/** + * 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.dosgi.dsw.handlers.ws; + +import java.net.URL; +import java.util.Map; + +import javax.xml.namespace.QName; + +import org.apache.cxf.common.util.PackageUtils; +import org.apache.cxf.dosgi.common.util.OsgiUtils; +import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory; +import org.osgi.framework.BundleContext; + +public final class WsdlSupport { + + private WsdlSupport() { + } + + public static void setWsdlProperties(AbstractWSDLBasedEndpointFactory factory, // + BundleContext context, // + Map<String, Object> sd) { + String location = OsgiUtils.getProperty(sd, WsConstants.WS_WSDL_LOCATION); + if (location != null) { + URL wsdlURL = context.getBundle().getResource(location); + if (wsdlURL != null) { + factory.setWsdlURL(wsdlURL.toString()); + } + QName serviceName = getServiceQName(null, sd, + WsConstants.WS_WSDL_SERVICE_NAMESPACE, + WsConstants.WS_WSDL_SERVICE_NAME); + if (serviceName != null) { + factory.setServiceName(serviceName); + QName portName = getPortQName(serviceName.getNamespaceURI(), sd, + WsConstants.WS_WSDL_PORT_NAME); + if (portName != null) { + factory.setEndpointName(portName); + } + } + } + } + + protected static QName getServiceQName(Class<?> iClass, Map<String, Object> sd, String nsPropName, + String namePropName) { + String serviceNs = OsgiUtils.getProperty(sd, nsPropName); + String serviceName = OsgiUtils.getProperty(sd, namePropName); + if (iClass == null && (serviceNs == null || serviceName == null)) { + return null; + } + if (serviceNs == null) { + serviceNs = PackageUtils.getNamespace(PackageUtils.getPackageName(iClass)); + } + if (serviceName == null) { + serviceName = iClass.getSimpleName(); + } + return new QName(serviceNs, serviceName); + } + + protected static QName getPortQName(String ns, Map<String, Object> sd, String propName) { + String portName = OsgiUtils.getProperty(sd, propName); + if (portName == null) { + return null; + } + return new QName(ns, portName); + } +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoService.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoService.java b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoService.java new file mode 100644 index 0000000..7814267 --- /dev/null +++ b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoService.java @@ -0,0 +1,26 @@ +/** + * 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.dosgi.dsw.handlers.jaxws; + +import javax.jws.WebService; + +@WebService +public interface MyJaxWsEchoService { + String echo(String message); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoServiceImpl.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoServiceImpl.java b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoServiceImpl.java new file mode 100644 index 0000000..699c9ae --- /dev/null +++ b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoServiceImpl.java @@ -0,0 +1,27 @@ +/** + * 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.dosgi.dsw.handlers.jaxws; + +public class MyJaxWsEchoServiceImpl implements MyJaxWsEchoService { + + @Override + public String echo(String message) { + return message; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoService.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoService.java b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoService.java new file mode 100644 index 0000000..7d574ca --- /dev/null +++ b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoService.java @@ -0,0 +1,23 @@ +/** + * 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.dosgi.dsw.handlers.simple; + +public interface MySimpleEchoService { + String echo(String message); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoServiceImpl.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoServiceImpl.java b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoServiceImpl.java new file mode 100644 index 0000000..19dda4b --- /dev/null +++ b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoServiceImpl.java @@ -0,0 +1,27 @@ +/** + * 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.dosgi.dsw.handlers.simple; + +public class MySimpleEchoServiceImpl implements MySimpleEchoService { + + @Override + public String echo(String message) { + return message; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java ---------------------------------------------------------------------- diff --git a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java new file mode 100644 index 0000000..4ab9b31 --- /dev/null +++ b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java @@ -0,0 +1,415 @@ +/** + * 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.dosgi.dsw.handlers.ws; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import javax.xml.namespace.QName; + +import org.apache.aries.rsa.spi.Endpoint; +import org.apache.aries.rsa.util.EndpointHelper; +import org.apache.cxf.dosgi.common.httpservice.HttpServiceManager; +import org.apache.cxf.dosgi.common.intent.IntentManager; +import org.apache.cxf.dosgi.common.intent.IntentManagerImpl; +import org.apache.cxf.dosgi.common.util.ServerWrapper; +import org.apache.cxf.dosgi.dsw.handlers.jaxws.MyJaxWsEchoService; +import org.apache.cxf.dosgi.dsw.handlers.simple.MySimpleEchoService; +import org.apache.cxf.endpoint.AbstractEndpointFactory; +import org.apache.cxf.endpoint.EndpointImpl; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.feature.Feature; +import org.apache.cxf.frontend.ClientProxyFactoryBean; +import org.apache.cxf.frontend.ServerFactoryBean; +import org.apache.cxf.jaxws.support.JaxWsEndpointImpl; +import org.apache.cxf.transport.Destination; +import org.apache.cxf.ws.addressing.AttributedURIType; +import org.apache.cxf.ws.addressing.EndpointReferenceType; +import org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean; +import org.easymock.EasyMock; +import org.easymock.IAnswer; +import org.easymock.IMocksControl; +import org.junit.Assert; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Version; +import org.osgi.service.remoteserviceadmin.EndpointDescription; +import org.osgi.service.remoteserviceadmin.RemoteConstants; + +import junit.framework.TestCase; + +public class PojoConfigurationTypeHandlerTest extends TestCase { + + public void testGetPojoAddressEndpointURI() { + IntentManager intentManager = new IntentManagerImpl(); + WsProvider handler = new WsProvider(); + handler.setIntentManager(intentManager); + handler.setHttpServiceManager(dummyHttpServiceManager()); + Map<String, Object> sd = new HashMap<String, Object>(); + String url = "http://somewhere:1234/blah"; + sd.put(RemoteConstants.ENDPOINT_ID, url); + assertEquals(url, handler.getServerAddress(sd, String.class)); + } + + private HttpServiceManager dummyHttpServiceManager() { + return new HttpServiceManager(); + } + + public void testGetPojoAddressEndpointCxf() { + IntentManager intentManager = new IntentManagerImpl(); + WsProvider handler = new WsProvider(); + handler.setIntentManager(intentManager); + handler.setHttpServiceManager(dummyHttpServiceManager()); + Map<String, Object> sd = new HashMap<String, Object>(); + String url = "http://somewhere:29/boo"; + sd.put("org.apache.cxf.ws.address", url); + assertEquals(url, handler.getServerAddress(sd, String.class)); + } + + public void testGetDefaultPojoAddress() { + IntentManager intentManager = new IntentManagerImpl(); + WsProvider handler = new WsProvider(); + handler.setIntentManager(intentManager); + handler.setHttpServiceManager(dummyHttpServiceManager()); + Map<String, Object> sd = new HashMap<String, Object>(); + assertEquals("/java/lang/String", handler.getServerAddress(sd, String.class)); + } + + // todo: add test for data bindings + public void testCreateProxy() { + IMocksControl c = EasyMock.createNiceControl(); + BundleContext bc1 = c.createMock(BundleContext.class); + + BundleContext requestingContext = c.createMock(BundleContext.class); + + final ClientProxyFactoryBean cpfb = c.createMock(ClientProxyFactoryBean.class); + ReflectionServiceFactoryBean sf = c.createMock(ReflectionServiceFactoryBean.class); + EasyMock.expect(cpfb.getServiceFactory()).andReturn(sf).anyTimes(); + IntentManager intentManager = new IntentManagerImpl() { + @Override + public String[] applyIntents(List<Feature> features, + AbstractEndpointFactory factory, + Map<String, Object> sd) { + return new String[0]; + } + }; + WsProvider p = new WsProvider() { + @Override + protected ClientProxyFactoryBean createClientProxyFactoryBean(Map<String, Object> sd, Class<?> iClass) { + return cpfb; + } + }; + p.setIntentManager(intentManager); + p.setHttpServiceManager(dummyHttpServiceManager()); + p.activate(bc1); + + Class<?>[] exportedInterfaces = new Class[]{Runnable.class}; + + Map<String, Object> props = new HashMap<String, Object>(); + props.put(RemoteConstants.ENDPOINT_ID, "http://google.de/"); + EndpointHelper.addObjectClass(props, exportedInterfaces); + props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, new String[]{"my.config"}); + EndpointDescription endpoint = new EndpointDescription(props); + + cpfb.setAddress((String)EasyMock.eq(props.get(RemoteConstants.ENDPOINT_ID))); + EasyMock.expectLastCall().atLeastOnce(); + + cpfb.setServiceClass(EasyMock.eq(Runnable.class)); + EasyMock.expectLastCall().atLeastOnce(); + + c.replay(); + ClassLoader cl = null; + Object proxy = p.importEndpoint(cl, requestingContext, exportedInterfaces, endpoint); + assertNotNull(proxy); + assertTrue("Proxy is not of the requested type! ", proxy instanceof Runnable); + c.verify(); + } + + public void testCreateServerWithAddressProperty() throws Exception { + BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class); + EasyMock.replay(dswContext); + + String myService = "Hi"; + final ServerFactoryBean sfb = createMockServerFactoryBean(); + + IntentManager intentManager = new IntentManagerImpl() { + @Override + public String[] applyIntents(List<Feature> features, AbstractEndpointFactory factory, + Map<String, Object> sd) { + return new String[]{}; + } + }; + WsProvider p = new WsProvider() { + @Override + protected ServerFactoryBean createServerFactoryBean(Map<String, Object> sd, Class<?> iClass) { + return sfb; + } + }; + p.activate(dswContext); + p.setIntentManager(intentManager); + p.setHttpServiceManager(dummyHttpServiceManager()); + BundleContext bundleContext = EasyMock.createNiceMock(BundleContext.class); + EasyMock.replay(bundleContext); + + Class<?>[] exportedInterface = new Class[]{String.class}; + Map<String, Object> props = new HashMap<String, Object>(); + EndpointHelper.addObjectClass(props, exportedInterface); + props.put(WsConstants.WS_ADDRESS_PROPERTY, "http://alternate_host:80/myString"); + + Endpoint exportResult = p.exportService(myService, bundleContext, props, exportedInterface); + Map<String, Object> edProps = exportResult.description().getProperties(); + + assertNotNull(edProps.get(RemoteConstants.SERVICE_IMPORTED_CONFIGS)); + assertEquals(1, ((String[])edProps.get(RemoteConstants.SERVICE_IMPORTED_CONFIGS)).length); + assertEquals(WsConstants.WS_CONFIG_TYPE, ((String[])edProps.get(RemoteConstants.SERVICE_IMPORTED_CONFIGS))[0]); + assertEquals("http://alternate_host:80/myString", edProps.get(RemoteConstants.ENDPOINT_ID)); + } + + public void testAddressing() throws Exception { + runAddressingTest(new HashMap<String, Object>(), "http://localhost:9000/java/lang/Runnable"); + + Map<String, Object> p1 = new HashMap<String, Object>(); + p1.put("org.apache.cxf.ws.address", "http://somewhere"); + runAddressingTest(p1, "http://somewhere"); + + Map<String, Object> p3 = new HashMap<String, Object>(); + p3.put("org.apache.cxf.ws.port", 65535); + runAddressingTest(p3, "http://localhost:65535/java/lang/Runnable"); + + Map<String, Object> p4 = new HashMap<String, Object>(); + p4.put("org.apache.cxf.ws.port", "8181"); + runAddressingTest(p4, "http://localhost:8181/java/lang/Runnable"); + } + + private void runAddressingTest(Map<String, Object> properties, String expectedAddress) throws Exception { + Class<?>[] exportedInterface = new Class[]{Runnable.class}; + EndpointHelper.addObjectClass(properties, exportedInterface); + BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class); + String expectedUUID = UUID.randomUUID().toString(); + EasyMock.expect(dswContext.getProperty(org.osgi.framework.Constants.FRAMEWORK_UUID)).andReturn(expectedUUID); + EasyMock.replay(dswContext); + + IntentManager intentManager = EasyMock.createNiceMock(IntentManager.class); + EasyMock.replay(intentManager); + + WsProvider handler = new WsProvider() { + @Override + protected Endpoint createServerFromFactory(ServerFactoryBean factory, + EndpointDescription epd) { + return new ServerWrapper(epd, null); + } + }; + handler.setIntentManager(intentManager); + handler.setHttpServiceManager(dummyHttpServiceManager()); + handler.activate(dswContext); + Runnable myService = EasyMock.createMock(Runnable.class); + EasyMock.replay(myService); + + BundleContext bundleContext = EasyMock.createNiceMock(BundleContext.class); + EasyMock.replay(bundleContext); + + Endpoint result = handler.exportService(myService, bundleContext, properties, exportedInterface); + Map<String, Object> props = result.description().getProperties(); + assertEquals(expectedAddress, props.get("org.apache.cxf.ws.address")); + Assert.assertArrayEquals(new String[] {"org.apache.cxf.ws"}, + (String[]) props.get(RemoteConstants.SERVICE_IMPORTED_CONFIGS)); + Assert.assertArrayEquals(new String[] {"java.lang.Runnable"}, + (String[]) props.get(org.osgi.framework.Constants.OBJECTCLASS)); + } + + public void t2estCreateServerException() { + BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class); + EasyMock.replay(dswContext); + + IntentManager intentManager = EasyMock.createNiceMock(IntentManager.class); + EasyMock.replay(intentManager); + + WsProvider handler = new WsProvider() { + @Override + protected Endpoint createServerFromFactory(ServerFactoryBean factory, + EndpointDescription epd) { + throw new TestException(); + } + }; + handler.setIntentManager(intentManager); + handler.setHttpServiceManager(dummyHttpServiceManager()); + handler.activate(dswContext); + + Map<String, Object> props = new HashMap<String, Object>(); + + Runnable myService = EasyMock.createMock(Runnable.class); + EasyMock.replay(myService); + try { + handler.exportService(myService, null, props, new Class[]{Runnable.class}); + fail("Expected TestException"); + } catch (TestException e) { + // Expected + } + } + + private ServerFactoryBean createMockServerFactoryBean() { + ReflectionServiceFactoryBean sf = EasyMock.createNiceMock(ReflectionServiceFactoryBean.class); + EasyMock.replay(sf); + + final StringBuilder serverURI = new StringBuilder(); + + ServerFactoryBean sfb = EasyMock.createNiceMock(ServerFactoryBean.class); + Server server = createMockServer(sfb); + + EasyMock.expect(sfb.getServiceFactory()).andReturn(sf).anyTimes(); + EasyMock.expect(sfb.create()).andReturn(server); + sfb.setAddress((String) EasyMock.anyObject()); + EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + public Object answer() throws Throwable { + serverURI.setLength(0); + serverURI.append(EasyMock.getCurrentArguments()[0]); + return null; + } + }); + EasyMock.expect(sfb.getAddress()).andAnswer(new IAnswer<String>() { + public String answer() throws Throwable { + return serverURI.toString(); + } + }); + EasyMock.replay(sfb); + return sfb; + } + + private Server createMockServer(final ServerFactoryBean sfb) { + AttributedURIType addr = EasyMock.createMock(AttributedURIType.class); + EasyMock.expect(addr.getValue()).andAnswer(new IAnswer<String>() { + public String answer() throws Throwable { + return sfb.getAddress(); + } + }); + EasyMock.replay(addr); + + EndpointReferenceType er = EasyMock.createMock(EndpointReferenceType.class); + EasyMock.expect(er.getAddress()).andReturn(addr); + EasyMock.replay(er); + + Destination destination = EasyMock.createMock(Destination.class); + EasyMock.expect(destination.getAddress()).andReturn(er); + EasyMock.replay(destination); + + Server server = EasyMock.createNiceMock(Server.class); + EasyMock.expect(server.getDestination()).andReturn(destination); + EasyMock.replay(server); + return server; + } + + public void testCreateEndpointProps() { + BundleContext bc = EasyMock.createNiceMock(BundleContext.class); + EasyMock.expect(bc.getProperty("org.osgi.framework.uuid")).andReturn("some_uuid1"); + EasyMock.replay(bc); + + IntentManager intentManager = new IntentManagerImpl(); + WsProvider pch = new WsProvider(); + pch.setIntentManager(intentManager); + pch.setHttpServiceManager(dummyHttpServiceManager()); + pch.activate(bc); + Class<?>[] exportedInterfaces = new Class[] {String.class}; + Map<String, Object> sd = new HashMap<String, Object>(); + sd.put(org.osgi.framework.Constants.SERVICE_ID, 42); + EndpointHelper.addObjectClass(sd, exportedInterfaces); + EndpointDescription epd = pch.createEndpointDesc(sd, new String[] {"org.apache.cxf.ws"}, + "http://localhost:12345", new String[] {"my_intent", "your_intent"}); + + assertEquals("http://localhost:12345", epd.getId()); + assertEquals(Arrays.asList("java.lang.String"), epd.getInterfaces()); + assertEquals(Arrays.asList("org.apache.cxf.ws"), epd.getConfigurationTypes()); + assertEquals(Arrays.asList("my_intent", "your_intent"), epd.getIntents()); + assertEquals(new Version("0.0.0"), epd.getPackageVersion("java.lang")); + } + + public void t2estCreateJaxWsEndpointWithoutIntents() { + IMocksControl c = EasyMock.createNiceControl(); + BundleContext dswBC = c.createMock(BundleContext.class); + + IntentManager intentManager = new DummyIntentManager(); + WsProvider handler = new WsProvider(); + handler.setIntentManager(intentManager); + handler.setHttpServiceManager(dummyHttpServiceManager()); + handler.activate(dswBC); + + Map<String, Object> sd = new HashMap<String, Object>(); + sd.put(WsConstants.WS_ADDRESS_PROPERTY, "/somewhere"); + BundleContext serviceBC = c.createMock(BundleContext.class); + Object myService = null; + c.replay(); + + ServerWrapper serverWrapper = (ServerWrapper)handler.exportService(myService, + serviceBC, + sd, + new Class[]{MyJaxWsEchoService.class}); + c.verify(); + + org.apache.cxf.endpoint.Endpoint ep = serverWrapper.getServer().getEndpoint(); + QName bindingName = ep.getEndpointInfo().getBinding().getName(); + Assert.assertEquals(JaxWsEndpointImpl.class, ep.getClass()); + Assert.assertEquals(new QName("http://jaxws.handlers.dsw.dosgi.cxf.apache.org/", + "MyJaxWsEchoServiceServiceSoapBinding"), + bindingName); + } + + public void t2estCreateSimpleEndpointWithoutIntents() { + IMocksControl c = EasyMock.createNiceControl(); + BundleContext dswBC = c.createMock(BundleContext.class); + + IntentManager intentManager = new DummyIntentManager(); + WsProvider handler = new WsProvider(); + handler.setIntentManager(intentManager); + handler.setHttpServiceManager(dummyHttpServiceManager()); + handler.activate(dswBC); + Map<String, Object> sd = new HashMap<String, Object>(); + sd.put(WsConstants.WS_ADDRESS_PROPERTY, "/somewhere_else"); + BundleContext serviceBC = c.createMock(BundleContext.class); + c.replay(); + ServerWrapper serverWrapper = (ServerWrapper)handler.exportService(null, serviceBC, sd, + new Class[]{MySimpleEchoService.class}); + c.verify(); + + org.apache.cxf.endpoint.Endpoint ep = serverWrapper.getServer().getEndpoint(); + QName bindingName = ep.getEndpointInfo().getBinding().getName(); + Assert.assertEquals(EndpointImpl.class, ep.getClass()); + Assert.assertEquals(new QName("http://simple.handlers.dsw.dosgi.cxf.apache.org/", + "MySimpleEchoServiceSoapBinding"), + bindingName); + } + + public static class DummyIntentManager implements IntentManager { + + @Override + public String[] applyIntents(List<Feature> features, + AbstractEndpointFactory factory, + Map<String, Object> props) { + return new String[]{}; + } + + @Override + public void assertAllIntentsSupported(Map<String, Object> serviceProperties) { + } + } + + @SuppressWarnings("serial") + public static class TestException extends RuntimeException { + } +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/ds/client/pom.xml ---------------------------------------------------------------------- diff --git a/samples/ds/client/pom.xml b/samples/ds/client/pom.xml index 3e833d5..625907a 100644 --- a/samples/ds/client/pom.xml +++ b/samples/ds/client/pom.xml @@ -18,7 +18,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> </parent> <properties> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/ds/impl/pom.xml ---------------------------------------------------------------------- diff --git a/samples/ds/impl/pom.xml b/samples/ds/impl/pom.xml index 11bcdcb..25b71b2 100644 --- a/samples/ds/impl/pom.xml +++ b/samples/ds/impl/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> </parent> <properties> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/ds/interface/pom.xml ---------------------------------------------------------------------- diff --git a/samples/ds/interface/pom.xml b/samples/ds/interface/pom.xml index 3db2187..04a9378 100644 --- a/samples/ds/interface/pom.xml +++ b/samples/ds/interface/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> </parent> <properties> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/ds/pom.xml ---------------------------------------------------------------------- diff --git a/samples/ds/pom.xml b/samples/ds/pom.xml index bd42e92..78deb66 100644 --- a/samples/ds/pom.xml +++ b/samples/ds/pom.xml @@ -16,12 +16,12 @@ <artifactId>cxf-dosgi-ri-samples-ds-parent</artifactId> <packaging>pom</packaging> <name>Distributed OSGI DS Sample</name> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../../parent/pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter/client/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter/client/pom.xml b/samples/greeter/client/pom.xml index b8ece5d..163fcfe 100644 --- a/samples/greeter/client/pom.xml +++ b/samples/greeter/client/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-greeter-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter/impl/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter/impl/pom.xml b/samples/greeter/impl/pom.xml index dbefbd5..928aab3 100644 --- a/samples/greeter/impl/pom.xml +++ b/samples/greeter/impl/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-greeter-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter/interface/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter/interface/pom.xml b/samples/greeter/interface/pom.xml index 2161c3a..57e0729 100644 --- a/samples/greeter/interface/pom.xml +++ b/samples/greeter/interface/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-greeter-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java ---------------------------------------------------------------------- diff --git a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java b/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java index 1a0d0e0..a04bb4a 100644 --- a/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java +++ b/samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java @@ -21,7 +21,6 @@ package org.apache.cxf.dosgi.samples.greeter; import java.util.Map; public interface GreeterService { - Map<GreetingPhrase, String> greetMe(String name); GreetingPhrase[] greetMe(GreeterData name) throws GreeterException; } http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter/pom.xml b/samples/greeter/pom.xml index 07d14c1..ca2606d 100644 --- a/samples/greeter/pom.xml +++ b/samples/greeter/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../../parent/pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter_rest/client/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter_rest/client/pom.xml b/samples/greeter_rest/client/pom.xml index 03425ed..a35bf78 100644 --- a/samples/greeter_rest/client/pom.xml +++ b/samples/greeter_rest/client/pom.xml @@ -19,7 +19,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-greeter-rest-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter_rest/impl/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter_rest/impl/pom.xml b/samples/greeter_rest/impl/pom.xml index 9ed99fd..2ede1ed 100644 --- a/samples/greeter_rest/impl/pom.xml +++ b/samples/greeter_rest/impl/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.apache.cxf.dosgi.samples</groupId> <artifactId>cxf-dosgi-ri-samples-greeter-rest-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter_rest/interface/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter_rest/interface/pom.xml b/samples/greeter_rest/interface/pom.xml index 91b33da..745c0fe 100644 --- a/samples/greeter_rest/interface/pom.xml +++ b/samples/greeter_rest/interface/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../../../parent/pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/greeter_rest/pom.xml ---------------------------------------------------------------------- diff --git a/samples/greeter_rest/pom.xml b/samples/greeter_rest/pom.xml index f0dcad0..d757c53 100644 --- a/samples/greeter_rest/pom.xml +++ b/samples/greeter_rest/pom.xml @@ -21,7 +21,7 @@ <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../../parent/pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/pom.xml ---------------------------------------------------------------------- diff --git a/samples/pom.xml b/samples/pom.xml index 3b0bcb1..251f4bf 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -29,7 +29,7 @@ <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../parent/pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/samples/security_filter/pom.xml ---------------------------------------------------------------------- diff --git a/samples/security_filter/pom.xml b/samples/security_filter/pom.xml index 1c6d0c6..4f58c4d 100644 --- a/samples/security_filter/pom.xml +++ b/samples/security_filter/pom.xml @@ -20,7 +20,7 @@ <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../../parent/pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/systests2/multi-bundle/pom.xml ---------------------------------------------------------------------- diff --git a/systests2/multi-bundle/pom.xml b/systests2/multi-bundle/pom.xml index cb8b205..4fb0947 100644 --- a/systests2/multi-bundle/pom.xml +++ b/systests2/multi-bundle/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../../parent/pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/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 2e727fe..383d7e9 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 @@ -46,6 +46,7 @@ import org.ops4j.pax.exam.CoreOptions; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.cm.ConfigurationAdminOptions; import org.ops4j.pax.exam.options.MavenArtifactProvisionOption; +import org.ops4j.pax.exam.options.extra.VMOption; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException; @@ -236,8 +237,12 @@ public class AbstractDosgiTest { systemProperty("pax.exam.osgi.unresolved.fail").value("true"), // configLogging(), frameworkStartLevel(100) - // CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005") // ); } + + protected static VMOption debug() { + return CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"); + } + } http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestCustomIntent.java ---------------------------------------------------------------------- diff --git a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestCustomIntent.java b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestCustomIntent.java index c66b358..9928db0 100644 --- a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestCustomIntent.java +++ b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestCustomIntent.java @@ -51,14 +51,15 @@ public class TestCustomIntent extends AbstractDosgiTest { basicTestOptions(), // greeterInterface(), // streamBundle(getCustomIntentBundle()).noStart(), // - provision(getServiceBundle()) + provision(getServiceBundle()), + //debug() }; } @Test public void testCustomIntent() throws Exception { // There should be warnings of unsatisfied intent myIntent in the log at debug level - Thread.sleep(2000); + //Thread.sleep(2000); getBundleByName(bundleContext, "CustomIntent").start(); waitPort(9090); http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java ---------------------------------------------------------------------- diff --git a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java index 7ce7d43..0ed885a 100644 --- a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java +++ b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java @@ -46,7 +46,8 @@ public class TestExportRestService extends AbstractDosgiTest { {// basicTestOptions(), // systemProperty("org.osgi.service.http.port").value(webPort), // - provision(getServiceBundle()) + provision(getServiceBundle()), + //debug() }; } http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/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 1516499..e79f76a 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 @@ -48,6 +48,7 @@ public class TestExportService extends AbstractDosgiTest { return new Option[] // {// basicTestOptions(), // + //debug(), greeterInterface(), // greeterImpl(), }; http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/rest/TranslateActivator.java ---------------------------------------------------------------------- diff --git a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/rest/TranslateActivator.java b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/rest/TranslateActivator.java index 1c48fb5..36fe7d2 100644 --- a/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/rest/TranslateActivator.java +++ b/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/rest/TranslateActivator.java @@ -30,7 +30,6 @@ public class TranslateActivator implements BundleActivator { Dictionary<String, String> props = new Hashtable<String, String>(); props.put("service.exported.interfaces", "*"); props.put("service.exported.configs", "org.apache.cxf.rs"); - props.put("service.exported.intents", "HTTP"); props.put("org.apache.cxf.rs.address", "/translate"); context.registerService(RestTranslate.class.getName(), new RestTranslateImpl(), props); } http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/f0dea506/systests2/pom.xml ---------------------------------------------------------------------- diff --git a/systests2/pom.xml b/systests2/pom.xml index 15b871c..423b338 100644 --- a/systests2/pom.xml +++ b/systests2/pom.xml @@ -24,13 +24,13 @@ <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <relativePath>../parent/pom.xml</relativePath> </parent> <groupId>org.apache.cxf.dosgi.systests</groupId> <artifactId>cxf-dosgi-ri-systests2</artifactId> - <version>1.9-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <packaging>pom</packaging> <name>Distributed OSGi System Tests</name>
