camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: CAMEL-6803: Upgraded camel-cdi to deltaspike 0.5
Date Sun, 02 Mar 2014 10:18:35 GMT
Repository: camel
Updated Branches:
  refs/heads/master dc334c3d5 -> eccccefc5


CAMEL-6803: Upgraded camel-cdi to deltaspike 0.5


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

Branch: refs/heads/master
Commit: eccccefc5bc313e63c42daf79cec5539a0fd30e7
Parents: dc334c3
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Mar 2 11:20:40 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Mar 2 11:20:40 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/cdi/Main.java    | 10 +++----
 .../EndpointDefinedUsingConfigPropertyTest.java |  2 +-
 examples/camel-example-cdi/pom.xml              | 15 +++-------
 .../org/apache/camel/example/cdi/MyRoutes.java  | 31 ++++----------------
 .../org/apache/camel/example/cdi/SomeBean.java  |  3 ++
 .../apache/camel/example/cdi/ArchiveUtil.java   |  2 +-
 parent/pom.xml                                  |  8 ++---
 7 files changed, 23 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/eccccefc/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
index 9284c35..f5957ca 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
@@ -21,7 +21,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 
@@ -108,15 +107,13 @@ public abstract class Main extends MainSupport { // abstract to prevent
cdi mana
 
     protected Set<Class<?>> getJaxbPackages() {
         Set<Class<?>> classes = new HashSet<Class<?>>();
-        //classes.add(CamelContextFactoryBean.class);
-        //classes.add(AbstractCamelContextFactoryBean.class);
         classes.add(org.apache.camel.ExchangePattern.class);
         classes.add(org.apache.camel.model.RouteDefinition.class);
         classes.add(org.apache.camel.model.config.StreamResequencerConfig.class);
         classes.add(org.apache.camel.model.dataformat.DataFormatsDefinition.class);
         classes.add(org.apache.camel.model.language.ExpressionDefinition.class);
         classes.add(org.apache.camel.model.loadbalancer.RoundRobinLoadBalancerDefinition.class);
-        //classes.add(SSLContextParametersFactoryBean.class);
+        classes.add(org.apache.camel.model.loadbalancer.RoundRobinLoadBalancerDefinition.class);
         return classes;
     }
 
@@ -129,10 +126,11 @@ public abstract class Main extends MainSupport { // abstract to prevent
cdi mana
         super.doStart();
     }
 
-
     @Override
     protected void doStop() throws Exception {
         super.doStop();
-        ((org.apache.deltaspike.cdise.api.CdiContainer) cdiContainer).shutdown();
+        if (cdiContainer != null) {
+            ((org.apache.deltaspike.cdise.api.CdiContainer) cdiContainer).shutdown();
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/eccccefc/components/camel-cdi/src/test/java/org/apache/camel/cdi/EndpointDefinedUsingConfigPropertyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/test/java/org/apache/camel/cdi/EndpointDefinedUsingConfigPropertyTest.java
b/components/camel-cdi/src/test/java/org/apache/camel/cdi/EndpointDefinedUsingConfigPropertyTest.java
index 52496c2..67f7f3a 100644
--- a/components/camel-cdi/src/test/java/org/apache/camel/cdi/EndpointDefinedUsingConfigPropertyTest.java
+++ b/components/camel-cdi/src/test/java/org/apache/camel/cdi/EndpointDefinedUsingConfigPropertyTest.java
@@ -27,7 +27,7 @@ import org.apache.camel.ProducerTemplate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.cdi.store.Item;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.deltaspike.core.api.config.annotation.ConfigProperty;
+import org.apache.deltaspike.core.api.config.ConfigProperty;
 import org.junit.Test;
 
 public class EndpointDefinedUsingConfigPropertyTest extends CdiContextTestSupport {

http://git-wip-us.apache.org/repos/asf/camel/blob/eccccefc/examples/camel-example-cdi/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi/pom.xml b/examples/camel-example-cdi/pom.xml
index 66e237f..546cddf 100644
--- a/examples/camel-example-cdi/pom.xml
+++ b/examples/camel-example-cdi/pom.xml
@@ -29,6 +29,7 @@
     <description>An example showing how to work with Camel and CDI for dependency injection</description>
 
 	  <!-- TODO this example is packaged as WAR why the osgi imports? -->
+    <!-- TODO: remove the arquillian tests - this should be a simple example -->
     <properties>
         <camel.osgi.export>org.apache.camel.example.cdi.*</camel.osgi.export>
         <camel.osgi.import>
@@ -48,6 +49,7 @@
     </properties>
 
     <dependencies>
+
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-cdi</artifactId>
@@ -62,16 +64,6 @@
             <scope>provided</scope>
         </dependency>
 
-        <!-- activemq component -->
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-camel</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-pool</artifactId>
-        </dependency>
-
         <!-- logging -->
         <dependency>
             <groupId>org.slf4j</groupId>
@@ -192,9 +184,10 @@
                                 <arquillian>weld-ee-embedded</arquillian>
                             </systemPropertyVariables>
                             <includes>
-                                <include>**/*Test.java</include>
+                                <!--<include>**/*Test.java</include>-->
                             </includes>
                             <excludes>
+                                <exclude>**/*Test*.java</exclude>
                                 <exclude>**/*JBoss*.java</exclude>
                             </excludes>
                         </configuration>

http://git-wip-us.apache.org/repos/asf/camel/blob/eccccefc/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
b/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
index c3a8935..4796d93 100644
--- a/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
+++ b/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
@@ -19,9 +19,7 @@ package org.apache.camel.example.cdi;
 import javax.ejb.Startup;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
-import javax.inject.Named;
 
-import org.apache.activemq.camel.component.ActiveMQComponent;
 import org.apache.camel.Endpoint;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.cdi.ContextName;
@@ -36,37 +34,20 @@ import org.apache.camel.cdi.Uri;
 public class MyRoutes extends RouteBuilder {
 
     @Inject
-    //@Uri("activemq:test.MyQueue")
-    @Uri("file://target/testdata/queue")
-    private Endpoint queueEndpoint;
-
-    @Inject
-    @Uri("file://target/testdata/result?noop=true")
+    @Uri("file://target/testdata/result")
     private Endpoint resultEndpoint;
 
+    @Inject
+    private SomeBean someBean;
 
     @Override
     public void configure() throws Exception {
         // you can configure the route rule with Java DSL here
 
         // populate the message queue with some messages
-        from("file:src/data?noop=true").
-                to(queueEndpoint);
-
-        // consume from message queue to a result endpoint and process with a bean
-        from(queueEndpoint).
-                to(resultEndpoint).
-                bean(new SomeBean());
-    }
-
-    /**
-     * Configure ActiveMQ endpoints
-     */
-    @Named("activemq")
-    public ActiveMQComponent createActiveMQComponent() {
-        ActiveMQComponent answer = new ActiveMQComponent();
-        answer.setBrokerURL("vm://localhost.cdi?marshal=false&broker.persistent=false&broker.useJmx=false");
-        return answer;
+        from("file:src/data?noop=true")
+            .bean(someBean)
+            .to(resultEndpoint);
     }
 
     public Endpoint getResultEndpoint() {

http://git-wip-us.apache.org/repos/asf/camel/blob/eccccefc/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/SomeBean.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/SomeBean.java
b/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/SomeBean.java
index 63165e2..1a45cd4 100644
--- a/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/SomeBean.java
+++ b/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/SomeBean.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.example.cdi;
 
+import javax.inject.Singleton;
+
+@Singleton
 public class SomeBean {
 
     public void someMethod(String body) {

http://git-wip-us.apache.org/repos/asf/camel/blob/eccccefc/examples/camel-example-cdi/src/test/java/org/apache/camel/example/cdi/ArchiveUtil.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi/src/test/java/org/apache/camel/example/cdi/ArchiveUtil.java
b/examples/camel-example-cdi/src/test/java/org/apache/camel/example/cdi/ArchiveUtil.java
index fccdd7f..0cdd8e4 100644
--- a/examples/camel-example-cdi/src/test/java/org/apache/camel/example/cdi/ArchiveUtil.java
+++ b/examples/camel-example-cdi/src/test/java/org/apache/camel/example/cdi/ArchiveUtil.java
@@ -60,7 +60,7 @@ public final class ArchiveUtil {
 
         File[] libs = Maven.resolver()
                 .loadPomFromFile("pom.xml")
-                .resolve("org.apache.camel:camel-core", "org.apache.camel:camel-cdi", "org.apache.activemq:activemq-camel")
+                .resolve("org.apache.camel:camel-core", "org.apache.camel:camel-cdi")
                 .withTransitivity()
                 .as(File.class);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/eccccefc/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index ead2db6..11b8f23 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -109,7 +109,7 @@
     <cxf-version>2.7.10</cxf-version>
     <cxf-version-range>[2.6,4.0)</cxf-version-range>
     <cxf-xjc-utils-version>2.7.0</cxf-xjc-utils-version>
-    <deltaspike-version>0.3-incubating</deltaspike-version>
+    <deltaspike-version>0.5</deltaspike-version>
     <derby-version>10.10.1.1</derby-version>
     <disruptor-version>3.2.0</disruptor-version>
     <dnsjava-version>2.1.1</dnsjava-version>
@@ -161,7 +161,7 @@
     <google-gdata-version>1.41.5.w1</google-gdata-version>
     <google-gdata-bundle-version>1.41.1_1</google-gdata-bundle-version>
     <!-- camel-cdi doesn't work with Guava 15.0.0 at present -->
-    <google-guava-version>14.0.1</google-guava-version>
+    <google-guava-version>16.0.1</google-guava-version>
     <groovy-version>2.2.2</groovy-version>
     <gson-version>2.2.4</gson-version>
     <guice-bundle-version>3.0_1</guice-bundle-version>
@@ -411,8 +411,8 @@
     <vertx-version>2.0.1-final</vertx-version>
     <vysper-version>0.7</vysper-version>
     <!-- should be in-sync with deltaspike -->
-    <weld-version>1.1.5.Final</weld-version>
-    <weld2-version>2.1.0.Final</weld2-version>
+    <weld-version>1.1.18.Final</weld-version>
+    <weld2-version>2.1.2.Final</weld2-version>
     <werken-xpath-bundle-version>0.9.4_5</werken-xpath-bundle-version>
     <woodstox-version>4.2.0</woodstox-version>
     <ws-commons-util-bundle-version>1.0.2_2</ws-commons-util-bundle-version>


Mime
View raw message