camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astefanu...@apache.org
Subject camel git commit: Camel CDI: prepare CDI 2.0 compatibility
Date Wed, 23 Nov 2016 12:17:18 GMT
Repository: camel
Updated Branches:
  refs/heads/master a37b24de0 -> 74a6d416d


Camel CDI: prepare CDI 2.0 compatibility


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/74a6d416
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/74a6d416
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/74a6d416

Branch: refs/heads/master
Commit: 74a6d416d9117ceaa9951ff629adffb9b68fc5fd
Parents: a37b24d
Author: Antonin Stefanutti <antonin@stefanutti.fr>
Authored: Wed Nov 23 13:17:08 2016 +0100
Committer: Antonin Stefanutti <antonin@stefanutti.fr>
Committed: Wed Nov 23 13:17:08 2016 +0100

----------------------------------------------------------------------
 components/camel-cdi/pom.xml                    | 34 ++++++++++++++++++++
 .../cdi/test/MultiContextEventNotifierTest.java | 16 ++++-----
 parent/pom.xml                                  |  2 ++
 3 files changed, 44 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/74a6d416/components/camel-cdi/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-cdi/pom.xml b/components/camel-cdi/pom.xml
index 096a862..26b328f 100644
--- a/components/camel-cdi/pom.xml
+++ b/components/camel-cdi/pom.xml
@@ -263,6 +263,40 @@
     </profile>
 
     <profile>
+      <id>weld-2.0</id>
+
+      <dependencies>
+
+        <!-- provided dependencies -->
+
+        <dependency>
+          <groupId>javax.enterprise</groupId>
+          <artifactId>cdi-api</artifactId>
+          <version>${cdi-api-2.0-version}</version>
+          <scope>provided</scope>
+        </dependency>
+
+        <!-- test dependencies -->
+
+        <dependency>
+          <groupId>org.jboss.weld</groupId>
+          <artifactId>weld-core-impl</artifactId>
+          <version>${weld3-version}</version>
+          <scope>test</scope>
+        </dependency>
+
+        <dependency>
+          <groupId>org.jboss.arquillian.container</groupId>
+          <artifactId>arquillian-weld-embedded</artifactId>
+          <version>${arquillian-weld-embedded-version}</version>
+          <scope>test</scope>
+        </dependency>
+
+      </dependencies>
+    </profile>
+
+
+    <profile>
       <id>owb-1.0</id>
 
       <build>

http://git-wip-us.apache.org/repos/asf/camel/blob/74a6d416/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventNotifierTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventNotifierTest.java
b/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventNotifierTest.java
index 937f933..b2f0c2c 100644
--- a/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventNotifierTest.java
+++ b/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventNotifierTest.java
@@ -77,7 +77,7 @@ public class MultiContextEventNotifierTest {
     @Inject @Uri("mock:outbound")
     private MockEndpoint defaultOutbound;
 
-    @Produces @ApplicationScoped
+    @Produces @ApplicationScoped @Named("defaultContext")
     private List<Class> defaultFiredEvents = new ArrayList<>();
 
 
@@ -107,7 +107,7 @@ public class MultiContextEventNotifierTest {
     private List<Class> secondFiredEvents = new ArrayList<>();
 
 
-    @Produces @ApplicationScoped @Any @Named("anyContext")
+    @Produces @ApplicationScoped @Named("anyContext")
     private List<Class> anyFiredEvents = new ArrayList<>();
 
 
@@ -124,15 +124,15 @@ public class MultiContextEventNotifierTest {
     }
 
 
-    private void onDefaultContextStartingEvent(@Observes @Default CamelContextStartingEvent
event, List<Class> events) {
+    private void onDefaultContextStartingEvent(@Observes @Default CamelContextStartingEvent
event, @Named("defaultContext") List<Class> events) {
         events.add(CamelContextStartingEvent.class);
     }
 
-    private void onDefaultContextStartedEvent(@Observes @Default CamelContextStartedEvent
event, List<Class> events) {
+    private void onDefaultContextStartedEvent(@Observes @Default CamelContextStartedEvent
event, @Named("defaultContext") List<Class> events) {
         events.add(CamelContextStartedEvent.class);
     }
 
-    private void onDefaultExchangeEvent(@Observes @Default AbstractExchangeEvent event, List<Class>
events) {
+    private void onDefaultExchangeEvent(@Observes @Default AbstractExchangeEvent event, @Named("defaultContext")
List<Class> events) {
         events.add(event.getClass());
     }
 
@@ -180,7 +180,7 @@ public class MultiContextEventNotifierTest {
 
     @Test
     @InSequence(1)
-    public void configureCamelContexts(List<Class> defaultEvents,
+    public void configureCamelContexts(@Named("defaultContext") List<Class> defaultEvents,
                                        @ContextName("first") List<Class> firstEvents,
                                        @ContextName("second") List<Class> secondEvents,
                                        @Named("anyContext") List<Class> anyEvents)
throws Exception {
@@ -214,7 +214,7 @@ public class MultiContextEventNotifierTest {
 
     @Test
     @InSequence(2)
-    public void sendMessageToDefaultCamelContextInbound(List<Class> events) throws
InterruptedException {
+    public void sendMessageToDefaultCamelContextInbound(@Named("defaultContext") List<Class>
events) throws InterruptedException {
         defaultOutbound.expectedMessageCount(1);
         defaultOutbound.expectedBodiesReceived("test-default");
         defaultOutbound.message(0).exchange().matches(fromCamelContext("camel-cdi"));
@@ -285,7 +285,7 @@ public class MultiContextEventNotifierTest {
 
     @Test
     @InSequence(5)
-    public void stopCamelContexts(List<Class> defaultEvents,
+    public void stopCamelContexts(@Named("defaultContext") List<Class> defaultEvents,
                                   @ContextName("first") List<Class> firstEvents,
                                   @ContextName("second") List<Class> secondEvents,
                                   @Named("anyContext") List<Class> anyEvents) throws
Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/74a6d416/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 01d85eb..681ee64 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -99,6 +99,7 @@
     <cdi-api-1.0-version>1.0-SP4</cdi-api-1.0-version>
     <cdi-api-1.1-version>1.1</cdi-api-1.1-version>
     <cdi-api-1.2-version>1.2</cdi-api-1.2-version>
+    <cdi-api-2.0-version>2.0-EDR2</cdi-api-2.0-version>
     <cglib-bundle-version>3.2.4_1</cglib-bundle-version>
     <cglib-version>3.2.4</cglib-version>
     <chronicle-bytes-version>1.7.22</chronicle-bytes-version>
@@ -616,6 +617,7 @@
     <vysper-version>0.7</vysper-version>
     <weld1-version>1.1.28.Final</weld1-version>
     <weld2-version>2.4.1.Final</weld2-version>
+    <weld3-version>3.0.0.Alpha17</weld3-version>
     <werken-xpath-bundle-version>0.9.4_5</werken-xpath-bundle-version>
     <wiremock-version>2.1.12</wiremock-version>
     <woodstox-version>4.4.1</woodstox-version>


Mime
View raw message