Skip to content

Commit

Permalink
Support for camel 3.x apache#11
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Feb 25, 2019
1 parent 6636847 commit d3fc05a
Show file tree
Hide file tree
Showing 56 changed files with 1,473 additions and 186 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
#
language: java

script: ./mvnw test
script:
- ./mvnw test -Dcamel2
- ./mvnw test -Dcamel3
10 changes: 8 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ pipeline {

stages {

stage('Test & Install') {
stage('Test Vs Camel 2.x & Install') {
steps {
sh "./mvnw $MAVEN_PARAMS clean install -f pom.xml"
sh "./mvnw $MAVEN_PARAMS clean install -Dcamel2 -f pom.xml"
}
}

stage('Test Vs Camel 3.x & Install') {
steps {
sh "./mvnw $MAVEN_PARAMS clean install -Dcamel3 -f pom.xml"
}
}

Expand Down
71 changes: 71 additions & 0 deletions camel-k-adapter-camel-2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?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">
<parent>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-runtime-parent</artifactId>
<version>0.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>camel-k-adapter-camel-2</artifactId>

<dependencies>

<!-- ****************************** -->
<!-- -->
<!-- RUNTIME -->
<!-- -->
<!-- ****************************** -->

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel2.version}</version>
<scope>provided</scope>
</dependency>

<!-- ****************************** -->
<!-- -->
<!-- TESTS -->
<!-- -->
<!-- ****************************** -->

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* 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.k.adapter;

import org.apache.camel.Endpoint;

public abstract class DefaultAsyncProducer extends org.apache.camel.impl.DefaultAsyncProducer {
public DefaultAsyncProducer(Endpoint endpoint) {
super(endpoint);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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.k.adapter;

import org.apache.camel.CamelContext;

public abstract class DefaultComponent extends org.apache.camel.impl.DefaultComponent {
public DefaultComponent() {
}

public DefaultComponent(CamelContext context) {
super(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.k.adapter;

import org.apache.camel.Component;

public abstract class DefaultEndpoint extends org.apache.camel.impl.DefaultEndpoint {
public DefaultEndpoint() {
}
public DefaultEndpoint(String endpointUri, Component component) {
super(endpointUri, component);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* 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.k.adapter;

import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.impl.DefaultExchange;

public final class Exchanges {
protected Exchanges() {
}

public final static Exchange newDefaultExchange(CamelContext context) {
return new DefaultExchange(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* 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.k.adapter;

import java.util.Map;

import org.apache.camel.TypeConverter;
import org.apache.camel.util.IntrospectionSupport;

public final class Introspection {
private Introspection() {
}

public static boolean setProperties(TypeConverter typeConverter, Object target, Map<String, Object> properties) throws Exception {
return IntrospectionSupport.setProperties(typeConverter, target, properties);
}

public static boolean setProperty(Object target, String name, Object value) throws Exception {
return IntrospectionSupport.setProperty(target, name, value, false);
}

public static boolean setProperty(Object target, String name, Object value, boolean builderPattern) throws Exception {
return IntrospectionSupport.setProperty(target, name, value, builderPattern);
}

public static boolean getProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean includeNull) {
return IntrospectionSupport.getProperties(target, properties, optionPrefix, includeNull);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* 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.k.adapter;

import org.apache.camel.AsyncProcessor;
import org.apache.camel.Processor;
import org.apache.camel.util.AsyncProcessorConverterHelper;

public final class Processors {
private Processors() {
}

public static AsyncProcessor convertToAsync(Processor processor) {
return AsyncProcessorConverterHelper.convert(processor);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* 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.k.adapter;

import java.io.IOException;
import java.io.InputStream;

import org.apache.camel.CamelContext;
import org.apache.camel.util.ResourceHelper;

public final class Resources {
private Resources() {
}

public static InputStream resolveResourceAsInputStream(CamelContext camelContext, String uri) throws IOException {
return ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, uri);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* 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.k.adapter;

import java.util.Arrays;

import org.apache.camel.util.ServiceHelper;

public final class Services {
private Services() {

}

public static void start(Object... services) throws Exception {
ServiceHelper.startServices(services);
}

public static void stop(Object... services) throws Exception {
ServiceHelper.stopServices(services);
}

public static void suspend(Object... services) throws Exception {
ServiceHelper.suspendServices(Arrays.asList(services));
}

public static void resume(Object... services) throws Exception {
ServiceHelper.resumeService(Arrays.asList(services));
}

public static void shutdown(Object... services) throws Exception {
ServiceHelper.stopAndShutdownServices(Arrays.asList(services));
}
}
Loading

0 comments on commit d3fc05a

Please sign in to comment.