Updated Branches: refs/heads/master 9e383f401 -> d7bc16467
CAMEL-7147 Added unit tests to verify the bus injection Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d7bc1646 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d7bc1646 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d7bc1646 Branch: refs/heads/master Commit: d7bc16467bf235ff40e0e9a5aa834231eda0e9c7 Parents: 9e383f4 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Mon Feb 10 17:33:59 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Mon Feb 10 17:33:59 2014 +0800 ---------------------------------------------------------------------- .../component/cxf/jaxrs/CxfRsSpringRouter.xml | 14 +- .../component/cxf/jaxrs/testbean/Customer.java | 79 ++++++++++ .../cxf/jaxrs/testbean/CustomerService.java | 154 +++++++++++++++++++ .../jaxrs/testbean/CustomerServiceResource.java | 38 +++++ .../component/cxf/jaxrs/testbean/Order.java | 71 +++++++++ .../component/cxf/jaxrs/testbean/Product.java | 45 ++++++ .../cxf/blueprint/CxfEndpointBeansTest.java | 11 ++ .../cxf/blueprint/CxfRsEndpointBeansTest.java | 51 ++++++ .../test/cxf/blueprint/CxfRsEndpointBeans.xml | 49 ++++++ 9 files changed, 509 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml index 632ca29..154b572 100644 --- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml +++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml @@ -38,19 +38,27 @@ </jaxrs:serviceBeans> </jaxrs:server> - <!-- bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/--> + <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider"/> <bean id="customerService" class="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" /> <!-- Defined the server endpoint to create the cxf-rs consumer --> <cxf:rsServer id="rsServer" address="http://localhost:${CXFTestSupport.port1}/CxfRsRouterTest/route" serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" - loggingFeatureEnabled="true" loggingSizeLimit="20" skipFaultLogging="true"/> + loggingFeatureEnabled="true" loggingSizeLimit="20" skipFaultLogging="true"> + <cxf:providers> + <ref bean="jsonProvider"/> + </cxf:providers> + </cxf:rsServer> <!-- Defined the client endpoint to create the cxf-rs consumer --> <cxf:rsClient id="rsClient" address="http://localhost:${CXFTestSupport.port2}/CxfRsRouterTest/rest" serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" - loggingFeatureEnabled="true" skipFaultLogging="true"/> + loggingFeatureEnabled="true" skipFaultLogging="true"> + <cxf:providers> + <ref bean="jsonProvider"/> + </cxf:providers> + </cxf:rsClient> <!-- The camel route context --> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java new file mode 100644 index 0000000..30f6450 --- /dev/null +++ b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java @@ -0,0 +1,79 @@ +/** + * 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.camel.component.cxf.jaxrs.testbean; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.apache.camel.util.ObjectHelper; + +/** + * + * @version + */ +@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 int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (int) (id ^ (id >>> 32)); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Customer)) { + return false; + } + + if (this == obj) { + return true; + } + + Customer other = (Customer) obj; + return id == other.id && ObjectHelper.equal(name, other.name); + } + +} http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerService.java ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerService.java b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerService.java new file mode 100644 index 0000000..39ec9df --- /dev/null +++ b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerService.java @@ -0,0 +1,154 @@ +/** + * 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.camel.component.cxf.jaxrs.testbean; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicLong; + +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Response; + + + +/** + * + * @version + */ +@Path("/customerservice/") +public class CustomerService { + private final AtomicLong currentId = new AtomicLong(123L); + private final Map<Long, Customer> customers = new ConcurrentHashMap<Long, Customer>(); + private final Map<Long, Order> orders = new ConcurrentHashMap<Long, Order>(); + + public CustomerService() { + init(); + } + + @GET + @Path("/customers/{id}/") + public Customer getCustomer(@PathParam("id") String id) { + long idNumber = Long.parseLong(id); + Customer c = customers.get(idNumber); + return c; + } + + @GET + @Path("/customers") + public Customer getCustomerByQueryParam(@QueryParam("id") String id) { + long idNumber = Long.parseLong(id); + Customer c = customers.get(idNumber); + return c; + } + + @GET + @Path("/customers/") + @Produces("application/xml") + public List<Customer> getCustomers() { + List<Customer> list = new ArrayList<Customer>(customers.values()); + return list; + } + + + @PUT + @Path("/customers/") + public Response updateCustomer(Customer customer) { + Customer c = customers.get(customer.getId()); + Response r; + if (c != null) { + customers.put(customer.getId(), customer); + r = Response.ok().build(); + } else { + r = Response.status(406).entity("Cannot find the customer!").build(); + } + + return r; + } + + @POST + @Path("/customers/") + public Response addCustomer(Customer customer) { + customer.setId(currentId.incrementAndGet()); + + customers.put(customer.getId(), customer); + + return Response.ok(customer).build(); + } + + @POST + @Path("/customersUniqueResponseCode/") + public Response addCustomerUniqueResponseCode(Customer customer) { + customer.setId(currentId.incrementAndGet()); + + customers.put(customer.getId(), customer); + + return Response.status(201).entity(customer).build(); + } + + @DELETE + @Path("/customers/{id}/") + public Response deleteCustomer(@PathParam("id") String id) { + long idNumber = Long.parseLong(id); + Customer c = customers.get(idNumber); + + Response r; + if (c != null) { + r = Response.ok().build(); + customers.remove(idNumber); + } else { + r = Response.notModified().build(); + } + if (idNumber == currentId.get()) { + currentId.decrementAndGet(); + } + return r; + } + + @Path("/orders/{orderId}/") + public Order getOrder(@PathParam("orderId") String orderId) { + long idNumber = Long.parseLong(orderId); + Order c = orders.get(idNumber); + return c; + } + + final void init() { + Customer c = new Customer(); + c.setName("John"); + c.setId(123); + customers.put(c.getId(), c); + + c = new Customer(); + c.setName("Dan"); + c.setId(113); + customers.put(c.getId(), c); + + Order o = new Order(); + o.setDescription("order 223"); + o.setId(223); + orders.put(o.getId(), o); + } + +} http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java new file mode 100644 index 0000000..c2e216f --- /dev/null +++ b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java @@ -0,0 +1,38 @@ +/** + * 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.camel.component.cxf.jaxrs.testbean; + +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.core.Response; + + +// START SNIPPET: example +@Path("/customerservice/") +public interface CustomerServiceResource { + + @GET + @Path("/customers/{id}/") + Customer getCustomer(@PathParam("id") String id); + + @PUT + @Path("/customers/") + Response updateCustomer(Customer customer); +} +// END SNIPPET: example http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Order.java ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Order.java b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Order.java new file mode 100644 index 0000000..2e2728c --- /dev/null +++ b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Order.java @@ -0,0 +1,71 @@ +/** + * 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.camel.component.cxf.jaxrs.testbean; + +import java.util.HashMap; +import java.util.Map; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @version + */ +@XmlRootElement(name = "Order") +public class Order { + private long id; + private String description; + private Map<Long, Product> products = new HashMap<Long, Product>(); + + public Order() { + init(); + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getDescription() { + return description; + } + + public void setDescription(String d) { + this.description = d; + } + + @GET + @Path("products/{productId}/") + public Product getProduct(@PathParam("productId")int productId) { + Product p = products.get(new Long(productId)); + return p; + } + + final void init() { + Product p = new Product(); + p.setId(323); + p.setDescription("product 323"); + products.put(p.getId(), p); + } + +} http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Product.java ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Product.java b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Product.java new file mode 100644 index 0000000..aceeff8 --- /dev/null +++ b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Product.java @@ -0,0 +1,45 @@ +/** + * 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.camel.component.cxf.jaxrs.testbean; + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @version + */ +@XmlRootElement(name = "Product") +public class Product { + private long id; + private String description; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getDescription() { + return description; + } + + public void setDescription(String d) { + this.description = d; + } +} http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfEndpointBeansTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfEndpointBeansTest.java b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfEndpointBeansTest.java index 3382a79..b7972e9 100644 --- a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfEndpointBeansTest.java +++ b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfEndpointBeansTest.java @@ -28,8 +28,11 @@ import org.apache.camel.ProducerTemplate; import org.apache.camel.component.cxf.CXFTestSupport; import org.apache.camel.component.cxf.CxfEndpoint; import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint; import org.apache.camel.test.blueprint.CamelBlueprintTestSupport; import org.apache.camel.util.URISupport; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean; import org.apache.cxf.transport.http.HTTPException; import org.junit.Test; @@ -56,6 +59,14 @@ public class CxfEndpointBeansTest extends CamelBlueprintTestSupport { } @Test + public void testCxfBusInjection() { + CxfEndpoint serviceEndpoint = context.getEndpoint("cxf:bean:serviceEndpoint", CxfEndpoint.class); + CxfEndpoint routerEndpoint = context.getEndpoint("cxf:bean:routerEndpoint", CxfEndpoint.class); + assertEquals("These endpoints don't share the same bus", serviceEndpoint.getBus().getId(), routerEndpoint.getBus().getId()); + } + + + @Test public void testCxfEndpointBeanDefinitionParser() { CxfEndpoint routerEndpoint = context.getEndpoint("routerEndpoint", CxfEndpoint.class); assertEquals("Got the wrong endpoint address", routerEndpoint.getAddress(), http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeansTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeansTest.java b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeansTest.java new file mode 100644 index 0000000..7792dbc --- /dev/null +++ b/tests/camel-blueprint-cxf-test/src/test/java/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeansTest.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 + * + * 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.camel.test.cxf.blueprint; + +import java.util.Properties; +import org.apache.camel.component.cxf.CXFTestSupport; +import org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint; +import org.apache.camel.test.blueprint.CamelBlueprintTestSupport; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean; +import org.junit.Test; + +public class CxfRsEndpointBeansTest extends CamelBlueprintTestSupport { + + @Override + protected String getBlueprintDescriptor() { + return "org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeans.xml"; + } + + @Override + protected String getBundleDirectives() { + return "blueprint.aries.xml-validation:=false"; + } + + @Test + public void testCxfBusInjection() { + + CxfRsEndpoint serviceEndpoint = context.getEndpoint("cxfrs:bean:serviceEndpoint", CxfRsEndpoint.class); + CxfRsEndpoint routerEndpoint = context.getEndpoint("cxfrs:bean:routerEndpoint", CxfRsEndpoint.class); + JAXRSServerFactoryBean server = routerEndpoint.createJAXRSServerFactoryBean(); + JAXRSClientFactoryBean client = serviceEndpoint.createJAXRSClientFactoryBean(); + assertEquals("These cxfrs endpoints don't share the same bus", server.getBus().getId(), client.getBus().getId()); + } + + + +} http://git-wip-us.apache.org/repos/asf/camel/blob/d7bc1646/tests/camel-blueprint-cxf-test/src/test/resources/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeans.xml ---------------------------------------------------------------------- diff --git a/tests/camel-blueprint-cxf-test/src/test/resources/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeans.xml b/tests/camel-blueprint-cxf-test/src/test/resources/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeans.xml new file mode 100644 index 0000000..ff2b70d --- /dev/null +++ b/tests/camel-blueprint-cxf-test/src/test/resources/org/apache/camel/test/cxf/blueprint/CxfRsEndpointBeans.xml @@ -0,0 +1,49 @@ +<?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" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:camel="http://camel.apache.org/schema/blueprint" + xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf" + xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0" + xsi:schemaLocation=" + http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd + http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd + http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd + http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> + + <cxf:rsServer id="routerEndpoint" address="http://localhost:8182" + serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" + loggingFeatureEnabled="true"/> + + <cxf:rsClient id="serviceEndpoint" address="http://localhost:8080" + serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" + loggingFeatureEnabled="true" /> + + + <!--bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider" /--> + + <camel:camelContext id="camel"> + + <camel:route> + <camel:from uri="direct:start" /> + <camel:to uri="mock:result" /> + </camel:route> + + </camel:camelContext> + +</blueprint>