Repository: camel Updated Branches: refs/heads/master 881e5099f -> b6c532d1c
Remove spring test from osgi blueprint example Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b6c532d1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b6c532d1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b6c532d1 Branch: refs/heads/master Commit: b6c532d1cda29fadea92eadeb410ffad0d3da3f7 Parents: 881e509 Author: Claus Ibsen <davscl...@apache.org> Authored: Thu Dec 15 11:46:51 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu Dec 15 11:59:40 2016 +0100 ---------------------------------------------------------------------- examples/camel-example-cxf-blueprint/README.md | 2 +- examples/camel-example-cxf-blueprint/pom.xml | 24 +----- .../ReportIncidentRoutesClientTest.java | 91 -------------------- .../src/test/resources/camel-context.xml | 46 ---------- .../src/test/resources/log4j2.properties | 23 ----- 5 files changed, 2 insertions(+), 184 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/b6c532d1/examples/camel-example-cxf-blueprint/README.md ---------------------------------------------------------------------- diff --git a/examples/camel-example-cxf-blueprint/README.md b/examples/camel-example-cxf-blueprint/README.md index cc25867..7331da1 100644 --- a/examples/camel-example-cxf-blueprint/README.md +++ b/examples/camel-example-cxf-blueprint/README.md @@ -18,7 +18,7 @@ You will need to compile this example first: ### Run -To run the example on Apache Karaf 3.x or newer +To run the example on Apache Karaf 4.x or newer #### Step 1: Laraf http://git-wip-us.apache.org/repos/asf/camel/blob/b6c532d1/examples/camel-example-cxf-blueprint/pom.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-cxf-blueprint/pom.xml b/examples/camel-example-cxf-blueprint/pom.xml index e21cb16..4cc2cc7 100644 --- a/examples/camel-example-cxf-blueprint/pom.xml +++ b/examples/camel-example-cxf-blueprint/pom.xml @@ -46,13 +46,7 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-cxf</artifactId> </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http-jetty</artifactId> - <version>${cxf-version}</version> - <scope>test</scope> - </dependency> - + <!-- logging --> <dependency> <groupId>org.apache.logging.log4j</groupId> @@ -70,22 +64,6 @@ <scope>runtime</scope> </dependency> - <!-- test --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test-spring</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jaxb</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> </dependencies> <build> http://git-wip-us.apache.org/repos/asf/camel/blob/b6c532d1/examples/camel-example-cxf-blueprint/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-cxf-blueprint/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java b/examples/camel-example-cxf-blueprint/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java deleted file mode 100755 index 82f8a7d..0000000 --- a/examples/camel-example-cxf-blueprint/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesClientTest.java +++ /dev/null @@ -1,91 +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.camel.example.reportincident; - -import java.io.File; -import java.io.FileOutputStream; - -import org.apache.camel.test.AvailablePortFinder; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; -import org.junit.BeforeClass; -import org.junit.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * Unit test of our routes - */ -public class ReportIncidentRoutesClientTest extends CamelSpringTestSupport { - - // should be the same address as we have in our route - private static final String URL = "http://localhost:{{port}}/cxf/camel-example-cxf-blueprint/webservices/incident"; - - @BeforeClass - public static void setupFreePort() throws Exception { - // find a free port number, and write that in the custom.properties file - // which we will use for the unit tests, to avoid port number in use problems - int port = AvailablePortFinder.getNextAvailable(); - String s = "port=" + port; - File custom = new File("target/custom.properties"); - FileOutputStream fos = new FileOutputStream(custom); - fos.write(s.getBytes()); - fos.close(); - } - - protected static ReportIncidentEndpoint createCXFClient(String url) { - // we use CXF to create a client for us as its easier than JAXWS and works - JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); - factory.setServiceClass(ReportIncidentEndpoint.class); - factory.setAddress(url); - return (ReportIncidentEndpoint) factory.create(); - } - - @Test - public void testReportIncident() throws Exception { - // create input parameter - InputReportIncident input = new InputReportIncident(); - input.setIncidentId("123"); - input.setIncidentDate("2008-08-18"); - input.setGivenName("Claus"); - input.setFamilyName("Ibsen"); - input.setSummary("Bla"); - input.setDetails("Bla bla"); - input.setEmail("davscl...@apache.org"); - input.setPhone("0045 2962 7576"); - - // create the webservice client and send the request - String url = context.resolvePropertyPlaceholders(URL); - ReportIncidentEndpoint client = createCXFClient(url); - OutputReportIncident out = client.reportIncident(input); - - // assert we got a OK back - assertEquals("OK", out.getCode()); - - // test the input with other users - input.setGivenName("Guest"); - out = client.reportIncident(input); - - // assert we got a Accept back - assertEquals("Accepted", out.getCode()); - } - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext(new String[] {"camel-context.xml"}); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/b6c532d1/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml b/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml deleted file mode 100644 index 023301f..0000000 --- a/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xmlns:cxf="http://camel.apache.org/schema/cxf" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd - http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd"> - - <cxf:cxfEndpoint id="reportIncident" - address="http://localhost:{{port}}/cxf/camel-example-cxf-blueprint/webservices/incident" - wsdlURL="META-INF/wsdl/report_incident.wsdl" - endpointName="s:ReportIncidentEndpoint" - serviceName="s:ReportIncidentEndpointService" - serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint" - xmlns:s="http://reportincident.example.camel.apache.org"> - </cxf:cxfEndpoint> - - <bean id="reportIncidentRoutes" class="org.apache.camel.example.reportincident.ReportIncidentRoutes" /> - - <camel:camelContext id="camel"> - - <!-- property which contains port number --> - <camel:propertyPlaceholder id="properties" location="file:target/custom.properties"/> - - <camel:routeBuilder ref="reportIncidentRoutes"/> - </camel:camelContext> -</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/b6c532d1/examples/camel-example-cxf-blueprint/src/test/resources/log4j2.properties ---------------------------------------------------------------------- diff --git a/examples/camel-example-cxf-blueprint/src/test/resources/log4j2.properties b/examples/camel-example-cxf-blueprint/src/test/resources/log4j2.properties deleted file mode 100644 index 699897b..0000000 --- a/examples/camel-example-cxf-blueprint/src/test/resources/log4j2.properties +++ /dev/null @@ -1,23 +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. -## --------------------------------------------------------------------------- - -appender.out.type = Console -appender.out.name = out -appender.out.layout.type = PatternLayout -appender.out.layout.pattern = [%10.10t] %-30.30c{1} %-5p %m%n -rootLogger.level = INFO -rootLogger.appenderRef.out.ref = out