This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karaf.git
The following commit(s) were added to refs/heads/main by this push:
new da05005c Ref #491: Add camel-cxf integration tests (#493)
da05005c is described below
commit da05005c28ad23beb86ca3e565e18ac4e328e398
Author: Nicolas Filotto <[email protected]>
AuthorDate: Mon Sep 16 12:34:28 2024 +0200
Ref #491: Add camel-cxf integration tests (#493)
* Ref #491: Add camel-cxf integration tests
* Make the IT for camel-disruptor-vm do cross contexts as it should
---
components/camel-cxf/camel-cxf-all/pom.xml | 20 +-
.../camel/component/cxf/osgi/MainActivator.java | 2 -
.../HTTPJettyTransportNamespaceHandler.java | 81 -----
.../JettyHTTPServerEngineFactoryHolder.java | 272 --------------
.../blueprint/JettyServerEngineFactoryParser.java | 133 -------
.../osgi/HTTPJettyDestinationFactory.java | 42 ---
.../osgi/HTTPJettyTransportActivator.java | 391 ---------------------
.../main/resources/META-INF/cxf/bus-extensions.txt | 2 -
features/src/main/feature/camel-features.xml | 1 -
tests/camel-integration-test/pom.xml | 1 +
.../camel/itests/AbstractCamelRouteITest.java | 56 ++-
...ractCamelSingleFeatureResultFileBasedRoute.java | 4 +
...ractCamelSingleFeatureResultMockBasedRoute.java | 4 +
.../karaf/camel/itests/CamelContextProvider.java | 14 +
tests/features/camel-cxf/pom.xml | 94 +++++
.../karaf/camel/test/CamelCxfRsRouteSupplier.java | 59 ++++
.../karaf/camel/test/CamelCxfWsRouteSupplier.java | 91 +++++
.../apache/karaf/camel/test/beans/Customer.java | 65 ++++
.../karaf/camel/test/beans/CustomerService.java | 51 +++
.../karaf/camel/test/jaxws/HelloService.java | 21 +-
.../apache/karaf/camel/itest/CamelCxfITest.java | 199 +++++++++++
.../camel/test/CamelDisruptorRouteSupplier.java | 3 +-
.../camel/test/CamelDisruptorvmRouteSupplier.java | 49 ---
.../karaf/camel/itest/CamelDisruptorTest.java | 50 ++-
.../test/resources/OSGI-INF/blueprint/route1.xml | 28 ++
.../test/resources/OSGI-INF/blueprint/route2.xml | 31 ++
tests/features/pom.xml | 3 +-
27 files changed, 757 insertions(+), 1010 deletions(-)
diff --git a/components/camel-cxf/camel-cxf-all/pom.xml
b/components/camel-cxf/camel-cxf-all/pom.xml
index 9b357c13..cb6786ab 100644
--- a/components/camel-cxf/camel-cxf-all/pom.xml
+++ b/components/camel-cxf/camel-cxf-all/pom.xml
@@ -53,8 +53,6 @@
org.apache.camel.component.cxf.transport.http.osgi;version=${project.version},
org.apache.camel.component.cxf.transport.http.blueprint;version=${project.version},
org.apache.camel.component.cxf.servlet.blueprint;version=${project.version},
-
org.apache.camel.component.cxf.transport.http_jetty.blueprint;version=${project.version},
-
org.apache.camel.component.cxf.transport.http_jetty.osgi;version=${project.version},
org.apache.camel.component.cxf.ws.addressing.blueprint;version=${project.version},
org.apache.camel.component.cxf.ws.policy.blueprint;version=${project.version},
org.apache.camel.component.cxf.feature;version=${camel-version},
@@ -64,7 +62,7 @@
org.apache.camel.component.cxf.transport.header;version=${camel-version},
org.apache.camel.component.cxf.transport.message;version=${camel-version},
org.apache.camel.component.cxf.binding.soap.blueprint;version=${project.version},
- org.apache.cxf.*;version=${cxf-version},
+ org.apache.cxf*;version=${cxf-version},
</camel.osgi.export>
<camel.osgi.activator>org.apache.camel.component.cxf.osgi.MainActivator</camel.osgi.activator>
<camel-osgi-camel-import>
@@ -98,7 +96,6 @@
jakarta.ws.rs*;version="${camel-osgi-jakarta-ws-rs-version}",
jakarta.xml.soap*;version="${camel-osgi-saaj-version}",
jakarta.servlet*;version="${camel-osgi-jakarta-servlet-version}",
- org.eclipse.jetty*;version="${camel-osgi-jetty-version}",
org.glassfish.jaxb.runtime.v2;version="${camel-osgi-jakarta-bind-version}",
javax.cache*;resolution:=optional,
org.apache.cxf.tools*;resolution:=optional,
@@ -121,7 +118,7 @@
org.glassfish.hk2.osgiresourcelocator
</camel.osgi.import>
<camel.osgi.dynamicimport.pkg>
-
org.apache.cxf.bus,org.apache.cxf.*,com.ctc.wstx.*,org.eclipse.jetty.jmx
+ org.apache.cxf.bus,org.apache.cxf.*,com.ctc.wstx.*
</camel.osgi.dynamicimport.pkg>
<camel.osgi.export.service>
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/blueprint/core",
@@ -135,7 +132,6 @@
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/blueprint/simple",
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/blueprint/jaxrs-client",
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/transports/http/configuration",
-
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/transports/http-jetty/configuration",
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/ws/addressing",
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/policy",
org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://www.w3.org/ns/ws-policy",
@@ -270,17 +266,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http-jetty</artifactId>
- <version>${cxf-version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.cxf</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-addr</artifactId>
@@ -406,7 +391,6 @@
<include>org.apache.cxf:cxf-rt-frontend-jaxws</include>
<include>org.apache.cxf:cxf-rt-frontend-simple</include>
<include>org.apache.cxf:cxf-rt-transports-http</include>
-
<include>org.apache.cxf:cxf-rt-transports-http-jetty</include>
<include>org.apache.cxf:cxf-rt-cxf-rt-security</include>
<include>org.apache.cxf:cxf-rt-cxf-rt-rs-client</include>
<include>org.apache.cxf:cxf-rt-ws-addr</include>
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/osgi/MainActivator.java
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/osgi/MainActivator.java
index bbce0aef..3d51575a 100644
---
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/osgi/MainActivator.java
+++
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/osgi/MainActivator.java
@@ -21,7 +21,6 @@ import java.util.List;
import org.apache.camel.component.cxf.bus.osgi.CXFActivator;
import
org.apache.camel.component.cxf.transport.http.osgi.HTTPTransportActivator;
-import
org.apache.camel.component.cxf.transport.http_jetty.osgi.HTTPJettyTransportActivator;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -36,7 +35,6 @@ public class MainActivator implements BundleActivator {
new org.apache.camel.component.cxf.frontend.blueprint.Activator(),
new
org.apache.camel.component.cxf.jaxrs.client.blueprint.Activator(),
new HTTPTransportActivator(),
- new HTTPJettyTransportActivator(),
new
org.apache.camel.component.cxf.ws.addressing.blueprint.Activator(),
new
org.apache.camel.component.cxf.ws.policy.blueprint.Activator());
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/HTTPJettyTransportNamespaceHandler.java
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/HTTPJettyTransportNamespaceHandler.java
deleted file mode 100644
index b2e02efe..00000000
---
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/HTTPJettyTransportNamespaceHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.camel.component.cxf.transport.http_jetty.blueprint;
-
-import java.net.URL;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.apache.aries.blueprint.Namespaces;
-import org.apache.aries.blueprint.ParserContext;
-import org.apache.camel.component.cxf.helpers.BaseNamespaceHandler;
-import org.apache.cxf.common.logging.LogUtils;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.Metadata;
-
-@Namespaces("http://cxf.apache.org/transports/http-jetty/configuration")
-public class HTTPJettyTransportNamespaceHandler extends BaseNamespaceHandler {
-
- public static final String JETTY_TRANSPORT =
"http://cxf.apache.org/transports/http-jetty/configuration";
-
- private static final String JETTY_ENGINE = "engine";
-
- private static final String JETTY_ENGINE_FACTORY = "engine-factory";
-
- private static final Logger LOG =
LogUtils.getL7dLogger(HTTPJettyTransportNamespaceHandler.class);
-
- public URL getSchemaLocation(String s) {
- if (JETTY_TRANSPORT.equals(s)) {
- return getClass().getClassLoader().
- getResource("schemas/configuration/http-jetty.xsd");
- }
- return super.findCoreSchemaLocation(s);
- }
-
- @SuppressWarnings("rawtypes")
- public Set<Class> getManagedClasses() {
- return null;
- }
-
- public Metadata parse(Element element, ParserContext parserContext) {
- if (LOG.isLoggable(Level.FINE)) {
- LOG.fine("Parsing element {{" + element.getNamespaceURI() + "}}{"
+ element.getLocalName() + "}");
- }
-
- if (JETTY_ENGINE.equals(element.getLocalName())) {
- //This doesn't hit normal configs.
- return new JettyServerEngineParser().parse(element, parserContext);
- } else if (JETTY_ENGINE_FACTORY.equals(element.getLocalName())) {
-
- return new JettyServerEngineFactoryParser().parse(element,
parserContext);
- }
-
- return null;
- }
-
- public ComponentMetadata decorate(Node node,
- ComponentMetadata componentMetadata,
- ParserContext parserContext) {
- LOG.info("Decorating node " + node + " " + componentMetadata);
- return componentMetadata;
- }
-}
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyHTTPServerEngineFactoryHolder.java
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyHTTPServerEngineFactoryHolder.java
deleted file mode 100644
index 5745d88b..00000000
---
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyHTTPServerEngineFactoryHolder.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.camel.component.cxf.transport.http_jetty.blueprint;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.logging.Logger;
-
-import org.w3c.dom.Element;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.JAXBElement;
-import jakarta.xml.bind.JAXBException;
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.common.jaxb.JAXBContextCache;
-import org.apache.cxf.common.jaxb.JAXBUtils;
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.PackageUtils;
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.configuration.jsse.TLSServerParametersConfig;
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine;
-import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
-import org.apache.cxf.transport.http_jetty.ThreadingParameters;
-import
org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineConfigType;
-import
org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineFactoryConfigType;
-import
org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType;
-import
org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersIdentifiedType;
-import
org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersType;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Handler;
-
-public class JettyHTTPServerEngineFactoryHolder {
-
- private static final Logger LOG =
LogUtils.getL7dLogger(JettyHTTPServerEngineFactoryHolder.class);
-
- private String parsedElement;
- private JettyHTTPServerEngineFactory factory;
-
- private Map<String, Connector> connectorMap;
-
- private Map<String, List<Handler>> handlersMap;
-
- private JAXBContext jaxbContext;
- private Set<Class<?>> jaxbClasses;
-
- public JettyHTTPServerEngineFactoryHolder() {
- }
-
- public void init() {
- try {
- Element element = StaxUtils.read(new
StringReader(parsedElement)).getDocumentElement();
-
- JettyHTTPServerEngineFactoryConfigType config
- = getJaxbObject(element,
- JettyHTTPServerEngineFactoryConfigType.class);
-
- Bus defaultBus = BusFactory.getDefaultBus();
- factory = new JettyHTTPServerEngineFactory(defaultBus);
-
- Map<String, ThreadingParameters> threadingParametersMap
- = new TreeMap<>();
-
- if (config.getIdentifiedThreadingParameters() != null) {
- for (ThreadingParametersIdentifiedType threads :
config.getIdentifiedThreadingParameters()) {
- ThreadingParameters rThreads = new ThreadingParameters();
- String id = threads.getId();
- if (threads.getThreadingParameters().getMaxThreads() !=
null) {
-
rThreads.setMaxThreads(threads.getThreadingParameters().getMaxThreads());
- }
- if (threads.getThreadingParameters().getMinThreads() !=
null) {
-
rThreads.setMinThreads(threads.getThreadingParameters().getMinThreads());
- }
-
rThreads.setThreadNamePrefix(threads.getThreadingParameters().getThreadNamePrefix());
- threadingParametersMap.put(id, rThreads);
- }
-
- factory.setThreadingParametersMap(threadingParametersMap);
- }
-
- //SSL
- Map<String, TLSServerParameters> sslMap = new TreeMap<>();
- if (config.getIdentifiedTLSServerParameters() != null) {
-
- for (TLSServerParametersIdentifiedType t :
config.getIdentifiedTLSServerParameters()) {
- try {
- TLSServerParameters parameter
- = new
TLSServerParametersConfig(t.getTlsServerParameters());
- sslMap.put(t.getId(), parameter);
- } catch (Exception e) {
- throw new RuntimeException("Could not configure TLS
for id " + t.getId(), e);
- }
- }
- factory.setTlsServerParametersMap(sslMap);
- }
- //Engines
-
- List<JettyHTTPServerEngine> engineList = new ArrayList<>();
- for (JettyHTTPServerEngineConfigType engine : config.getEngine()) {
- JettyHTTPServerEngine eng = new JettyHTTPServerEngine(
- factory.getMBeanContainer(), engine.getHost(),
engine.getPort());
- if (engine.getConnector() != null && connectorMap != null) {
- // we need to setup the Connector from the connectorMap
- Connector connector =
connectorMap.get(engine.getPort().toString());
- if (connector != null) {
- eng.setConnector(connector);
- } else {
- throw new RuntimeException("Could not find the
connector instance for engine with port"
- + engine.getPort().toString());
- }
- }
- if (engine.getHandlers() != null && handlersMap != null) {
- List<Handler> handlers =
handlersMap.get(engine.getPort().toString());
- if (handlers != null) {
- eng.setHandlers(handlers);
- } else {
- throw new RuntimeException("Could not find the
handlers instance for engine with port"
- + engine.getPort().toString());
- }
- }
-
- if (engine.isContinuationsEnabled() != null) {
-
eng.setContinuationsEnabled(engine.isContinuationsEnabled());
- }
- if (engine.isSendServerVersion() != null) {
- eng.setSendServerVersion(engine.isSendServerVersion());
- }
- if (engine.getHost() != null &&
!StringUtils.isEmpty(engine.getHost())) {
- eng.setHost(engine.getHost());
- }
- if (engine.getMaxIdleTime() != null) {
- eng.setMaxIdleTime(engine.getMaxIdleTime());
- }
- if (engine.getPort() != null) {
- eng.setPort(engine.getPort());
- }
- if (engine.isReuseAddress() != null) {
- eng.setReuseAddress(engine.isReuseAddress());
- }
- if (engine.isSessionSupport() != null) {
- eng.setSessionSupport(engine.isSessionSupport());
- }
- if (engine.getSessionTimeout() != null) {
-
eng.setSessionTimeout(engine.getSessionTimeout().intValue());
- }
- if (engine.getThreadingParameters() != null) {
- ThreadingParametersType threads =
engine.getThreadingParameters();
- ThreadingParameters rThreads = new ThreadingParameters();
- if (threads.getMaxThreads() != null) {
- rThreads.setMaxThreads(threads.getMaxThreads());
- }
- if (threads.getMinThreads() != null) {
- rThreads.setMinThreads(threads.getMinThreads());
- }
-
- eng.setThreadingParameters(rThreads);
- }
-
- //eng.setServer(engine.getTlsServerParameters());
- if (engine.getTlsServerParameters() != null
- && (engine.getTlsServerParameters().getKeyManagers()
!= null
- || engine.getTlsServerParameters().getTrustManagers()
!= null)) {
- try {
- TLSServerParameters parameter =
- new
TLSServerParametersConfig(engine.getTlsServerParameters());
- eng.setTlsServerParameters(parameter);
- } catch (Exception e) {
- throw new RuntimeException("Could not configure TLS
for engine on "
- + eng.getHost() + ":" + eng.getPort(), e);
- }
- }
- eng.finalizeConfig();
-
- engineList.add(eng);
- }
- factory.setEnginesList(engineList);
- //Unravel this completely.
-
- factory.initComplete();
- } catch (Exception e) {
- throw new RuntimeException("Could not process configuration.", e);
- }
- }
-
- public void destroy() {
- // need to release the reference of the jaxb Classes
- factory.postShutdown();
- jaxbClasses.clear();
- jaxbContext = null;
- }
-
- public String getParsedElement() {
- return parsedElement;
- }
-
- public void setParsedElement(String parsedElement) {
- this.parsedElement = parsedElement;
- }
-
- public void setConnectorMap(Map<String, Connector> connectorMap) {
- this.connectorMap = connectorMap;
- }
-
- public void setHandlersMap(Map<String, List<Handler>> handlersMap) {
- this.handlersMap = handlersMap;
- }
-
- protected <T> T getJaxbObject(Element parent, Class<T> c) {
-
- try {
- JAXBElement<T> ele = JAXBUtils.unmarshall(getContext(c), parent,
c);
- return ele.getValue();
- } catch (JAXBException e) {
- LOG.warning("Unable to parse property due to " + e);
- return null;
- }
- }
-
- protected synchronized JAXBContext getContext(Class<?> cls) {
- if (jaxbContext == null || jaxbClasses == null ||
!jaxbClasses.contains(cls)) {
- try {
- Set<Class<?>> tmp = new HashSet<>();
- if (jaxbClasses != null) {
- tmp.addAll(jaxbClasses);
- }
- JAXBContextCache.addPackage(tmp,
PackageUtils.getPackageName(cls),
- cls == null ? getClass().getClassLoader() :
cls.getClassLoader());
- if (cls != null) {
- boolean hasOf = false;
- for (Class<?> c : tmp) {
- if (c.getPackage() == cls.getPackage() &&
"ObjectFactory".equals(c.getSimpleName())) {
- hasOf = true;
- }
- }
- if (!hasOf) {
- tmp.add(cls);
- }
- }
- JAXBContextCache.scanPackages(tmp);
- JAXBContextCache.CachedContextAndSchemas ccs
- = JAXBContextCache.getCachedContextAndSchemas(tmp,
null, null, null, false);
- jaxbClasses = ccs.getClasses();
- jaxbContext = ccs.getContext();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
- }
- return jaxbContext;
- }
-}
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyServerEngineFactoryParser.java
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyServerEngineFactoryParser.java
deleted file mode 100644
index 2980d014..00000000
---
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyServerEngineFactoryParser.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.camel.component.cxf.transport.http_jetty.blueprint;
-
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.UUID;
-
-import org.w3c.dom.Element;
-
-import org.apache.aries.blueprint.ParserContext;
-import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
-import org.apache.aries.blueprint.mutable.MutableMapMetadata;
-import
org.apache.camel.component.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.helpers.DOMUtils;
-import org.apache.cxf.staxutils.StaxUtils;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.Metadata;
-import org.osgi.service.blueprint.reflect.ValueMetadata;
-
-public class JettyServerEngineFactoryParser extends
AbstractBPBeanDefinitionParser {
-
- public static final String JETTY_TRANSPORT =
"http://cxf.apache.org/transports/http-jetty/configuration";
-
- public static final String JETTY_THREADING =
"http://cxf.apache.org/configuration/parameterized-types";
-
- public static String getIdOrName(Element elem) {
- String id = elem.getAttribute("id");
-
- if (null == id || "".equals(id)) {
- String names = elem.getAttribute("name");
- if (null != names) {
- StringTokenizer st = new StringTokenizer(names, ",");
- if (st.countTokens() > 0) {
- id = st.nextToken();
- }
- }
- }
- return id;
- }
-
- public Metadata parse(Element element, ParserContext context) {
-
- //Endpoint definition
- MutableBeanMetadata ef =
context.createMetadata(MutableBeanMetadata.class);
- if (!StringUtils.isEmpty(getIdOrName(element))) {
- ef.setId(getIdOrName(element));
- } else {
- ef.setId("jetty.engine.factory-holder-" +
UUID.randomUUID().toString());
- }
- ef.setRuntimeClass(JettyHTTPServerEngineFactoryHolder.class);
-
- // setup the ConnectorMap and HandlersMap property for the
JettyHTTPServerEngineFactoryHolder
-
- try {
- // Print the DOM node
- String xmlString = StaxUtils.toString(element);
- ef.addProperty("parsedElement", createValue(context, xmlString));
- ef.setInitMethod("init");
- ef.setActivation(ComponentMetadata.ACTIVATION_EAGER);
- ef.setDestroyMethod("destroy");
-
- // setup the EngineConnector
- List<Element> engines = DOMUtils
- .getChildrenWithName(element,
HTTPJettyTransportNamespaceHandler.JETTY_TRANSPORT, "engine");
- ef.addProperty("connectorMap", parseEngineConnector(engines, ef,
context));
- ef.addProperty("handlersMap", parseEngineHandlers(engines, ef,
context));
- return ef;
- } catch (Exception e) {
- throw new RuntimeException("Could not process configuration.", e);
- }
- }
-
- protected Metadata parseEngineConnector(List<Element> engines,
ComponentMetadata enclosingComponent,
- ParserContext context) {
- MutableMapMetadata map =
context.createMetadata(MutableMapMetadata.class);
- map.setKeyType("java.lang.String");
- map.setValueType("org.eclipse.jetty.server.Connector");
-
- for (Element engine : engines) {
- String port = engine.getAttribute("port");
- ValueMetadata keyValue = createValue(context, port);
- Element connector = DOMUtils
- .getFirstChildWithName(engine,
HTTPJettyTransportNamespaceHandler.JETTY_TRANSPORT,
- "connector");
- if (connector != null) {
- Element first = DOMUtils.getFirstElement(connector);
- Metadata valValue = context.parseElement(Metadata.class,
enclosingComponent, first);
- map.addEntry(keyValue, valValue);
- }
- }
-
- return map;
- }
-
- protected Metadata parseEngineHandlers(List<Element> engines,
ComponentMetadata enclosingComponent,
- ParserContext context) {
- MutableMapMetadata map =
context.createMetadata(MutableMapMetadata.class);
- map.setKeyType("java.lang.String");
- map.setValueType("java.util.List");
-
- for (Element engine : engines) {
- String port = engine.getAttribute("port");
- ValueMetadata keyValue = createValue(context, port);
- Element handlers = DOMUtils
- .getFirstChildWithName(engine,
HTTPJettyTransportNamespaceHandler.JETTY_TRANSPORT,
- "handlers");
- if (handlers != null) {
- Metadata valValue = parseListData(context, enclosingComponent,
handlers);
- map.addEntry(keyValue, valValue);
- }
- }
- return map;
- }
-
-
-}
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/osgi/HTTPJettyDestinationFactory.java
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/osgi/HTTPJettyDestinationFactory.java
deleted file mode 100644
index 61fa21f4..00000000
---
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/osgi/HTTPJettyDestinationFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.camel.component.cxf.transport.http_jetty.osgi;
-
-import java.io.IOException;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.common.injection.NoJSR250Annotations;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.http.AbstractHTTPDestination;
-import org.apache.cxf.transport.http.DestinationRegistry;
-import org.apache.cxf.transport.http.HttpDestinationFactory;
-import org.apache.cxf.transport.http_jetty.JettyHTTPDestination;
-import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
-
-@NoJSR250Annotations()
-public class HTTPJettyDestinationFactory implements HttpDestinationFactory {
-
- @Override
- public AbstractHTTPDestination createDestination(EndpointInfo
endpointInfo, Bus bus, DestinationRegistry registry)
- throws IOException {
- if (bus.getExtension(ClassLoader.class) == null) {
-
bus.setExtension(HTTPJettyDestinationFactory.class.getClassLoader(),
ClassLoader.class);
- }
- return new JettyHTTPDestination(bus, registry, endpointInfo,
bus.getExtension(JettyHTTPServerEngineFactory.class));
- }
-}
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/osgi/HTTPJettyTransportActivator.java
b/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/osgi/HTTPJettyTransportActivator.java
deleted file mode 100644
index 9ff3f17a..00000000
---
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/osgi/HTTPJettyTransportActivator.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.camel.component.cxf.transport.http_jetty.osgi;
-
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.management.MBeanServer;
-
-import
org.apache.camel.component.cxf.bus.blueprint.BlueprintNameSpaceHandlerFactory;
-import org.apache.camel.component.cxf.bus.blueprint.NamespaceHandlerRegisterer;
-import
org.apache.camel.component.cxf.transport.http_jetty.blueprint.HTTPJettyTransportNamespaceHandler;
-import org.apache.cxf.common.util.CollectionUtils;
-import org.apache.cxf.configuration.jsse.TLSParameterJaxBUtils;
-import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.configuration.security.CertStoreType;
-import org.apache.cxf.configuration.security.CertificateConstraintsType;
-import org.apache.cxf.configuration.security.ClientAuthentication;
-import org.apache.cxf.configuration.security.CombinatorType;
-import org.apache.cxf.configuration.security.DNConstraintsType;
-import org.apache.cxf.configuration.security.FiltersType;
-import org.apache.cxf.configuration.security.KeyManagersType;
-import org.apache.cxf.configuration.security.KeyStoreType;
-import org.apache.cxf.configuration.security.SecureRandomParameters;
-import org.apache.cxf.configuration.security.TrustManagersType;
-import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine;
-import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
-import org.apache.cxf.transport.http_jetty.ThreadingParameters;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedServiceFactory;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class HTTPJettyTransportActivator
- implements BundleActivator, ManagedServiceFactory {
- public static final String FACTORY_PID = "org.apache.cxf.http.jetty";
-
- BundleContext context;
- MBeanServer mbeans;
- ServiceTracker<MBeanServer, ?> mbeanServerTracker;
- ServiceRegistration<ManagedServiceFactory> reg;
-
- JettyHTTPServerEngineFactory factory = new JettyHTTPServerEngineFactory() {
- public MBeanServer getMBeanServer() {
- return (MBeanServer)mbeanServerTracker.getService();
- }
- };
-
- public void start(BundleContext ctx) throws Exception {
- this.context = ctx;
- mbeanServerTracker = new ServiceTracker<>(ctx, MBeanServer.class,
null);
- try {
- BlueprintNameSpaceHandlerFactory nsHandlerFactory = new
BlueprintNameSpaceHandlerFactory() {
-
- @Override
- public Object createNamespaceHandler() {
- return new HTTPJettyTransportNamespaceHandler();
- }
- };
- NamespaceHandlerRegisterer.register(context, nsHandlerFactory,
-
"http://cxf.apache.org/transports/http-jetty/configuration");
- } catch (NoClassDefFoundError e) {
- // Blueprint not available, ignore
- }
- reg = context.registerService(ManagedServiceFactory.class,
- this,
- CollectionUtils.singletonDictionary(Constants.SERVICE_PID,
FACTORY_PID));
-
- }
-
- public void stop(BundleContext ctx) throws Exception {
- mbeanServerTracker.close();
- reg.unregister();
- }
-
- public String getName() {
- return FACTORY_PID;
- }
-
- public void updated(String pid, Dictionary<String, ?> properties)
- throws ConfigurationException {
- if (pid == null) {
- return;
- }
- int port = Integer.parseInt((String)properties.get("port"));
-
- String host = (String)properties.get("host");
- try {
- TLSServerParameters tls = createTlsServerParameters(properties);
- if (tls != null) {
- factory.setTLSServerParametersForPort(host, port, tls);
- } else {
- factory.createJettyHTTPServerEngine(host, port, "http");
- }
-
- JettyHTTPServerEngine e =
factory.retrieveJettyHTTPServerEngine(port);
- configure(e, properties);
- } catch (GeneralSecurityException | IOException e) {
- throw new ConfigurationException(null, null, e);
- }
- }
-
-
- private void configure(JettyHTTPServerEngine e, Dictionary<String, ?>
properties) {
- ThreadingParameters threading = createThreadingParameters(properties);
- if (threading != null) {
- e.setThreadingParameters(threading);
- }
- Enumeration<String> keys = properties.keys();
- while (keys.hasMoreElements()) {
- String k = keys.nextElement();
- if ("sessionSupport".equals(k)) {
-
e.setSessionSupport(Boolean.parseBoolean((String)properties.get(k)));
- } else if ("continuationsEnabled".equals(k)) {
-
e.setContinuationsEnabled(Boolean.parseBoolean((String)properties.get(k)));
- } else if ("sendServerVersion".equals(k)) {
-
e.setSendServerVersion(Boolean.parseBoolean((String)properties.get(k)));
- } else if ("reuseAddress".equals(k)) {
-
e.setReuseAddress(Boolean.parseBoolean((String)properties.get(k)));
- } else if ("maxIdleTime".equals(k)) {
- e.setMaxIdleTime(Integer.parseInt((String)properties.get(k)));
- } else if ("sessionTimeout".equals(k)) {
-
e.setSessionTimeout(Integer.parseInt((String)properties.get(k)));
- }
- }
- }
-
- public void deleted(String pid) {
- }
-
- private ThreadingParameters createThreadingParameters(Dictionary<String,
?> d) {
- Enumeration<String> keys = d.keys();
- ThreadingParameters p = null;
- while (keys.hasMoreElements()) {
- String k = keys.nextElement();
- if (k.startsWith("threadingParameters.")) {
- if (p == null) {
- p = new ThreadingParameters();
- }
- String v = (String)d.get(k);
- k = k.substring("threadingParameters.".length());
- if ("minThreads".equals(k)) {
- p.setMinThreads(Integer.parseInt(v));
- } else if ("maxThreads".equals(k)) {
- p.setMaxThreads(Integer.parseInt(v));
- } else if ("threadNamePrefix".equals(k)) {
- p.setThreadNamePrefix(k);
- }
- }
- }
- return p;
- }
-
- private TLSServerParameters createTlsServerParameters(Dictionary<String,
?> d) {
- Enumeration<String> keys = d.keys();
- TLSServerParameters p = null;
- SecureRandomParameters srp = null;
- KeyManagersType kmt = null;
- TrustManagersType tmt = null;
- boolean enableRevocation = false;
- while (keys.hasMoreElements()) {
- String k = keys.nextElement();
- if (k.startsWith("tlsServerParameters.")) {
- if (p == null) {
- p = new TLSServerParameters();
- }
- String v = (String)d.get(k);
- k = k.substring("tlsServerParameters.".length());
-
- if ("secureSocketProtocol".equals(k)) {
- p.setSecureSocketProtocol(v);
- } else if ("jsseProvider".equals(k)) {
- p.setJsseProvider(v);
- } else if ("certAlias".equals(k)) {
- p.setCertAlias(v);
- } else if ("clientAuthentication.want".equals(k)) {
- if (p.getClientAuthentication() == null) {
- p.setClientAuthentication(new ClientAuthentication());
- }
-
p.getClientAuthentication().setWant(Boolean.parseBoolean(v));
- } else if ("clientAuthentication.required".equals(k)) {
- if (p.getClientAuthentication() == null) {
- p.setClientAuthentication(new ClientAuthentication());
- }
-
p.getClientAuthentication().setRequired(Boolean.parseBoolean(v));
- } else if ("enableRevocation".equals(k)) {
- enableRevocation = Boolean.parseBoolean(v);
- } else if (k.startsWith("certConstraints.")) {
- configureCertConstraints(p, k, v);
- } else if (k.startsWith("secureRandomParameters.")) {
- srp = configureSecureRandom(srp, k, v);
- } else if (k.startsWith("cipherSuitesFilter.")) {
- configureCipherSuitesFilter(p, k, v);
- } else if (k.startsWith("cipherSuites")) {
- StringTokenizer st = new StringTokenizer(v, ",");
- while (st.hasMoreTokens()) {
- p.getCipherSuites().add(st.nextToken());
- }
- } else if (k.startsWith("excludeProtocols")) {
- StringTokenizer st = new StringTokenizer(v, ",");
- while (st.hasMoreTokens()) {
- p.getExcludeProtocols().add(st.nextToken());
- }
- } else if (k.startsWith("trustManagers.")) {
- tmt = getTrustManagers(tmt,
- k.substring("trustManagers.".length()),
- v);
- } else if (k.startsWith("keyManagers.")) {
- kmt = getKeyManagers(kmt,
- k.substring("keyManagers.".length()),
- v);
- }
- }
- }
-
- try {
- if (srp != null) {
- p.setSecureRandom(TLSParameterJaxBUtils.getSecureRandom(srp));
- }
- if (kmt != null) {
- p.setKeyManagers(TLSParameterJaxBUtils.getKeyManagers(kmt));
- }
- if (tmt != null) {
- p.setTrustManagers(TLSParameterJaxBUtils.getTrustManagers(tmt,
enableRevocation));
- }
- } catch (RuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- return p;
- }
-
- private void configureCipherSuitesFilter(TLSServerParameters p, String k,
String v) {
- k = k.substring("cipherSuitesFilter.".length());
- StringTokenizer st = new StringTokenizer(v, ",");
- FiltersType ft = p.getCipherSuitesFilter();
- if (ft == null) {
- ft = new FiltersType();
- p.setCipherSuitesFilter(ft);
- }
- List<String> lst = "include".equals(k) ? ft.getInclude() :
ft.getExclude();
- while (st.hasMoreTokens()) {
- lst.add(st.nextToken());
- }
- }
-
- private SecureRandomParameters
configureSecureRandom(SecureRandomParameters srp, String k, String v) {
- k = k.substring("secureRandomParameters.".length());
- if (srp == null) {
- srp = new SecureRandomParameters();
- }
- if ("algorithm".equals(k)) {
- srp.setAlgorithm(v);
- } else if ("provider".equals(k)) {
- srp.setProvider(v);
- }
- return srp;
- }
-
- private void configureCertConstraints(TLSServerParameters p, String k,
String v) {
- k = k.substring("certConstraints.".length());
- CertificateConstraintsType cct = p.getCertConstraints();
- if (cct == null) {
- cct = new CertificateConstraintsType();
- p.setCertConstraints(cct);
- }
- DNConstraintsType dnct = null;
- if (k.startsWith("SubjectDNConstraints.")) {
- dnct = cct.getSubjectDNConstraints();
- if (dnct == null) {
- dnct = new DNConstraintsType();
- cct.setSubjectDNConstraints(dnct);
- }
- k = k.substring("SubjectDNConstraints.".length());
- } else if (k.startsWith("IssuerDNConstraints.")) {
- dnct = cct.getIssuerDNConstraints();
- if (dnct == null) {
- dnct = new DNConstraintsType();
- cct.setIssuerDNConstraints(dnct);
- }
- k = k.substring("IssuerDNConstraints.".length());
- }
- if (dnct != null) {
- if ("combinator".equals(k)) {
- dnct.setCombinator(CombinatorType.fromValue(v));
- } else if ("RegularExpression".equals(k)) {
- dnct.getRegularExpression().add(k);
- }
- }
- }
-
- private KeyManagersType getKeyManagers(KeyManagersType keyManagers, String
k, String v) {
- if (keyManagers == null) {
- keyManagers = new KeyManagersType();
- }
- if ("factoryAlgorithm".equals(k)) {
- keyManagers.setFactoryAlgorithm(v);
- } else if ("provider".equals(k)) {
- keyManagers.setProvider(v);
- } else if ("keyPassword".equals(k)) {
- keyManagers.setKeyPassword(v);
- } else if (k.startsWith("keyStore.")) {
- keyManagers.setKeyStore(getKeyStore(keyManagers.getKeyStore(),
- k.substring("keyStore.".length()),
- v));
- }
- return keyManagers;
- }
-
- private KeyStoreType getKeyStore(KeyStoreType ks, String k, String v) {
- if (ks == null) {
- ks = new KeyStoreType();
- }
- if ("type".equals(k)) {
- ks.setType(v);
- } else if ("password".equals(k)) {
- ks.setPassword(v);
- } else if ("provider".equals(k)) {
- ks.setProvider(v);
- } else if ("url".equals(k)) {
- ks.setUrl(v);
- } else if ("file".equals(k)) {
- ks.setFile(v);
- } else if ("resource".equals(k)) {
- ks.setResource(v);
- }
- return ks;
- }
-
- private TrustManagersType getTrustManagers(TrustManagersType tmt, String
k, String v) {
- if (tmt == null) {
- tmt = new TrustManagersType();
- }
- if ("provider".equals(k)) {
- tmt.setProvider(v);
- } else if ("factoryAlgorithm".equals(k)) {
- tmt.setFactoryAlgorithm(v);
- } else if (k.startsWith("keyStore.")) {
- tmt.setKeyStore(getKeyStore(tmt.getKeyStore(),
- k.substring("keyStore.".length()),
- v));
- } else if (k.startsWith("certStore")) {
- tmt.setCertStore(getCertStore(tmt.getCertStore(),
- k.substring("certStore.".length()),
- v));
- }
- return tmt;
- }
-
- private CertStoreType getCertStore(CertStoreType cs, String k, String v) {
- if (cs == null) {
- cs = new CertStoreType();
- }
- if ("file".equals(k)) {
- cs.setFile(v);
- } else if ("url".equals(k)) {
- cs.setUrl(v);
- } else if ("resource".equals(k)) {
- cs.setResource(v);
- }
- return cs;
- }
-
-
-
-
-
-}
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/resources/META-INF/cxf/bus-extensions.txt
b/components/camel-cxf/camel-cxf-all/src/main/resources/META-INF/cxf/bus-extensions.txt
index 8fd23f73..7ad7d9c7 100644
---
a/components/camel-cxf/camel-cxf-all/src/main/resources/META-INF/cxf/bus-extensions.txt
+++
b/components/camel-cxf/camel-cxf-all/src/main/resources/META-INF/cxf/bus-extensions.txt
@@ -29,8 +29,6 @@
org.apache.cxf.transport.http.HTTPWSDLExtensionLoader::true:true
org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder::true:true
org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder::true:true
org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider::true:true
-org.apache.camel.component.cxf.transport.http_jetty.osgi.HTTPJettyDestinationFactory::true
-org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory::true
org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder::true:true
org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder::true:true
org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider::true:true
diff --git a/features/src/main/feature/camel-features.xml
b/features/src/main/feature/camel-features.xml
index 59087f61..db9e8473 100644
--- a/features/src/main/feature/camel-features.xml
+++ b/features/src/main/feature/camel-features.xml
@@ -890,7 +890,6 @@
<feature version="[6,7)">jakarta-servlet</feature>
<feature
version="${camel-osgi-jakarta-jws-version}">jakarta-jws</feature>
<feature version="[3,4)">jakarta-validation</feature>
- <feature version="[11,12)">jetty</feature>
<bundle
dependency="true">mvn:org.glassfish.hk2/osgi-resource-locator/${osgi-resource-locator-version}</bundle>
<bundle
dependency="true">mvn:org.apache.neethi/neethi/${auto-detect-version}</bundle>
<bundle
dependency="true">mvn:org.apache.ws.xmlschema/xmlschema-core/${auto-detect-version}</bundle>
diff --git a/tests/camel-integration-test/pom.xml
b/tests/camel-integration-test/pom.xml
index efc453cb..a8bf5e25 100644
--- a/tests/camel-integration-test/pom.xml
+++ b/tests/camel-integration-test/pom.xml
@@ -85,6 +85,7 @@
org.awaitility*,
org.slf4j
</Import-Package>
+ <DynamicImport-Package>*</DynamicImport-Package>
</instructions>
<excludeDependencies>geronimo-atinject_1.0_spec</excludeDependencies>
</configuration>
diff --git
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java
index c865be71..72a6c69c 100644
---
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java
+++
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java
@@ -50,6 +50,10 @@ public abstract class AbstractCamelRouteITest extends
KarafTestSupport implement
public static final int CAMEL_KARAF_INTEGRATION_TEST_DEBUG_DEFAULT_PORT =
8889;
public static final String CAMEL_KARAF_INTEGRATION_TEST_DEBUG_PROPERTY =
"camel.karaf.itest.debug";
+ static final int CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_DEFAULT
= 3;
+ static final int
CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_INTERVAL_DEFAULT = 5;
+ static final String
CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_PROPERTY =
"camel.karaf.itest.context.finder.retry";
+ static final String
CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_INTERVAL_PROPERTY =
"camel.karaf.itest.context.finder.retry.interval";
static final String CAMEL_KARAF_INTEGRATION_TEST_ROUTE_SUPPLIERS_PROPERTY
= "camel.karaf.itest.route.suppliers";
static final String
CAMEL_KARAF_INTEGRATION_TEST_IGNORE_ROUTE_SUPPLIERS_PROPERTY =
"camel.karaf.itest.ignore.route.suppliers";
@@ -125,7 +129,7 @@ public abstract class AbstractCamelRouteITest extends
KarafTestSupport implement
* {@link #CAMEL_KARAF_INTEGRATION_TEST_DEBUG_PROPERTY} is set.
* @return {@code true} if the debug mode is enabled, {@code false}
otherwise
*/
- private boolean isDebugModeEnabled() {
+ private static boolean isDebugModeEnabled() {
return System.getProperty(CAMEL_KARAF_INTEGRATION_TEST_DEBUG_PROPERTY)
!= null;
}
@@ -134,10 +138,36 @@ public abstract class AbstractCamelRouteITest extends
KarafTestSupport implement
* {@link #CAMEL_KARAF_INTEGRATION_TEST_DEBUG_PROPERTY}. The default value
is {@link #CAMEL_KARAF_INTEGRATION_TEST_DEBUG_DEFAULT_PORT}.
* @return the debug port
*/
- private int getDebugPort() {
+ private static int getDebugPort() {
return Integer.getInteger(CAMEL_KARAF_INTEGRATION_TEST_DEBUG_PROPERTY,
CAMEL_KARAF_INTEGRATION_TEST_DEBUG_DEFAULT_PORT);
}
+ /**
+ * Returns the number of retries to perform when trying to find a Camel
context, corresponding to the value of the
+ * system property {@link
#CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_PROPERTY}. The default value
is
+ * {@link #CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_DEFAULT}.
+ * @return the number of retries
+ */
+ private static int getContextFinderRetry() {
+ return Integer.getInteger(
+ CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_PROPERTY,
+ CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_DEFAULT
+ );
+ }
+
+ /**
+ * Returns the interval in seconds between each retry when trying to find
a Camel context, corresponding to the value of the
+ * system property {@link
#CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_INTERVAL_PROPERTY}. The
default value is
+ * {@link
#CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_INTERVAL_DEFAULT}.
+ * @return
+ */
+ private static int getContextFinderRetryInterval() {
+ return Integer.getInteger(
+
CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_INTERVAL_PROPERTY,
+ CAMEL_KARAF_INTEGRATION_TEST_CONTEXT_FINDER_RETRY_INTERVAL_DEFAULT
+ );
+ }
+
/**
* Update the ports in the given options to work around the issue with the
default method {@code getAvailablePort}
* that doesn't seem to work properly on macOS because the ports are not
modified when a Karaf instance is already
@@ -427,9 +457,27 @@ public abstract class AbstractCamelRouteITest extends
KarafTestSupport implement
abstract Class<? extends CamelContext> getCamelContextClass();
CamelContext getCamelContextClass(BundleContext bundleContext, String
name) throws InvalidSyntaxException {
+ for (int i = 0; i < getContextFinderRetry(); i++) {
+ CamelContext camelContext = findCamelContext(bundleContext,
name);
+ if (camelContext != null) {
+ return camelContext;
+ }
+ LOG.warn("No CamelContext could be found matching the criteria
(mode = {}, name = {}), retrying in {} seconds",
+ this, name, getContextFinderRetryInterval());
+ try {
+ Thread.sleep(getContextFinderRetryInterval() * 1_000L);
+ } catch (InterruptedException ex) {
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ throw new IllegalStateException("No CamelContext could be found
matching the criteria (mode = " + this + ", name = " + name + ")");
+ }
+
+ private CamelContext findCamelContext(BundleContext bundleContext,
String name) throws InvalidSyntaxException {
ServiceReference<?>[] references =
bundleContext.getServiceReferences(CamelContext.class.getName(), null);
if (references == null) {
- throw new IllegalStateException("No CamelContext available");
+ return null;
}
for (ServiceReference<?> reference : references) {
if (reference == null) {
@@ -441,7 +489,7 @@ public abstract class AbstractCamelRouteITest extends
KarafTestSupport implement
return camelContext;
}
}
- throw new IllegalStateException("No CamelContext could be found
matching the criteria (mode = " + this + ", name = " + name + ")");
+ return null;
}
}
diff --git
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultFileBasedRoute.java
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultFileBasedRoute.java
index 5be4e71c..bdd35405 100644
---
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultFileBasedRoute.java
+++
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultFileBasedRoute.java
@@ -45,6 +45,10 @@ public abstract class
AbstractCamelSingleFeatureResultFileBasedRoute implements
return provider.getTemplate();
}
+ protected CamelContextProvider getProvider() {
+ return provider;
+ }
+
public void testRoutes() throws Exception {
triggerProducerRoute();
executeTest();
diff --git
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultMockBasedRoute.java
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultMockBasedRoute.java
index 2e6118b6..e5a6d42f 100644
---
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultMockBasedRoute.java
+++
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelSingleFeatureResultMockBasedRoute.java
@@ -28,6 +28,10 @@ public abstract class
AbstractCamelSingleFeatureResultMockBasedRoute implements
this.provider = provider;
}
+ protected CamelContextProvider getProvider() {
+ return provider;
+ }
+
@Override
public CamelContext getContext() {
return provider.getContext();
diff --git
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/CamelContextProvider.java
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/CamelContextProvider.java
index eb6e62aa..0190159e 100644
---
a/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/CamelContextProvider.java
+++
b/tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/CamelContextProvider.java
@@ -31,6 +31,13 @@ public interface CamelContextProvider {
return getContext(name, true);
}
+ /**
+ * Returns the {@link CamelContext} associated with a java test
+ */
+ default CamelContext getDefaultContext() {
+ return getContext(null, false);
+ }
+
/**
* Returns the {@link ProducerTemplate} associated with the given class
according to the annotation
* {@link CamelKarafTestHint}.
@@ -56,4 +63,11 @@ public interface CamelContextProvider {
default ProducerTemplate getTemplate(String name) {
return getTemplate(name, true);
}
+
+ /**
+ * Returns the {@link ProducerTemplate} associated with a java test
+ */
+ default ProducerTemplate getDefaultTemplate() {
+ return getTemplate(null, false);
+ }
}
diff --git a/tests/features/camel-cxf/pom.xml b/tests/features/camel-cxf/pom.xml
new file mode 100644
index 00000000..a52fddf9
--- /dev/null
+++ b/tests/features/camel-cxf/pom.xml
@@ -0,0 +1,94 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-karaf-features-test</artifactId>
+ <version>4.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-cxf-test</artifactId>
+ <name>Apache Camel :: Karaf :: Tests :: Features :: CXF</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ <version>${jakarta-ws-rs-api-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ <version>${jakarta-xml-bind-api-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-cxf-common</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${cxf-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.2</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <phase>integration-test</phase>
+ <configuration>
+ <excludes>
+ <exclude>none</exclude>
+ </excludes>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <systemPropertyVariables>
+
<camel.karaf.version>${project.version}</camel.karaf.version>
+
<project.version>${project.version}</project.version>
+
<project.target>${project.build.directory}</project.target>
+
<users.file.location>${users.file.location}</users.file.location>
+
<org.ops4j.pax.logging.DefaultServiceLog.level>WARN</org.ops4j.pax.logging.DefaultServiceLog.level>
+ <cxf.version>${cxf-version}</cxf.version>
+ </systemPropertyVariables>
+
<forkedProcessExitTimeoutInSeconds>5</forkedProcessExitTimeoutInSeconds>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git
a/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/CamelCxfRsRouteSupplier.java
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/CamelCxfRsRouteSupplier.java
new file mode 100644
index 00000000..1abbef7d
--- /dev/null
+++
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/CamelCxfRsRouteSupplier.java
@@ -0,0 +1,59 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.karaf.camel.test;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.karaf.camel.itests.CamelRouteSupplier;
+import org.apache.karaf.camel.test.beans.Customer;
+import org.osgi.service.component.annotations.Component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@Component(
+ name = "karaf-camel-cxf-rs-test",
+ immediate = true,
+ service = CamelRouteSupplier.class
+)
+public class CamelCxfRsRouteSupplier implements CamelRouteSupplier {
+ private static final String PORT_RS_PATH =
System.getProperty("cxf.rs.port") + "/CamelCxfRsRouteSupplier";
+ private static final String CXF_RS_ENDPOINT_URI =
"cxfrs://http://localhost:" + PORT_RS_PATH
+ +
"/rest?resourceClasses=org.apache.karaf.camel.test.beans.CustomerService&bindingStyle=SimpleConsumer";
+
+
+ @Override
+ public void createRoutes(RouteBuilder builder) {
+ builder.from(CXF_RS_ENDPOINT_URI)
+
.recipientList(builder.simple("direct:${header.operationName}"));
+
+ builder.from("direct:getCustomer").process(exchange -> {
+ assertEquals("123", exchange.getIn().getHeader("id"));
+ exchange.getMessage().setBody(new Customer(123, "Raul"));
+ exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, 200);
+ });
+
+ builder.from("direct:newCustomer").process(exchange -> {
+ Customer c = exchange.getIn().getBody(Customer.class);
+ assertNotNull(c);
+ assertEquals(123, c.getId());
+ assertEquals(12, exchange.getIn().getHeader("age"));
+ exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, 200);
+ });
+ }
+}
diff --git
a/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/CamelCxfWsRouteSupplier.java
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/CamelCxfWsRouteSupplier.java
new file mode 100644
index 00000000..f28c378f
--- /dev/null
+++
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/CamelCxfWsRouteSupplier.java
@@ -0,0 +1,91 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.karaf.camel.test;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jakarta.servlet.ServletRequest;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.cxf.common.DataFormat;
+import org.apache.camel.component.cxf.common.message.CxfConstants;
+import org.apache.cxf.endpoint.Client;
+import org.apache.karaf.camel.itests.CamelRouteSupplier;
+import org.osgi.service.component.annotations.Component;
+
+import static org.apache.camel.builder.Builder.header;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@Component(
+ name = "karaf-camel-cxf-ws-test",
+ immediate = true,
+ service = CamelRouteSupplier.class
+)
+public class CamelCxfWsRouteSupplier implements CamelRouteSupplier {
+ private static final String PORT_WS_PATH =
System.getProperty("cxf.ws.port") + "/CamelCxfWsRouteSupplier";
+ private static final String CXF_WS_ENDPOINT_URI =
"cxf://http://localhost:" + PORT_WS_PATH
+ +
"/test?serviceClass=org.apache.karaf.camel.test.jaxws.HelloService"
+ + "&publishedEndpointUrl=http://www.simple.com/services/test";
+
+ private static final String ECHO_OPERATION = "echo";
+ private static final String ECHO_BOOLEAN_OPERATION = "echoBoolean";
+
+ @Override
+ public void createRoutes(RouteBuilder builder) {
+
builder.from(CXF_WS_ENDPOINT_URI).choice().when(header(CxfConstants.OPERATION_NAME).isEqualTo(ECHO_OPERATION))
+ .process(exchange -> {
+ assertEquals(DataFormat.POJO,
+
exchange.getProperty(CxfConstants.DATA_FORMAT_PROPERTY, DataFormat.class));
+ Message in = exchange.getIn();
+ // check the remote IP from the cxfMessage
+ org.apache.cxf.message.Message cxfMessage
+ = in.getHeader(CxfConstants.CAMEL_CXF_MESSAGE,
org.apache.cxf.message.Message.class);
+ assertNotNull("Should get the cxfMessage instance from
message header", cxfMessage);
+ ServletRequest request = (ServletRequest)
cxfMessage.get("HTTP.REQUEST");
+ assertNotNull("Should get the ServletRequest", request);
+ assertNotNull("Should get the RemoteAddress",
request.getRemoteAddr());
+ // Could verify the HttpRequest
+ String contentType = in.getHeader(Exchange.CONTENT_TYPE,
String.class);
+ assertNotNull("Should get the contentType.", contentType);
+
+ // Get the parameter list
+ List<?> parameter = in.getBody(List.class);
+ // Get the operation name
+ String operation = (String)
in.getHeader(CxfConstants.OPERATION_NAME);
+ Object result = operation + " " + parameter.get(0);
+ // Put the result back
+ exchange.getMessage().setBody(result);
+ // set up the response context which force start document
+ Map<String, Object> map = new HashMap<>();
+ map.put("org.apache.cxf.stax.force-start-document",
Boolean.TRUE);
+ exchange.getMessage().setHeader(Client.RESPONSE_CONTEXT,
map);
+ })
+
.when(header(CxfConstants.OPERATION_NAME).isEqualTo(ECHO_BOOLEAN_OPERATION)).process(exchange
-> {
+ Message in = exchange.getIn();
+ // Get the parameter list
+ List<?> parameter = in.getBody(List.class);
+ // Put the result back
+ exchange.getMessage().setBody(parameter.get(0));
+ });
+ }
+}
diff --git
a/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/beans/Customer.java
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/beans/Customer.java
new file mode 100644
index 00000000..a57866b6
--- /dev/null
+++
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/beans/Customer.java
@@ -0,0 +1,65 @@
+/**
+ * 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.karaf.camel.test.beans;
+
+import java.util.Objects;
+
+import jakarta.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "Customer")
+public class Customer {
+ private long id;
+ private String name;
+
+ public Customer() {
+ }
+
+ public Customer(long id, String name) {
+ setId(id);
+ setName(name);
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ Customer customer = (Customer) o;
+ return id == customer.id && Objects.equals(name, customer.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name);
+ }
+}
diff --git
a/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/beans/CustomerService.java
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/beans/CustomerService.java
new file mode 100644
index 00000000..5caf0823
--- /dev/null
+++
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/beans/CustomerService.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.karaf.camel.test.beans;
+
+
+import java.io.InputStream;
+
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.Response;
+
+@Path("/customerservice/")
+public interface CustomerService {
+
+ @GET
+ @Path("/customers/{id}/")
+ Customer getCustomer(@PathParam("id") String id, @QueryParam("test")
String test);
+
+ @PUT
+ @Path("/customers/{id}")
+ Response updateCustomer(Customer customer, @PathParam("id") String id);
+
+ @POST
+ @Path("/customers/")
+ Response newCustomer(Customer customer, @QueryParam("age") int age);
+
+ @Consumes("image/jpeg")
+ @POST
+ @Path("/customers/{id}/image_inputstream")
+ Response uploadImageInputStream(InputStream is);
+
+}
diff --git
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyServerEngineParser.java
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/jaxws/HelloService.java
similarity index 63%
rename from
components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyServerEngineParser.java
rename to
tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/jaxws/HelloService.java
index a021b5a3..1a2c348b 100644
---
a/components/camel-cxf/camel-cxf-all/src/main/java/org/apache/camel/component/cxf/transport/http_jetty/blueprint/JettyServerEngineParser.java
+++
b/tests/features/camel-cxf/src/main/java/org/apache/karaf/camel/test/jaxws/HelloService.java
@@ -14,18 +14,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.apache.karaf.camel.test.jaxws;
-package org.apache.camel.component.cxf.transport.http_jetty.blueprint;
+import java.util.List;
-import org.w3c.dom.Element;
+public interface HelloService {
+ String sayHello();
-import org.apache.aries.blueprint.ParserContext;
-import
org.apache.camel.component.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
-import org.osgi.service.blueprint.reflect.Metadata;
+ void ping();
-public class JettyServerEngineParser extends AbstractBPBeanDefinitionParser {
+ int getInvocationCount();
+
+ String echo(String text) throws Exception;
+
+ Boolean echoBoolean(Boolean bool);
+
+ String complexParameters(List<String> par1, List<String> par2);
- public Metadata parse(Element element, ParserContext context) {
- return null;
- }
}
diff --git
a/tests/features/camel-cxf/src/test/java/org/apache/karaf/camel/itest/CamelCxfITest.java
b/tests/features/camel-cxf/src/test/java/org/apache/karaf/camel/itest/CamelCxfITest.java
new file mode 100644
index 00000000..27c8afb9
--- /dev/null
+++
b/tests/features/camel-cxf/src/test/java/org/apache/karaf/camel/itest/CamelCxfITest.java
@@ -0,0 +1,199 @@
+/*
+ * Licensed 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.karaf.camel.itest;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.util.ArrayList;
+import java.util.List;
+
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.JAXBException;
+
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.frontend.ClientFactoryBean;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureRouteITest;
+import org.apache.karaf.camel.itests.AvailablePortProvider;
+import org.apache.karaf.camel.itests.CamelKarafTestHint;
+import org.apache.karaf.camel.itests.PaxExamWithExternalResource;
+import org.apache.karaf.camel.test.beans.Customer;
+import org.apache.karaf.camel.test.jaxws.HelloService;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.OptionUtils.combine;
+
+@CamelKarafTestHint(externalResourceProvider =
CamelCxfITest.ExternalResourceProviders.class,
+ additionalRequiredFeatures = "camel-undertow")
+@RunWith(PaxExamWithExternalResource.class)
+@ExamReactorStrategy(PerClass.class)
+public class CamelCxfITest extends AbstractCamelSingleFeatureRouteITest {
+
+ private static final String ECHO_REQUEST = "<soap:Envelope
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ + "<soap:Body><ns1:echo
xmlns:ns1=\"http://jaxws.test.camel.karaf.apache.org/\">"
+ + "<arg0 xmlns=\"http://jaxws.test.camel.karaf.apache.org/\">Hello
World!</arg0></ns1:echo></soap:Body></soap:Envelope>";
+ private static final String TEST_MESSAGE = "Hello World!";
+
+ private JAXBContext jaxb;
+ private final HttpClient client = HttpClient.newHttpClient();
+
+ @Before
+ public void initCtx() throws JAXBException {
+ this.jaxb = JAXBContext.newInstance(Customer.class);
+ }
+
+ @Test
+ public void testCxfWs() throws Exception {
+ testInvokingServiceFromCXFClient();
+ testXmlDeclaration();
+ testPublishEndpointUrl();
+ }
+
+ @Test
+ public void testCxfRs() throws Exception {
+ testGetCustomerOnlyHeaders();
+ testNewCustomerWithQueryParam();
+ }
+
+ private String getPortPathRs() {
+ return ExternalResourceProviders.getCxfRsPort() +
"/CamelCxfRsRouteSupplier";
+ }
+
+ private String getWsEndpointAddress() {
+ return "http://localhost:" + ExternalResourceProviders.getCxfWsPort()
+ "/CamelCxfWsRouteSupplier/test";
+ }
+
+ @Override
+ protected List<String> installRequiredBundles() throws Exception {
+ List<String> bundles = new ArrayList<>();
+ // Using the wrap protocol to install the bundle with Import-Package=*
to avoid the issue with the bad
+ // jakarta.xml.bind and jakarta.servlet import version ranges
+
installBundle("wrap:mvn:org.apache.cxf/cxf-rt-transports-http-undertow/%s$overwrite=merge&Import-Package=*".formatted(System.getProperty("cxf-version")),
true);
+ String undertowTransport =
"org.apache.cxf.cxf-rt-transports-http-undertow";
+ assertBundleInstalledAndRunning(undertowTransport);
+ bundles.add(undertowTransport);
+ bundles.addAll(super.installRequiredBundles());
+ return bundles;
+ }
+
+ @Override
+ protected Option[] getAdditionalOptions() {
+ return combine(
+ super.getAdditionalOptions(),
CoreOptions.systemProperty("cxf-version").value(System.getProperty("cxf.version"))
+ );
+ }
+
+ private void testGetCustomerOnlyHeaders() throws Exception {
+ URI uri =
URI.create("http://localhost:%s/rest/customerservice/customers/123".formatted(getPortPathRs()));
+
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(uri)
+ .header("Accept", "text/xml")
+ .build();
+
+ HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
+ assertEquals(200, response.statusCode());
+ Customer entity = (Customer) jaxb.createUnmarshaller().unmarshal(new
StringReader(response.body()));
+ assertEquals(123, entity.getId());
+ }
+
+ private void testNewCustomerWithQueryParam() throws Exception {
+ URI uri =
URI.create("http://localhost:%s/rest/customerservice/customers?age=12".formatted(getPortPathRs()));
+ StringWriter sw = new StringWriter();
+ jaxb.createMarshaller().marshal(new Customer(123, "Raul"), sw);
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(uri)
+ .header("Content-Type", "text/xml")
+ .header("Accept", "text/xml")
+ .POST(HttpRequest.BodyPublishers.ofString(sw.toString()))
+ .build();
+
+ HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
+ assertEquals(200, response.statusCode());
+ }
+
+
+ private void testInvokingServiceFromCXFClient() throws Exception {
+ ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
+ ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
+ clientBean.setAddress(getWsEndpointAddress());
+ clientBean.setServiceClass(HelloService.class);
+ clientBean.setBus(BusFactory.newInstance().createBus());
+
+ HelloService helloService = (HelloService) proxyFactory.create();
+
+ String result = helloService.echo(TEST_MESSAGE);
+ assertEquals("We should get the echo string result from router",
result, "echo " + TEST_MESSAGE);
+
+ Boolean bool = helloService.echoBoolean(Boolean.TRUE);
+ assertNotNull("The result should not be null", bool);
+ assertEquals("We should get the echo boolean result from router",
"true", bool.toString());
+ }
+
+ private void testXmlDeclaration() throws Exception {
+ URI uri = URI.create(getWsEndpointAddress());
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(uri)
+ .header("Content-Type", "text/xml; charset=UTF-8")
+ .header("Accept", "text/xml")
+ .POST(HttpRequest.BodyPublishers.ofString(ECHO_REQUEST))
+ .build();
+ HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
+ assertEquals(200, response.statusCode());
+ String body = response.body();
+ assertTrue("Can't find the xml declaration.", body.startsWith("<?xml
version=\"1.0\" encoding="));
+ assertTrue("The response content is incorrect.", body.contains("echo
Hello World!"));
+ }
+
+ private void testPublishEndpointUrl() throws Exception {
+ URI uri = URI.create(getWsEndpointAddress()+ "?wsdl");
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(uri)
+ .header("Accept", "text/xml")
+ .build();
+ HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
+ assertEquals(200, response.statusCode());
+ assertTrue("Can't find the right service location.",
response.body().contains("http://www.simple.com/services/test"));
+ }
+
+ public static final class ExternalResourceProviders {
+ public static final String CXF_RS_PORT = "cxf.rs.port";
+ public static final String CXF_WS_PORT = "cxf.ws.port";
+
+ public static AvailablePortProvider createAvailablePortProvider() {
+ return new AvailablePortProvider(List.of(CXF_RS_PORT,
CXF_WS_PORT));
+ }
+
+ static String getCxfRsPort() {
+ return System.getProperty(CXF_RS_PORT);
+ }
+
+ static String getCxfWsPort() {
+ return System.getProperty(CXF_WS_PORT);
+ }
+ }
+}
\ No newline at end of file
diff --git
a/tests/features/camel-disruptor/src/main/java/org/apache/karaf/camel/test/CamelDisruptorRouteSupplier.java
b/tests/features/camel-disruptor/src/main/java/org/apache/karaf/camel/test/CamelDisruptorRouteSupplier.java
index a3c1c7a8..7c6f1952 100644
---
a/tests/features/camel-disruptor/src/main/java/org/apache/karaf/camel/test/CamelDisruptorRouteSupplier.java
+++
b/tests/features/camel-disruptor/src/main/java/org/apache/karaf/camel/test/CamelDisruptorRouteSupplier.java
@@ -22,12 +22,13 @@ import java.util.function.Function;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.RouteDefinition;
import
org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier;
+import org.apache.karaf.camel.itests.CamelRouteSupplier;
import org.osgi.service.component.annotations.Component;
@Component(
name = "karaf-camel-disruptor-test",
immediate = true,
- service = CamelDisruptorRouteSupplier.class
+ service = CamelRouteSupplier.class
)
public class CamelDisruptorRouteSupplier extends
AbstractCamelSingleFeatureResultMockBasedRouteSupplier {
diff --git
a/tests/features/camel-disruptor/src/main/java/org/apache/karaf/camel/test/CamelDisruptorvmRouteSupplier.java
b/tests/features/camel-disruptor/src/main/java/org/apache/karaf/camel/test/CamelDisruptorvmRouteSupplier.java
deleted file mode 100644
index 4edfc78b..00000000
---
a/tests/features/camel-disruptor/src/main/java/org/apache/karaf/camel/test/CamelDisruptorvmRouteSupplier.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.camel.test;
-
-import static org.apache.camel.builder.Builder.constant;
-
-import java.util.function.Function;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.model.RouteDefinition;
-import
org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier;
-import org.osgi.service.component.annotations.Component;
-
-@Component(
- name = "karaf-camel-disruptor-vm-test",
- immediate = true,
- service = CamelDisruptorvmRouteSupplier.class
-)
-public class CamelDisruptorvmRouteSupplier extends
AbstractCamelSingleFeatureResultMockBasedRouteSupplier {
-
- @Override
- protected Function<RouteBuilder, RouteDefinition> consumerRoute() {
- return builder -> builder.from("disruptor-vm:next")
- .log("Received from disruptor-vm next:
${body}")
- .setBody(constant("OK"));
- }
-
- @Override
- protected void configureProducer(RouteBuilder builder, RouteDefinition
producerRoute) {
- producerRoute.setBody(constant("Hello Disruptor VM"))
- .log("Will send to disruptor-vm next: ${body}")
- // send it to the disruptor-vm that is async
- .to("disruptor-vm:next")
- .log("Sent to disruptor-vm next: ${body}");
- }
-}
\ No newline at end of file
diff --git
a/tests/features/camel-disruptor/src/test/java/org/apache/karaf/camel/itest/CamelDisruptorTest.java
b/tests/features/camel-disruptor/src/test/java/org/apache/karaf/camel/itest/CamelDisruptorTest.java
index 18b7b02d..fe6297ad 100644
---
a/tests/features/camel-disruptor/src/test/java/org/apache/karaf/camel/itest/CamelDisruptorTest.java
+++
b/tests/features/camel-disruptor/src/test/java/org/apache/karaf/camel/itest/CamelDisruptorTest.java
@@ -15,18 +15,25 @@ package org.apache.karaf.camel.itest;
import java.util.List;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.karaf.camel.itests.AbstractCamelRouteWithBundleITest;
import
org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRoute;
import org.apache.karaf.camel.itests.CamelContextProvider;
+import org.apache.karaf.camel.itests.CamelKarafTestHint;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
+import static org.junit.Assert.assertNotNull;
+
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
+@CamelKarafTestHint(isBlueprintTest = true)
public class CamelDisruptorTest extends AbstractCamelRouteWithBundleITest {
@Override
@@ -45,8 +52,8 @@ public class CamelDisruptorTest extends
AbstractCamelRouteWithBundleITest {
}
@Test
- public void testCamelDisruptorvm() throws Exception {
- new CamelDisruptorvmITest(this).testRoutes();
+ public void testCamelDisruptorVm() throws Exception {
+ new CamelDisruptorVmITest(this).testRoutes();
}
public static class CamelDisruptorITest extends
AbstractCamelSingleFeatureResultMockBasedRoute {
@@ -59,11 +66,21 @@ public class CamelDisruptorTest extends
AbstractCamelRouteWithBundleITest {
public void configureMock(MockEndpoint mock) {
mock.expectedBodiesReceived("OK");
}
+
+ @Override
+ public CamelContext getContext() {
+ return getProvider().getDefaultContext();
+ }
+
+ @Override
+ public ProducerTemplate getTemplate() {
+ return getProvider().getDefaultTemplate();
+ }
}
- public static class CamelDisruptorvmITest extends
AbstractCamelSingleFeatureResultMockBasedRoute {
+ public static class CamelDisruptorVmITest extends
AbstractCamelSingleFeatureResultMockBasedRoute {
- public CamelDisruptorvmITest(CamelContextProvider provider) {
+ public CamelDisruptorVmITest(CamelContextProvider provider) {
super(provider);
}
@@ -71,5 +88,30 @@ public class CamelDisruptorTest extends
AbstractCamelRouteWithBundleITest {
public void configureMock(MockEndpoint mock) {
mock.expectedBodiesReceived("OK");
}
+
+ @Override
+ public MockEndpoint getMockEndpoint() {
+ return
getConsumerContext().getEndpoint("mock:camel-disruptor-vm-test",
MockEndpoint.class);
+ }
+
+ @Override
+ public CamelContext getContext() {
+ return getConsumerContext();
+ }
+
+ @Override
+ public void triggerProducerRoute() {
+ Endpoint directEndpoint =
getSupplierContext().hasEndpoint("direct:camel-disruptor-vm-test");
+ assertNotNull(directEndpoint);
+ getProvider().getTemplate("ctx1").send(directEndpoint,
getProcessorToCallOnSend());
+ }
+
+ private CamelContext getSupplierContext() {
+ return getProvider().getContext("ctx1");
+ }
+
+ private CamelContext getConsumerContext() {
+ return getProvider().getContext("ctx2");
+ }
}
}
\ No newline at end of file
diff --git
a/tests/features/camel-disruptor/src/test/resources/OSGI-INF/blueprint/route1.xml
b/tests/features/camel-disruptor/src/test/resources/OSGI-INF/blueprint/route1.xml
new file mode 100644
index 00000000..35427c85
--- /dev/null
+++
b/tests/features/camel-disruptor/src/test/resources/OSGI-INF/blueprint/route1.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="ctx1">
+ <route id="leg-1">
+ <from uri="direct:camel-disruptor-vm-test"/>
+ <log message="first leg"/>
+ <to uri="disruptor-vm:nextOne"/>
+ </route>
+ </camelContext>
+</blueprint>
\ No newline at end of file
diff --git
a/tests/features/camel-disruptor/src/test/resources/OSGI-INF/blueprint/route2.xml
b/tests/features/camel-disruptor/src/test/resources/OSGI-INF/blueprint/route2.xml
new file mode 100644
index 00000000..2f4f6adc
--- /dev/null
+++
b/tests/features/camel-disruptor/src/test/resources/OSGI-INF/blueprint/route2.xml
@@ -0,0 +1,31 @@
+<?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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="ctx2">
+ <route id="leg-2">
+ <from uri="disruptor-vm:nextOne"/>
+ <log message="second leg"/>
+ <setBody>
+ <constant>OK</constant>
+ </setBody>
+ <to uri="mock:camel-disruptor-vm-test"/>
+ </route>
+ </camelContext>
+</blueprint>
\ No newline at end of file
diff --git a/tests/features/pom.xml b/tests/features/pom.xml
index 1c7dfe1f..38c18a94 100644
--- a/tests/features/pom.xml
+++ b/tests/features/pom.xml
@@ -65,6 +65,7 @@
<module>camel-couchdb</module>
<module>camel-crypto</module>
<module>camel-csv</module>
+ <module>camel-cxf</module>
<module>camel-disruptor</module>
<module>camel-dns</module>
<!-- TODO: Fix the integration test and re-add it
https://github.com/apache/camel-karaf/issues/438 -->
@@ -238,7 +239,7 @@
<configuration>
<instructions>
<Export-Package>
-
org.apache.karaf.camel.test;version=${project.version}
+
org.apache.karaf.camel.test*;version=${project.version}
</Export-Package>
<Import-Package>
org.apache.camel*;${camel-osgi-import-camel-version},