You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/06/22 17:05:53 UTC
[1/4] camel git commit: CAMEL-11404: Upgrade Hibernate and JPA spec
Repository: camel
Updated Branches:
refs/heads/master 8caf2a416 -> 5a7a671c0
CAMEL-11404: Upgrade Hibernate and JPA spec
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7762e671
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7762e671
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7762e671
Branch: refs/heads/master
Commit: 7762e671c32fec956654b5b1856106053e268741
Parents: 8caf2a4
Author: James Netherton <ja...@gmail.com>
Authored: Tue Jun 20 13:57:55 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 22 19:05:43 2017 +0200
----------------------------------------------------------------------
components/camel-bam/pom.xml | 2 +-
components/camel-jpa/pom.xml | 8 +++++++-
examples/camel-example-spring-boot-rest-jpa/pom.xml | 1 -
.../camel-example-tracer/src/main/resources/features.xml | 8 ++++----
parent/pom.xml | 9 ++++-----
platforms/karaf/features/src/main/resources/features.xml | 4 ++--
.../components-starter/camel-bam-starter/pom.xml | 4 ----
.../components-starter/camel-jpa-starter/pom.xml | 2 +-
.../spring-boot-dm/camel-spring-boot-dependencies/pom.xml | 4 ++--
.../org/apache/camel/itest/springboot/CamelJpaTest.java | 2 ++
.../main/resources/spring-boot-fix-dependencies.properties | 7 ++-----
11 files changed, 25 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/components/camel-bam/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-bam/pom.xml b/components/camel-bam/pom.xml
index c5a48ab..a03d8dc 100644
--- a/components/camel-bam/pom.xml
+++ b/components/camel-bam/pom.xml
@@ -60,7 +60,7 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ <artifactId>geronimo-jpa_2.1_spec</artifactId>
</dependency>
<!-- testing -->
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/components/camel-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-jpa/pom.xml b/components/camel-jpa/pom.xml
index a6baef4..09748e8 100644
--- a/components/camel-jpa/pom.xml
+++ b/components/camel-jpa/pom.xml
@@ -66,7 +66,7 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ <artifactId>geronimo-jpa_2.1_spec</artifactId>
<scope>provided</scope>
</dependency>
@@ -85,6 +85,12 @@
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-persistence-jdbc</artifactId>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/examples/camel-example-spring-boot-rest-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot-rest-jpa/pom.xml b/examples/camel-example-spring-boot-rest-jpa/pom.xml
index c8e692c..8a6a895 100644
--- a/examples/camel-example-spring-boot-rest-jpa/pom.xml
+++ b/examples/camel-example-spring-boot-rest-jpa/pom.xml
@@ -61,7 +61,6 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <version>5.0.9.Final</version>
</dependency>
</dependencies>
</dependencyManagement>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/examples/camel-example-tracer/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-tracer/src/main/resources/features.xml b/examples/camel-example-tracer/src/main/resources/features.xml
index e196da7..1326050 100644
--- a/examples/camel-example-tracer/src/main/resources/features.xml
+++ b/examples/camel-example-tracer/src/main/resources/features.xml
@@ -19,9 +19,9 @@
-->
<features>
<repository>mvn:org.apache.camel.karaf/apache-camel/${project.version}/xml/features</repository>
-
+
<feature name="jpa-hibernate" version="${project.version}">
- <bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo-jpa2-spec-version}</bundle>
+ <bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.1_spec/${geronimo-jpa-spec-version}</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.2.2_5</bundle>
<bundle>mvn:org.springframework/spring-jdbc/${spring-version}</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_2</bundle>
@@ -35,8 +35,8 @@
<bundle>mvn:org.hibernate/com.springsource.org.hibernate/3.3.2.GA</bundle>
<bundle>mvn:org.springframework/spring-orm/${spring-version}</bundle>
</feature>
-
-
+
+
<feature name="camel-example-tracer" version="${project.version}">
<feature version="${project.version}">camel</feature>
<feature version="${project.version}">camel-jpa</feature>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 42077c1..e965d95 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -241,7 +241,7 @@
<geronimo-jcdi-1.1-spec-version>1.0</geronimo-jcdi-1.1-spec-version>
<geronimo-jms-spec-version>1.1.1</geronimo-jms-spec-version>
<geronimo-jms2-spec-version>1.0-alpha-2</geronimo-jms2-spec-version>
- <geronimo-jpa2-spec-version>1.1</geronimo-jpa2-spec-version>
+ <geronimo-jpa-spec-version>1.0-alpha-1</geronimo-jpa-spec-version>
<geronimo-jsp-spec-version>1.1</geronimo-jsp-spec-version>
<geronimo-json-spec-version>1.0</geronimo-json-spec-version>
<geronimo-jta-spec-version>1.1.1</geronimo-jta-spec-version>
@@ -277,8 +277,7 @@
<hbase-version>1.2.1</hbase-version>
<hessian-version>4.0.38</hessian-version>
<hibernate-validator-version>5.4.1.Final</hibernate-validator-version>
- <!-- Spring 3.2.x and 4.0.x still stick to JPA 2.0. Hibernate 4.3.x upgraded to JPA 2.1. -->
- <hibernate-version>4.2.20.Final</hibernate-version>
+ <hibernate-version>5.0.12.Final</hibernate-version>
<hikaricp-version>2.3.13</hikaricp-version>
<hk2-version>2.3.0</hk2-version>
<hk2-osgi-resource-version>1.0.1</hk2-osgi-resource-version>
@@ -3900,8 +3899,8 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
- <version>${geronimo-jpa2-spec-version}</version>
+ <artifactId>geronimo-jpa_2.1_spec</artifactId>
+ <version>${geronimo-jpa-spec-version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/platforms/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml
index 810d3ab..5f82446 100644
--- a/platforms/karaf/features/src/main/resources/features.xml
+++ b/platforms/karaf/features/src/main/resources/features.xml
@@ -203,7 +203,7 @@
<bundle dependency='true'>mvn:commons-dbcp/commons-dbcp/${commons-dbcp-version}</bundle>
<bundle dependency='true'>mvn:commons-lang/commons-lang/${commons-lang-version}</bundle>
<bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo-jms-spec-version}</bundle>
- <bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo-jpa2-spec-version}</bundle>
+ <bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-jpa_2.1_spec/${geronimo-jpa-spec-version}</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.cglib/${cglib-bundle-version}</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.oscache/${oscache-bundle-version}</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ibatis-sqlmap/${ibatis-bundle-version}</bundle>
@@ -1154,7 +1154,7 @@
<feature version='${spring-version-range}'>spring-orm</feature>
<feature version='${spring-version-range}'>spring-tx</feature>
<bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/${geronimo-annotation-1.0-spec-version}</bundle>
- <bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo-jpa2-spec-version}</bundle>
+ <bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-jpa_2.1_spec/${geronimo-jpa-spec-version}</bundle>
<bundle dependency='true'>mvn:javax.servlet/javax.servlet-api/${javax.servlet-api-version}</bundle>
<bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/${geronimo-el-spec-version}</bundle>
<bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${geronimo-jta-spec-version}</bundle>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/platforms/spring-boot/components-starter/camel-bam-starter/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-bam-starter/pom.xml b/platforms/spring-boot/components-starter/camel-bam-starter/pom.xml
index c78fe92..230855a 100644
--- a/platforms/spring-boot/components-starter/camel-bam-starter/pom.xml
+++ b/platforms/spring-boot/components-starter/camel-bam-starter/pom.xml
@@ -44,10 +44,6 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
- </exclusion>
</exclusions>
<!--END OF GENERATED CODE-->
</dependency>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/platforms/spring-boot/components-starter/camel-jpa-starter/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-jpa-starter/pom.xml b/platforms/spring-boot/components-starter/camel-jpa-starter/pom.xml
index 78cf5ad..b2cc3b9 100644
--- a/platforms/spring-boot/components-starter/camel-jpa-starter/pom.xml
+++ b/platforms/spring-boot/components-starter/camel-jpa-starter/pom.xml
@@ -58,7 +58,7 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ <artifactId>geronimo-jpa_2.1_spec</artifactId>
</dependency>
<!--END OF GENERATED CODE-->
</dependencies>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
index 04e3a39..580275f 100644
--- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
+++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
@@ -3001,8 +3001,8 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
- <version>1.1</version>
+ <artifactId>geronimo-jpa_2.1_spec</artifactId>
+ <version>1.0-alpha-1</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
index 3104041..467c47a 100644
--- a/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
+++ b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
@@ -35,6 +35,8 @@ public class CamelJpaTest extends AbstractSpringBootTestSupport {
public static ITestConfig createTestConfig() {
return new ITestConfigBuilder()
.module(inferModuleName(CamelJpaTest.class))
+ // Exclude tests which require build time enhancement of @Entity annotated classes
+ .unitTestExclusionPattern(".*(.*Idempotent.*Test$|JpaUsePersistTest$|JpaTraceEventMessageTest$)")
.build();
}
http://git-wip-us.apache.org/repos/asf/camel/blob/7762e671/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-fix-dependencies.properties
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-fix-dependencies.properties b/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-fix-dependencies.properties
index 718c2fb..4689625 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-fix-dependencies.properties
+++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/spring-boot-fix-dependencies.properties
@@ -15,7 +15,7 @@
## limitations under the License.
## ---------------------------------------------------------------------------
# This file contains additional dependencies needed by camel modules in a spring-boot deployment
-# Use comma-separated values to include ultiple dependencies
+# Use comma-separated values to include multiple dependencies
# Global dependencies included in all modules (except the ones in the list)
@@ -46,7 +46,7 @@ camel-jbpm=org.apache.geronimo.specs:geronimo-jms_1.1_spec
camel-jcr=org.apache.lucene:lucene-core:${lucene3-version}
camel-jira=com.atlassian.jira:jira-rest-java-client
camel-jms=org.apache.geronimo.specs:geronimo-jms_1.1_spec
-camel-jpa=org.apache.geronimo.specs:geronimo-jpa_2.0_spec
+camel-jpa=org.apache.geronimo.specs:geronimo-jpa_2.1_spec
camel-kubernetes=org.hibernate:hibernate-validator
camel-scala=org.scala-lang:scala-library:${scala-version},org.scala-lang.modules:scala-xml_2.11:${scalaxml-version}
@@ -64,8 +64,5 @@ camel-servletlistener=javax.servlet:javax.servlet-api
camel-swagger-java=org.hibernate:hibernate-validator
-# Needs JPA 2.1
-exclude_camel-bam=org.apache.geronimo.specs:geronimo-jpa_2.0_spec
-
# Existed for Netty 3
exclude_camel-hbase=io.netty:netty
[3/4] camel git commit: Fix example testing
Posted by da...@apache.org.
Fix example testing
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5a7a671c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5a7a671c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5a7a671c
Branch: refs/heads/master
Commit: 5a7a671c05065ce450d683e057749d4ca5665a96
Parents: 6062e8d
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jun 22 18:51:15 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 22 19:05:44 2017 +0200
----------------------------------------------------------------------
examples/camel-example-cdi-xml/pom.xml | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5a7a671c/examples/camel-example-cdi-xml/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-xml/pom.xml b/examples/camel-example-cdi-xml/pom.xml
index 26c25b0..19664a3 100755
--- a/examples/camel-example-cdi-xml/pom.xml
+++ b/examples/camel-example-cdi-xml/pom.xml
@@ -113,6 +113,13 @@
</dependency>
</dependencies>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!-- need older version of surefire to make test work -->
+ <version>2.19.1</version>
+ </plugin>
</plugins>
</build>
@@ -125,7 +132,10 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <!-- need older version of surefire to make test work -->
+ <version>2.19.1</version>
<configuration>
<argLine>--add-modules java.xml.bind --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
</configuration>
[2/4] camel git commit: CAMEL-11404: Add Hibernate test profile to
camel-jpa
Posted by da...@apache.org.
CAMEL-11404: Add Hibernate test profile to camel-jpa
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/22ffa47b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/22ffa47b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/22ffa47b
Branch: refs/heads/master
Commit: 22ffa47b3bec9ea7256d11f59a69d0dea71f9a3f
Parents: 7762e67
Author: James Netherton <ja...@gmail.com>
Authored: Tue Jun 20 14:05:20 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 22 19:05:44 2017 +0200
----------------------------------------------------------------------
components/camel-jpa/pom.xml | 187 +++++++++++--------
.../component/jpa/AbstractJpaMethodTest.java | 12 +-
.../camel/component/jpa/JpaUsePersistTest.java | 55 +++---
.../component/jpa/JpaWithNamedQueryTest.java | 7 +-
.../java/org/apache/camel/examples/Order.java | 64 +++++++
.../jpa/JpaRouteSharedEntityManagerTest.java | 11 +-
.../src/test/resources/META-INF/persistence.xml | 7 +-
.../jpa/springJpaRouteSkipLockedTest.xml | 3 -
.../profiles/hibernate/META-INF/persistence.xml | 96 ++++++++++
.../camel/itest/springboot/CamelJpaTest.java | 4 +
10 files changed, 335 insertions(+), 111 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-jpa/pom.xml b/components/camel-jpa/pom.xml
index 09748e8..6a08296 100644
--- a/components/camel-jpa/pom.xml
+++ b/components/camel-jpa/pom.xml
@@ -82,17 +82,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-persistence-jdbc</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>test</scope>
@@ -101,7 +90,7 @@
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
@@ -124,69 +113,121 @@
</dependency>
</dependencies>
- <build>
- <pluginManagement>
- <plugins>
- <!-- Eclipse m2e Lifecycle Management -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>${lifecycle-mapping-version}</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-maven-plugin</artifactId>
- <versionRange>${openjpa-version}</versionRange>
- <goals>
- <goal>enhance</goal>
- <goal>test-enhance</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore />
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-maven-plugin</artifactId>
- <version>${openjpa-version}</version>
- <configuration>
- <persistenceXmlFile>${project.basedir}/src/test/resources/META-INF/persistence.xml</persistenceXmlFile>
- <includes>org/apache/camel/examples/*.class</includes>
- <addDefaultConstructor>true</addDefaultConstructor>
- <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
- </configuration>
- <executions>
- <execution>
- <id>test enhancer</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>test-enhance</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
+ <profiles>
+ <profile>
+ <id>openjpa</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!-- Eclipse m2e Lifecycle Management -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>${lifecycle-mapping-version}</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-maven-plugin</artifactId>
+ <versionRange>${openjpa-version}</versionRange>
+ <goals>
+ <goal>enhance</goal>
+ <goal>test-enhance</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
<groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa</artifactId>
+ <artifactId>openjpa-maven-plugin</artifactId>
<version>${openjpa-version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
+ <configuration>
+ <persistenceXmlFile>${project.basedir}/src/test/resources/META-INF/persistence.xml</persistenceXmlFile>
+ <includes>org/apache/camel/examples/*.class</includes>
+ <addDefaultConstructor>true</addDefaultConstructor>
+ <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>test enhancer</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>test-enhance</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>${openjpa-version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-persistence-jdbc</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>hibernate</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-hibernate-persistence-xml</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <phase>generate-test-resources</phase>
+ <configuration>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/test/resources/profiles/hibernate/META-INF</directory>
+ </resource>
+ </resources>
+ <outputDirectory>${project.build.testOutputDirectory}/META-INF</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
<profile>
<id>java9</id>
<activation>
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java
index cf95e519..3129249 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodTest.java
@@ -112,7 +112,10 @@ public abstract class AbstractJpaMethodTest extends CamelTestSupport {
final Customer customer = createDefaultCustomer();
save(customer);
-
+
+ assertEntitiesInDatabase(1, Customer.class.getName());
+ assertEntitiesInDatabase(1, Address.class.getName());
+
final CountDownLatch latch = new CountDownLatch(1);
consumer = endpoint.createConsumer(new Processor() {
@@ -162,18 +165,15 @@ public abstract class AbstractJpaMethodTest extends CamelTestSupport {
assertEntitiesInDatabase(0, Address.class.getName());
}
- protected void save(final Customer customer) {
+ protected void save(final Object persistable) {
transactionTemplate.execute(new TransactionCallback<Object>() {
public Object doInTransaction(TransactionStatus status) {
entityManager.joinTransaction();
- entityManager.persist(customer);
+ entityManager.persist(persistable);
entityManager.flush();
return null;
}
});
-
- assertEntitiesInDatabase(1, Customer.class.getName());
- assertEntitiesInDatabase(1, Address.class.getName());
}
protected void assertEntitiesInDatabase(int count, String entity) {
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsePersistTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsePersistTest.java b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsePersistTest.java
index 657895f..e2e0942 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsePersistTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaUsePersistTest.java
@@ -16,43 +16,52 @@
*/
package org.apache.camel.component.jpa;
-import org.apache.camel.examples.Address;
-import org.apache.camel.examples.Customer;
+import javax.persistence.PersistenceException;
+
+import org.apache.camel.examples.Order;
+import org.hamcrest.CoreMatchers;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
/**
* @version
*/
public class JpaUsePersistTest extends AbstractJpaMethodTest {
-
+
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
public boolean usePersist() {
return true;
}
@Test
public void produceExistingEntityShouldThrowAnException() throws Exception {
- setUp("jpa://" + Customer.class.getName() + "?usePersist=true");
+ setUp("jpa://" + Order.class.getName() + "?usePersist=true");
- Customer customer = createDefaultCustomer();
- save(customer);
- long id = customer.getId();
+ Order order = createOrder();
+ save(order);
// and adjust some values
- customer = createDefaultCustomer();
- customer.setId(id);
- customer.setName("Max Mustermann");
- customer.getAddress().setAddressLine1("Musterstr. 1");
- customer.getAddress().setAddressLine2("11111 Enterhausen");
-
- try {
- // we cannot store the 2nd customer as its using the same id as the 1st
- template.requestBody(endpoint, customer);
- fail("Should throw exception");
- } catch (Exception e) {
- // expected
- }
-
- assertEntitiesInDatabase(1, Customer.class.getName());
- assertEntitiesInDatabase(1, Address.class.getName());
+ order = createOrder();
+ order.setProductName("Cheese");
+ order.setProductSku("54321");
+ order.setQuantity(2);
+
+ // we cannot store the 2nd order as its using the same id as the 1st
+ expectedException.expectCause(CoreMatchers.instanceOf(PersistenceException.class));
+ template.requestBody(endpoint, order);
+
+ assertEntitiesInDatabase(1, Order.class.getName());
+ }
+
+ private Order createOrder() {
+ Order order = new Order();
+ order.setId(1L);
+ order.setProductName("Beer");
+ order.setProductSku("12345");
+ order.setQuantity(5);
+ return order;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
index e91dac6..0e66265 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
@@ -113,7 +113,10 @@ public class JpaWithNamedQueryTest extends Assert {
transactionTemplate.execute(new TransactionCallback<Object>() {
public Object doInTransaction(TransactionStatus status) {
// make use of the EntityManager having the relevant persistence-context
- EntityManager entityManager2 = receivedExchange.getIn().getHeader(JpaConstants.ENTITYMANAGER, EntityManager.class);
+ EntityManager entityManager2 = receivedExchange.getIn().getHeader(JpaConstants.ENTITY_MANAGER, EntityManager.class);
+ if (!entityManager2.isOpen()) {
+ entityManager2 = endpoint.getEntityManagerFactory().createEntityManager();
+ }
entityManager2.joinTransaction();
// now lets assert that there are still 2 entities left
@@ -169,7 +172,7 @@ public class JpaWithNamedQueryTest extends Assert {
endpoint = (JpaEndpoint)value;
transactionTemplate = endpoint.createTransactionTemplate();
- entityManager = endpoint.createEntityManager();
+ entityManager = endpoint.getEntityManagerFactory().createEntityManager();
}
protected String getEndpointUri() {
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/java/org/apache/camel/examples/Order.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/examples/Order.java b/components/camel-jpa/src/test/java/org/apache/camel/examples/Order.java
new file mode 100644
index 0000000..1ec16f2
--- /dev/null
+++ b/components/camel-jpa/src/test/java/org/apache/camel/examples/Order.java
@@ -0,0 +1,64 @@
+/**
+ * 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.examples;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "orders")
+public class Order {
+
+ @Id
+ private Long id;
+ private String productName;
+ private String productSku;
+ private Integer quantity;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getProductName() {
+ return productName;
+ }
+
+ public void setProductName(String productName) {
+ this.productName = productName;
+ }
+
+ public String getProductSku() {
+ return productSku;
+ }
+
+ public void setProductSku(String productSku) {
+ this.productSku = productSku;
+ }
+
+ public Integer getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(Integer quantity) {
+ this.quantity = quantity;
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java
index c534da1..ebcfaa0 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java
@@ -26,6 +26,8 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.examples.SendEmail;
import org.apache.camel.spring.SpringRouteBuilder;
+import org.apache.camel.util.ObjectHelper;
+import org.junit.Assume;
import org.junit.Test;
import org.springframework.context.expression.BeanFactoryResolver;
import org.springframework.expression.Expression;
@@ -41,7 +43,14 @@ import static org.hamcrest.CoreMatchers.equalTo;
public class JpaRouteSharedEntityManagerTest extends AbstractJpaTest {
protected static final String SELECT_ALL_STRING = "select x from " + SendEmail.class.getName() + " x";
private CountDownLatch latch = new CountDownLatch(1);
-
+
+ @Override
+ public void setUp() throws Exception {
+ // Don't run on Hibernate
+ Assume.assumeTrue(ObjectHelper.loadClass("org.hibernate.Hibernate") == null);
+ super.setUp();
+ }
+
@Test
public void testRouteJpaShared() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/resources/META-INF/persistence.xml b/components/camel-jpa/src/test/resources/META-INF/persistence.xml
index 89c5a8b..acd8de6 100644
--- a/components/camel-jpa/src/test/resources/META-INF/persistence.xml
+++ b/components/camel-jpa/src/test/resources/META-INF/persistence.xml
@@ -17,11 +17,11 @@
limitations under the License.
-->
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- version="2.0"
+ version="2.1"
xsi:schemaLocation="
- http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+ http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="camel" transaction-type="RESOURCE_LOCAL">
<!--
@@ -38,6 +38,7 @@
<class>org.apache.camel.examples.SendEmail</class>
<class>org.apache.camel.examples.Customer</class>
<class>org.apache.camel.examples.Address</class>
+ <class>org.apache.camel.examples.Order</class>
<properties>
<property name="openjpa.ConnectionURL" value="jdbc:derby:target/derby;create=true"/>
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/resources/org/apache/camel/processor/jpa/springJpaRouteSkipLockedTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/resources/org/apache/camel/processor/jpa/springJpaRouteSkipLockedTest.xml b/components/camel-jpa/src/test/resources/org/apache/camel/processor/jpa/springJpaRouteSkipLockedTest.xml
index 2731aee..6ba4c2d 100644
--- a/components/camel-jpa/src/test/resources/org/apache/camel/processor/jpa/springJpaRouteSkipLockedTest.xml
+++ b/components/camel-jpa/src/test/resources/org/apache/camel/processor/jpa/springJpaRouteSkipLockedTest.xml
@@ -30,9 +30,6 @@
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="skipLockedEntiy"/>
- <!--property name="jpaDialect">
- <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
- </property-->
</bean>
<bean class="org.apache.camel.component.jpa.JpaComponent" id="jpa">
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml b/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
new file mode 100644
index 0000000..83b1ffd
--- /dev/null
+++ b/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
@@ -0,0 +1,96 @@
+<?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.
+
+-->
+<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="2.1"
+ xsi:schemaLocation="
+ http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+
+ <persistence-unit name="camel" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+ <class>org.apache.camel.examples.MultiSteps</class>
+ <class>org.apache.camel.examples.SendEmail</class>
+ <class>org.apache.camel.examples.Customer</class>
+ <class>org.apache.camel.examples.Address</class>
+ <class>org.apache.camel.examples.Order</class>
+
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyTenSevenDialect"/>
+ <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="hibernate.connection.url" value="jdbc:derby:target/derby;create=true"/>
+ <property name="hibernate.hbm2ddl.auto" value="create"/>
+ </properties>
+ </persistence-unit>
+
+ <persistence-unit name="custom" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+ <class>org.apache.camel.examples.MultiSteps</class>
+ <class>org.apache.camel.examples.SendEmail</class>
+
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyTenSevenDialect"/>
+ <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="hibernate.connection.url" value="jdbc:derby:target/custom;create=true"/>
+ <property name="hibernate.hbm2ddl.auto" value="create"/>
+ </properties>
+ </persistence-unit>
+
+ <persistence-unit name="idempotentDb" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+ <class>org.apache.camel.processor.idempotent.jpa.MessageProcessed</class>
+
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyTenSevenDialect"/>
+ <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="hibernate.connection.url" value="jdbc:derby:target/idempotentTest;create=true"/>
+ <property name="hibernate.hbm2ddl.auto" value="create"/>
+ </properties>
+ </persistence-unit>
+
+ <persistence-unit name="trace" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+ <class>org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage</class>
+
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyTenSevenDialect"/>
+ <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="hibernate.connection.url" value="jdbc:derby:target/trace;create=true"/>
+ <property name="hibernate.hbm2ddl.auto" value="create"/>
+ </properties>
+ </persistence-unit>
+
+ <persistence-unit name="skipLockedEntiy" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+ <class>org.apache.camel.examples.VersionedItem</class>
+
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyTenSevenDialect"/>
+ <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="hibernate.connection.url" value="jdbc:derby:target/derby;create=true"/>
+ <property name="hibernate.hbm2ddl.auto" value="create"/>
+ </properties>
+ </persistence-unit>
+
+</persistence>
http://git-wip-us.apache.org/repos/asf/camel/blob/22ffa47b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
index 467c47a..c033883 100644
--- a/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
+++ b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelJpaTest.java
@@ -17,6 +17,7 @@
package org.apache.camel.itest.springboot;
import org.apache.camel.itest.springboot.util.ArquillianPackager;
+import org.apache.camel.itest.springboot.util.DependencyResolver;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
@@ -35,6 +36,9 @@ public class CamelJpaTest extends AbstractSpringBootTestSupport {
public static ITestConfig createTestConfig() {
return new ITestConfigBuilder()
.module(inferModuleName(CamelJpaTest.class))
+ .dependency("org.apache.openjpa:openjpa:" + DependencyResolver.resolveParentProperty("${openjpa-version}"))
+ .dependency("org.apache.openjpa:openjpa-persistence-jdbc")
+ .exclusion("org.apache.geronimo.specs:geronimo-jpa_2.0_spec")
// Exclude tests which require build time enhancement of @Entity annotated classes
.unitTestExclusionPattern(".*(.*Idempotent.*Test$|JpaUsePersistTest$|JpaTraceEventMessageTest$)")
.build();
[4/4] camel git commit: Optimise - The runtime endpoint register may
not be enabled by default. The commands needed a little fix for that.
Posted by da...@apache.org.
Optimise - The runtime endpoint register may not be enabled by default. The commands needed a little fix for that.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6062e8d3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6062e8d3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6062e8d3
Branch: refs/heads/master
Commit: 6062e8d31f60e22b7eb9ffcba406f1d2c6f30374
Parents: 22ffa47
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jun 22 17:35:40 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 22 19:05:44 2017 +0200
----------------------------------------------------------------------
.../org/apache/camel/commands/AbstractLocalCamelController.java | 2 +-
.../java/org/apache/camel/commands/ContextListCommandTest.java | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/6062e8d3/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
index e1e6e3d..554471d 100644
--- a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
+++ b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
@@ -457,7 +457,7 @@ public abstract class AbstractLocalCamelController extends AbstractCamelControll
if (camelContextName != null) {
CamelContext context = this.getLocalCamelContext(camelContextName);
- if (context != null) {
+ if (context != null && context.getRuntimeEndpointRegistry() != null) {
EndpointRegistry staticRegistry = context.getEndpointRegistry();
for (RuntimeEndpointRegistry.Statistic stat : context.getRuntimeEndpointRegistry().getEndpointStatistics()) {
http://git-wip-us.apache.org/repos/asf/camel/blob/6062e8d3/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java b/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
index 24f2042..05e5f1b 100644
--- a/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
+++ b/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
@@ -23,6 +23,7 @@ import java.io.PrintStream;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.DefaultRuntimeEndpointRegistry;
import org.apache.camel.impl.ExplicitCamelContextNameStrategy;
import org.junit.Test;
import org.slf4j.Logger;
@@ -63,6 +64,7 @@ public class ContextListCommandTest {
@Test
public void testEndpointStats() throws Exception {
CamelContext context = new DefaultCamelContext();
+ context.setRuntimeEndpointRegistry(new DefaultRuntimeEndpointRegistry());
context.setNameStrategy(new ExplicitCamelContextNameStrategy("foobar"));
context.addRoutes(new RouteBuilder() {
@Override