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 2016/02/23 13:22:48 UTC
[1/6] camel git commit: CAMEL-9201: Improved support for programmatic
lookup
Repository: camel
Updated Branches:
refs/heads/master 5865d2e4a -> 5fbf7c5d6
CAMEL-9201: Improved support for programmatic lookup
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/93631c85
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/93631c85
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/93631c85
Branch: refs/heads/master
Commit: 93631c85f4250b3843a7ada987c99aeed909a11d
Parents: 5865d2e
Author: Antonin Stefanutti <an...@stefanutti.fr>
Authored: Tue Feb 23 12:30:05 2016 +0100
Committer: Antonin Stefanutti <an...@stefanutti.fr>
Committed: Tue Feb 23 12:30:05 2016 +0100
----------------------------------------------------------------------
components/camel-cdi/pom.xml | 17 ++++
.../org/apache/camel/cdi/CdiCamelExtension.java | 4 +-
.../java/org/apache/camel/cdi/CdiSpiHelper.java | 4 +
.../src/main/java/org/apache/camel/cdi/Uri.java | 26 ++++++
.../camel/cdi/test/ProgrammaticLookupTest.java | 89 ++++++++++++++++++++
5 files changed, 138 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/93631c85/components/camel-cdi/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-cdi/pom.xml b/components/camel-cdi/pom.xml
index 6c10e00..fb23bce 100644
--- a/components/camel-cdi/pom.xml
+++ b/components/camel-cdi/pom.xml
@@ -264,6 +264,8 @@
<exclude>**/*Cdi12Test.java</exclude>
<!-- OWB does not call the InjectionTarget#preDestroy method -->
<exclude>**/UnstoppedCamelContext*Test.java</exclude>
+ <!-- Reactivate when OWB-1122 is fixed -->
+ <exclude>**/ProgrammaticLookupTest.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -317,6 +319,21 @@
<profile>
<id>owb-1.2</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- Reactivate when OWB-1122 is fixed -->
+ <exclude>**/ProgrammaticLookupTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<!-- provided dependencies -->
http://git-wip-us.apache.org/repos/asf/camel/blob/93631c85/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
index 9f80a0f..4cacd4a 100755
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
@@ -172,7 +172,7 @@ public class CdiCamelExtension implements Extension {
Class<?> type = CdiSpiHelper.getRawType(am.getBaseType());
if (Endpoint.class.isAssignableFrom(type) || ProducerTemplate.class.equals(type)) {
Set<Annotation> qualifiers = CdiSpiHelper.getQualifiers(am, manager);
- producerQualifiers.put(am.getJavaMember(), qualifiers.isEmpty() ? Collections.<Annotation>singleton(DefaultLiteral.INSTANCE) : qualifiers);
+ producerQualifiers.put(am.getJavaMember(), qualifiers);
Set<Annotation> annotations = new HashSet<>(am.getAnnotations());
annotations.removeAll(qualifiers);
annotations.add(Excluded.INSTANCE);
@@ -239,7 +239,7 @@ public class CdiCamelExtension implements Extension {
}
} else {
if (Endpoint.class.isAssignableFrom(type) || ProducerTemplate.class.isAssignableFrom(type)) {
- qualifiers.addAll(CdiSpiHelper.excludeElementOfTypes(contextQualifiers, Any.class, Default.class, Named.class));
+ qualifiers.addAll(CdiSpiHelper.excludeElementOfTypes(contextQualifiers, Default.class, Named.class));
}
}
// TODO: would be more correct to add a bean for each Camel context bean
http://git-wip-us.apache.org/repos/asf/camel/blob/93631c85/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java
index d2cb4af..8a7c8c5 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java
@@ -138,6 +138,10 @@ final class CdiSpiHelper {
qualifiers.add(annotation);
}
}
+ if (qualifiers.isEmpty()) {
+ qualifiers.add(DefaultLiteral.INSTANCE);
+ }
+ qualifiers.add(AnyLiteral.INSTANCE);
return qualifiers;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/93631c85/components/camel-cdi/src/main/java/org/apache/camel/cdi/Uri.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Uri.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Uri.java
index 0fff3d1..538f882 100755
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Uri.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Uri.java
@@ -20,6 +20,7 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import javax.enterprise.util.AnnotationLiteral;
import javax.enterprise.util.Nonbinding;
import javax.inject.Qualifier;
@@ -60,4 +61,29 @@ public @interface Uri {
*/
@Deprecated
@Nonbinding String context() default "";
+
+ final class Literal extends AnnotationLiteral<Uri> implements Uri {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String uri;
+
+ private Literal(String uri) {
+ this.uri = uri;
+ }
+
+ public static Literal of(String uri) {
+ return new Literal(uri);
+ }
+
+ @Override
+ public String value() {
+ return uri;
+ }
+
+ @Override
+ public String context() {
+ return "";
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/camel/blob/93631c85/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/ProgrammaticLookupTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/ProgrammaticLookupTest.java b/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/ProgrammaticLookupTest.java
new file mode 100644
index 0000000..eb1eb18
--- /dev/null
+++ b/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/ProgrammaticLookupTest.java
@@ -0,0 +1,89 @@
+/**
+ * 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.cdi.test;
+
+import java.util.concurrent.TimeUnit;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.cdi.CdiCamelExtension;
+import org.apache.camel.cdi.Uri;
+import org.apache.camel.cdi.bean.EndpointInjectRoute;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(Arquillian.class)
+public class ProgrammaticLookupTest {
+
+ @Any
+ @Inject
+ Instance<CamelContext> contexts;
+
+ @Any
+ @Inject
+ private Instance<ProducerTemplate> producers;
+
+ @Any
+ @Inject
+ private Instance<Endpoint> endpoints;
+
+ @Deployment
+ public static Archive<?> deployment() {
+ return ShrinkWrap.create(JavaArchive.class)
+ // Camel CDI
+ .addPackage(CdiCamelExtension.class.getPackage())
+ // Test class
+ .addClass(EndpointInjectRoute.class)
+ // Bean archive deployment descriptor
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+
+ @Test
+ public void verifyCamelContext() {
+ assertThat("Context instance status is incorrect!", contexts.get().getStatus(), is(equalTo(ServiceStatus.Started)));
+ }
+
+ @Test
+ public void sendMessageToInbound() throws InterruptedException {
+ ProducerTemplate inbound = producers.select(Uri.Literal.of("direct:inbound")).get();
+ MockEndpoint outbound = endpoints.select(MockEndpoint.class, Uri.Literal.of("mock:outbound")).get();
+
+ outbound.expectedMessageCount(1);
+ outbound.expectedBodiesReceived("test");
+
+ inbound.sendBody("test");
+
+ assertIsSatisfied(2L, TimeUnit.SECONDS, outbound);
+ }
+}
[5/6] camel git commit: Avoid warning about missing DeltaSpike
dependency
Posted by da...@apache.org.
Avoid warning about missing DeltaSpike dependency
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/91d1abee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/91d1abee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/91d1abee
Branch: refs/heads/master
Commit: 91d1abeed333c323a4b38e148559cc8001adc8ca
Parents: b7e661f
Author: Antonin Stefanutti <an...@stefanutti.fr>
Authored: Tue Feb 23 13:09:05 2016 +0100
Committer: Antonin Stefanutti <an...@stefanutti.fr>
Committed: Tue Feb 23 13:09:05 2016 +0100
----------------------------------------------------------------------
components/camel-cdi/src/main/resources/META-INF/beans.xml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/91d1abee/components/camel-cdi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/resources/META-INF/beans.xml b/components/camel-cdi/src/main/resources/META-INF/beans.xml
index dd78a5d..14deb99 100644
--- a/components/camel-cdi/src/main/resources/META-INF/beans.xml
+++ b/components/camel-cdi/src/main/resources/META-INF/beans.xml
@@ -20,5 +20,9 @@
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_0.xsd"
version="1.0" bean-discovery-mode="all">
-
+
+ <scan>
+ <exclude name="org.apache.camel.cdi.Main"/>
+ </scan>
+
</beans>
\ No newline at end of file
[6/6] camel git commit: Rename CDI examples test classes to avoid
clashes in IDEs and polish
Posted by da...@apache.org.
Rename CDI examples test classes to avoid clashes in IDEs and polish
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5fbf7c5d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5fbf7c5d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5fbf7c5d
Branch: refs/heads/master
Commit: 5fbf7c5d6e83428cbee7babd227860ce541bb327
Parents: 91d1abe
Author: Antonin Stefanutti <an...@stefanutti.fr>
Authored: Tue Feb 23 13:16:38 2016 +0100
Committer: Antonin Stefanutti <an...@stefanutti.fr>
Committed: Tue Feb 23 13:16:38 2016 +0100
----------------------------------------------------------------------
.../example/cdi/metrics/ApplicationTest.java | 90 -------------------
.../example/cdi/metrics/CdiMetricsTest.java | 94 ++++++++++++++++++++
.../camel/example/cdi/osgi/CdiOsgiIT.java | 6 +-
.../example/cdi/properties/ApplicationTest.java | 72 ---------------
.../cdi/properties/CdiPropertiesTest.java | 73 +++++++++++++++
.../cdi/rest/servlet/CdiRestServletTest.java | 63 +++++++++++++
.../example/cdi/rest/servlet/RestCdiTest.java | 61 -------------
7 files changed, 234 insertions(+), 225 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5fbf7c5d/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/ApplicationTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/ApplicationTest.java b/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/ApplicationTest.java
deleted file mode 100644
index 623c519..0000000
--- a/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/ApplicationTest.java
+++ /dev/null
@@ -1,90 +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.cdi.metrics;
-
-import javax.inject.Inject;
-import com.codahale.metrics.Gauge;
-import com.codahale.metrics.Meter;
-import com.codahale.metrics.annotation.Metric;
-import io.astefanutti.metrics.cdi.MetricsExtension;
-import org.apache.camel.CamelContext;
-import org.apache.camel.cdi.CdiCamelExtension;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-@RunWith(Arquillian.class)
-public class ApplicationTest {
-
- @Inject
- private Meter generated;
- @Inject
- private Meter attempt;
- @Inject
- private Meter success;
- @Inject
- private Meter redelivery;
- @Inject
- private Meter error;
-
- @Inject
- @Metric(name = "success-ratio")
- private Gauge<Double> ratio;
-
- @Inject
- private CamelContext context;
-
- @Deployment
- public static Archive<?> deployment() {
- return ShrinkWrap.create(JavaArchive.class)
- // Camel CDI
- .addPackage(CdiCamelExtension.class.getPackage())
- // Metrics CDI
- .addPackage(MetricsExtension.class.getPackage())
- // Test classes
- .addPackage(Application.class.getPackage())
- // Bean archive deployment descriptor
- .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
- }
-
- @Test
- public void testContextName() {
- assertThat("Context name is incorrect!", context.getName(), is(equalTo("camel-example-metrics-cdi")));
- }
-
- @Test
- public void testMetricsValues() throws Exception {
- // Wait a while so that the timer can kick in
- Thread.sleep(5000);
-
- // And stop the Camel context so that inflight exchanges get completed
- context.stop();
-
- assertThat("Meter counts are not consistent!", attempt.getCount() - redelivery.getCount() - success.getCount() - error.getCount(), is(equalTo(0L)));
-
- assertThat("Success rate gauge value is incorrect!", ratio.getValue(), is(equalTo(success.getOneMinuteRate() / generated.getOneMinuteRate())));
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/5fbf7c5d/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/CdiMetricsTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/CdiMetricsTest.java b/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/CdiMetricsTest.java
new file mode 100644
index 0000000..ff7665e
--- /dev/null
+++ b/examples/camel-example-cdi-metrics/src/test/java/org/apache/camel/example/cdi/metrics/CdiMetricsTest.java
@@ -0,0 +1,94 @@
+/**
+ * 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.cdi.metrics;
+
+import javax.inject.Inject;
+import com.codahale.metrics.Gauge;
+import com.codahale.metrics.Meter;
+import com.codahale.metrics.annotation.Metric;
+import io.astefanutti.metrics.cdi.MetricsExtension;
+import org.apache.camel.CamelContext;
+import org.apache.camel.cdi.CdiCamelExtension;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+@RunWith(Arquillian.class)
+public class CdiMetricsTest {
+
+ @Inject
+ private Meter generated;
+ @Inject
+ private Meter attempt;
+ @Inject
+ private Meter success;
+ @Inject
+ private Meter redelivery;
+ @Inject
+ private Meter error;
+
+ @Inject
+ @Metric(name = "success-ratio")
+ private Gauge<Double> ratio;
+
+ @Inject
+ private CamelContext context;
+
+ @Deployment
+ public static Archive<?> deployment() {
+ return ShrinkWrap.create(JavaArchive.class)
+ // Camel CDI
+ .addPackage(CdiCamelExtension.class.getPackage())
+ // Metrics CDI
+ .addPackage(MetricsExtension.class.getPackage())
+ // Test classes
+ .addPackage(Application.class.getPackage())
+ // Bean archive deployment descriptor
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+
+ @Test
+ public void testContextName() {
+ assertThat("Context name is incorrect!", context.getName(), is(equalTo("camel-example-metrics-cdi")));
+ }
+
+ @Test
+ public void testMetricsValues() throws Exception {
+ // Wait a while so that the timer can kick in
+ Thread.sleep(5000);
+
+ // And stop the Camel context so that inflight exchanges get completed
+ context.stop();
+
+ assertThat("Meter counts are not consistent!",
+ attempt.getCount() - redelivery.getCount() - success.getCount() - error.getCount(),
+ is(equalTo(0L)));
+
+ assertThat("Success rate gauge value is incorrect!",
+ ratio.getValue(),
+ is(equalTo(success.getOneMinuteRate() / generated.getOneMinuteRate())));
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/5fbf7c5d/examples/camel-example-cdi-osgi/src/test/java/org/apache/camel/example/cdi/osgi/CdiOsgiIT.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-osgi/src/test/java/org/apache/camel/example/cdi/osgi/CdiOsgiIT.java b/examples/camel-example-cdi-osgi/src/test/java/org/apache/camel/example/cdi/osgi/CdiOsgiIT.java
index a05b3fd..2d7aaba 100644
--- a/examples/camel-example-cdi-osgi/src/test/java/org/apache/camel/example/cdi/osgi/CdiOsgiIT.java
+++ b/examples/camel-example-cdi-osgi/src/test/java/org/apache/camel/example/cdi/osgi/CdiOsgiIT.java
@@ -82,13 +82,15 @@ public class CdiOsgiIT {
@Test
public void testRouteStatus() {
- assertThat("Route status is incorrect!", context.getRouteStatus("consumer-route"), equalTo(ServiceStatus.Started));
+ assertThat("Route status is incorrect!",
+ context.getRouteStatus("consumer-route"), equalTo(ServiceStatus.Started));
}
@Test
public void testExchangesCompleted() throws Exception {
ManagedRouteMBean route = context.getManagedRoute(context.getRoute("consumer-route").getId(), ManagedRouteMBean.class);
- assertThat("Number of exchanges completed is incorrect!", route.getExchangesCompleted(), equalTo(1L));
+ assertThat("Number of exchanges completed is incorrect!",
+ route.getExchangesCompleted(), equalTo(1L));
}
@Test
http://git-wip-us.apache.org/repos/asf/camel/blob/5fbf7c5d/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/ApplicationTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/ApplicationTest.java b/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/ApplicationTest.java
deleted file mode 100644
index c092a43..0000000
--- a/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/ApplicationTest.java
+++ /dev/null
@@ -1,72 +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.cdi.properties;
-
-import javax.enterprise.event.Observes;
-
-import org.apache.camel.builder.AdviceWithRouteBuilder;
-import org.apache.camel.cdi.CdiCamelExtension;
-import org.apache.camel.cdi.Uri;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.management.event.CamelContextStartingEvent;
-import org.apache.camel.model.ModelCamelContext;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-
-@RunWith(Arquillian.class)
-public class ApplicationTest {
-
- @Deployment
- public static Archive deployment() {
- return ShrinkWrap.create(JavaArchive.class)
- // Camel CDI
- .addPackage(CdiCamelExtension.class.getPackage())
- // DeltaSpike
- .addPackages(true, "org.apache.deltaspike.core.impl")
- // Test classes
- .addPackage(Application.class.getPackage())
- // Bean archive deployment descriptor
- .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
- }
-
- static void advice(@Observes CamelContextStartingEvent event, ModelCamelContext context) throws Exception {
- // Add a mock endpoint to the end of the route
- context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
- @Override
- public void configure() {
- weaveAddLast().to("mock:outbound");
- }
- });
- }
-
- @Test
- public void testMessage(@Uri("mock:outbound") MockEndpoint outbound) {
- assertThat("Exchange count is incorrect!", outbound.getExchanges(), hasSize(1));
- assertThat("Exchange body is incorrect!", outbound.getExchanges().get(0).getIn().getBody(String.class), is(equalTo("Hello")));
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/5fbf7c5d/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/CdiPropertiesTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/CdiPropertiesTest.java b/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/CdiPropertiesTest.java
new file mode 100644
index 0000000..b7ef16e
--- /dev/null
+++ b/examples/camel-example-cdi-properties/src/test/java/org/apache/camel/example/cdi/properties/CdiPropertiesTest.java
@@ -0,0 +1,73 @@
+/**
+ * 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.cdi.properties;
+
+import javax.enterprise.event.Observes;
+
+import org.apache.camel.builder.AdviceWithRouteBuilder;
+import org.apache.camel.cdi.CdiCamelExtension;
+import org.apache.camel.cdi.Uri;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.management.event.CamelContextStartingEvent;
+import org.apache.camel.model.ModelCamelContext;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+
+@RunWith(Arquillian.class)
+public class CdiPropertiesTest {
+
+ @Deployment
+ public static Archive deployment() {
+ return ShrinkWrap.create(JavaArchive.class)
+ // Camel CDI
+ .addPackage(CdiCamelExtension.class.getPackage())
+ // DeltaSpike
+ .addPackages(true, "org.apache.deltaspike.core.impl")
+ // Test classes
+ .addPackage(Application.class.getPackage())
+ // Bean archive deployment descriptor
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+
+ static void advice(@Observes CamelContextStartingEvent event, ModelCamelContext context) throws Exception {
+ // Add a mock endpoint to the end of the route
+ context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
+ @Override
+ public void configure() {
+ weaveAddLast().to("mock:outbound");
+ }
+ });
+ }
+
+ @Test
+ public void testMessage(@Uri("mock:outbound") MockEndpoint outbound) {
+ assertThat("Exchange count is incorrect!", outbound.getExchanges(), hasSize(1));
+ assertThat("Exchange body is incorrect!",
+ outbound.getExchanges().get(0).getIn().getBody(String.class), is(equalTo("Hello")));
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/5fbf7c5d/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/CdiRestServletTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/CdiRestServletTest.java b/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/CdiRestServletTest.java
new file mode 100644
index 0000000..e9eb337
--- /dev/null
+++ b/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/CdiRestServletTest.java
@@ -0,0 +1,63 @@
+/**
+ * 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.cdi.rest.servlet;
+
+import java.net.URL;
+import java.nio.file.Paths;
+
+import org.apache.camel.util.IOHelper;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+
+@RunWith(Arquillian.class)
+public class CdiRestServletTest {
+
+ @Deployment
+ public static Archive<?> createTestArchive() {
+ return ShrinkWrap.create(WebArchive.class)
+ .addClass(Application.class)
+ .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
+ .setWebXML(Paths.get("src/main/webapp/WEB-INF/web.xml").toFile());
+ }
+
+ @Test
+ @RunAsClient
+ public void testWithPath(@ArquillianResource URL url) throws Exception {
+ assertThat(IOHelper.loadText(new URL(url, "camel/say/hello").openStream()),
+ is(equalTo("Hello World!\n")));
+ }
+
+ @Test
+ @RunAsClient
+ public void testWithUriTemplate(@ArquillianResource URL url) throws Exception {
+ assertThat(IOHelper.loadText(new URL(url, "camel/say/hello/Antonin").openStream()),
+ is(equalTo("Hello Antonin, I'm CamelContext(hello)!\n")));
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/5fbf7c5d/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/RestCdiTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/RestCdiTest.java b/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/RestCdiTest.java
deleted file mode 100644
index 3188035..0000000
--- a/examples/camel-example-cdi-rest-servlet/src/test/java/org/apache/camel/example/cdi/rest/servlet/RestCdiTest.java
+++ /dev/null
@@ -1,61 +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.cdi.rest.servlet;
-
-import java.net.URL;
-import java.nio.file.Paths;
-
-import org.apache.camel.util.IOHelper;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.container.test.api.RunAsClient;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
-
-@RunWith(Arquillian.class)
-public class RestCdiTest {
-
- @Deployment
- public static Archive<?> createTestArchive() {
- return ShrinkWrap.create(WebArchive.class)
- .addClass(Application.class)
- .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
- .setWebXML(Paths.get("src/main/webapp/WEB-INF/web.xml").toFile());
- }
-
- @Test
- @RunAsClient
- public void testWithPath(@ArquillianResource URL url) throws Exception {
- assertThat(IOHelper.loadText(new URL(url, "camel/say/hello").openStream()), is(equalTo("Hello World!\n")));
- }
-
- @Test
- @RunAsClient
- public void testWithUriTemplate(@ArquillianResource URL url) throws Exception {
- assertThat(IOHelper.loadText(new URL(url, "camel/say/hello/Antonin").openStream()), is(equalTo("Hello Antonin, I'm CamelContext(hello)!\n")));
- }
-}
\ No newline at end of file
[4/6] camel git commit: Polish Camel CDI examples READMEs
Posted by da...@apache.org.
Polish Camel CDI examples READMEs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b7e661f1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b7e661f1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b7e661f1
Branch: refs/heads/master
Commit: b7e661f16848d14703c4ef0f5c37c2e460618a75
Parents: a037971
Author: Antonin Stefanutti <an...@stefanutti.fr>
Authored: Tue Feb 23 13:02:24 2016 +0100
Committer: Antonin Stefanutti <an...@stefanutti.fr>
Committed: Tue Feb 23 13:02:24 2016 +0100
----------------------------------------------------------------------
examples/camel-example-cdi-metrics/README.md | 10 ++++--
examples/camel-example-cdi-osgi/README.md | 2 +-
examples/camel-example-cdi-properties/README.md | 10 ++++--
.../camel-example-cdi-rest-servlet/README.md | 10 ++++--
examples/camel-example-cdi/README.md | 32 +++++++++++---------
5 files changed, 40 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/b7e661f1/examples/camel-example-cdi-metrics/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-metrics/README.md b/examples/camel-example-cdi-metrics/README.md
index bf161d1..ecf330d 100644
--- a/examples/camel-example-cdi-metrics/README.md
+++ b/examples/camel-example-cdi-metrics/README.md
@@ -24,13 +24,17 @@ of generated events.
You will need to build this example first:
- mvn install
+```sh
+$ mvn install
+```
### Run
You can run this example using:
- mvn compile camel:run
+```sh
+$ mvn compile camel:run
+```
When the Camel application runs, you should see the calls to the 'unreliable-service' being logged to the console, e.g.:
```
@@ -64,7 +68,7 @@ The Camel application can be stopped pressing <kbd>ctrl</kbd>+<kbd>c</kbd> in th
### Forum, Help, etc
If you hit an problems please let us know on the Camel Forums
- <http://camel.apache.org/discussion-forums.html>
+<http://camel.apache.org/discussion-forums.html>
Please help us make Apache Camel better - we appreciate any feedback you may have. Enjoy!
http://git-wip-us.apache.org/repos/asf/camel/blob/b7e661f1/examples/camel-example-cdi-osgi/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-osgi/README.md b/examples/camel-example-cdi-osgi/README.md
index 3d8d740..f1c6db6 100644
--- a/examples/camel-example-cdi-osgi/README.md
+++ b/examples/camel-example-cdi-osgi/README.md
@@ -193,7 +193,7 @@ shutdown:
### Forum, Help, etc
If you hit an problems please let us know on the Camel Forums
- <http://camel.apache.org/discussion-forums.html>
+<http://camel.apache.org/discussion-forums.html>
Please help us make Apache Camel better - we appreciate any feedback you may have. Enjoy!
http://git-wip-us.apache.org/repos/asf/camel/blob/b7e661f1/examples/camel-example-cdi-properties/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-properties/README.md b/examples/camel-example-cdi-properties/README.md
index 8099292..2eb2328 100644
--- a/examples/camel-example-cdi-properties/README.md
+++ b/examples/camel-example-cdi-properties/README.md
@@ -21,13 +21,17 @@ though you can run the application in any CDI compliant container.
You will need to build this example first:
- mvn install
+```sh
+$ mvn install
+```
### Run
You can run this example using:
- mvn compile camel:run
+```sh
+$ mvn compile camel:run
+```
When the Camel application runs, you should see the following messages
being logged to the console, e.g.:
@@ -46,7 +50,7 @@ The Camel application can be stopped pressing <kbd>ctrl</kbd>+<kbd>c</kbd> in th
### Forum, Help, etc
If you hit an problems please let us know on the Camel Forums
- <http://camel.apache.org/discussion-forums.html>
+<http://camel.apache.org/discussion-forums.html>
Please help us make Apache Camel better - we appreciate any feedback you may have. Enjoy!
http://git-wip-us.apache.org/repos/asf/camel/blob/b7e661f1/examples/camel-example-cdi-rest-servlet/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-rest-servlet/README.md b/examples/camel-example-cdi-rest-servlet/README.md
index 9355282..e3211dd 100644
--- a/examples/camel-example-cdi-rest-servlet/README.md
+++ b/examples/camel-example-cdi-rest-servlet/README.md
@@ -19,13 +19,17 @@ in any CDI compliant container and Servlet container.
You can build this example using:
- mvn package
+```sh
+$ mvn package
+```
### Run
You can run this example using:
- mvn jetty:run
+```sh
+$ mvn jetty:run
+```
When the Camel application runs, you should see the following messages
being logged to the console, e.g.:
@@ -72,7 +76,7 @@ The Camel application can be stopped pressing <kbd>ctrl</kbd>+<kbd>c</kbd> in th
### Forum, Help, etc
If you hit an problems please let us know on the Camel Forums
- <http://camel.apache.org/discussion-forums.html>
+<http://camel.apache.org/discussion-forums.html>
Please help us make Apache Camel better - we appreciate any feedback you may have. Enjoy!
http://git-wip-us.apache.org/repos/asf/camel/blob/b7e661f1/examples/camel-example-cdi/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi/README.md b/examples/camel-example-cdi/README.md
index e1e0ed8..da83e75 100644
--- a/examples/camel-example-cdi/README.md
+++ b/examples/camel-example-cdi/README.md
@@ -5,35 +5,39 @@
This example shows how to work with Camel using CDI to configure components,
endpoints and beans.
-A timer triggers a Camel route to run every 5th second which creates a message that is logged to the console.
+A timer triggers a Camel route to run every 5th second which creates a message
+that is logged to the console.
### Build
You will need to compile this example first:
-
- mvn compile
+
+```sh
+$ mvn compile
+```
### Run
-To run the example type
-
- mvn camel:run
-
+To run the example, type:
+
+```sh
+$ mvn camel:run
+```
+
You can see the routing rules by looking at the java code in the
- `src/main/java` directory
+`src/main/java` directory.
- To stop the example hit <kbd>ctrl</kbd>+<kbd>c</kbd>
-
-When we launch the example using the camel maven plugin, a local CDI container
+To stop the example hit <kbd>ctrl</kbd>+<kbd>c</kbd>.
+
+When we launch the example using the Camel Maven plugin, a standalone CDI container
is created and started.
### Forum, Help, etc
If you hit an problems please let us know on the Camel Forums
- <http://camel.apache.org/discussion-forums.html>
+<http://camel.apache.org/discussion-forums.html>
Please help us make Apache Camel better - we appreciate any feedback you may
-have. Enjoy!
-
+have. Enjoy!
The Camel riders!
[2/6] camel git commit: CAMEL-9201: Consistent style for qualifier
literals
Posted by da...@apache.org.
CAMEL-9201: Consistent style for qualifier literals
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/64cbbf00
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/64cbbf00
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/64cbbf00
Branch: refs/heads/master
Commit: 64cbbf00fd8fec123f7404a8c4a2924b02884d4a
Parents: 93631c8
Author: Antonin Stefanutti <an...@stefanutti.fr>
Authored: Tue Feb 23 12:40:35 2016 +0100
Committer: Antonin Stefanutti <an...@stefanutti.fr>
Committed: Tue Feb 23 12:48:23 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/cdi/CdiCamelBeanPostProcessor.java | 2 +-
.../src/main/java/org/apache/camel/cdi/ContextName.java | 6 +++++-
.../apache/camel/cdi/test/MultiContextEventEndpointTest.java | 6 +++---
.../src/test/java/org/apache/camel/itest/cdi/CamelCdiTest.java | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/64cbbf00/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelBeanPostProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelBeanPostProcessor.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelBeanPostProcessor.java
index 85284fc..7d1a1b8 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelBeanPostProcessor.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelBeanPostProcessor.java
@@ -110,7 +110,7 @@ final class CdiCamelBeanPostProcessor extends DefaultCamelBeanPostProcessor {
private CamelContext getOrLookupCamelContext(String contextName) {
// TODO: proper support for custom context qualifiers
- return BeanManagerHelper.getReferenceByType(manager, CamelContext.class, contextName.isEmpty() ? DefaultLiteral.INSTANCE : new ContextName.Literal(contextName));
+ return BeanManagerHelper.getReferenceByType(manager, CamelContext.class, contextName.isEmpty() ? DefaultLiteral.INSTANCE : ContextName.Literal.of(contextName));
}
@Override
http://git-wip-us.apache.org/repos/asf/camel/blob/64cbbf00/components/camel-cdi/src/main/java/org/apache/camel/cdi/ContextName.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/ContextName.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/ContextName.java
index 2006e71..1ca4e1f 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/ContextName.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/ContextName.java
@@ -79,10 +79,14 @@ public @interface ContextName {
private final String name;
- public Literal(String name) {
+ private Literal(String name) {
this.name = name;
}
+ public static Literal of(String name) {
+ return new Literal(name);
+ }
+
@Override
public String value() {
return name;
http://git-wip-us.apache.org/repos/asf/camel/blob/64cbbf00/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventEndpointTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventEndpointTest.java b/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventEndpointTest.java
index c6b51af..af54917 100644
--- a/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventEndpointTest.java
+++ b/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/MultiContextEventEndpointTest.java
@@ -113,9 +113,9 @@ public class MultiContextEventEndpointTest {
secondConsumeString.expectedMessageCount(2);
secondConsumeString.expectedBodiesReceived("testSecond1", "testSecond2");
- objectEvent.select(String.class, new ContextName.Literal("first")).fire("testFirst");
- objectEvent.select(String.class, new ContextName.Literal("second")).fire("testSecond1");
- objectEvent.select(String.class, new ContextName.Literal("second")).fire("testSecond2");
+ objectEvent.select(String.class, ContextName.Literal.of("first")).fire("testFirst");
+ objectEvent.select(String.class, ContextName.Literal.of("second")).fire("testSecond1");
+ objectEvent.select(String.class, ContextName.Literal.of("second")).fire("testSecond2");
assertIsSatisfied(2L, TimeUnit.SECONDS, firstConsumeString, secondConsumeString);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/64cbbf00/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/CamelCdiTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/CamelCdiTest.java b/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/CamelCdiTest.java
index bee1905..39aa971 100644
--- a/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/CamelCdiTest.java
+++ b/tests/camel-itest-cdi/src/test/java/org/apache/camel/itest/cdi/CamelCdiTest.java
@@ -142,7 +142,7 @@ public class CamelCdiTest {
}
protected CamelContext assertCamelContext(String contextName) {
- CamelContext answer = camelContexts.select(new ContextName.Literal(contextName)).get();
+ CamelContext answer = camelContexts.select(ContextName.Literal.of(contextName)).get();
assertTrue("CamelContext '" + contextName + "' is not started", answer.getStatus().isStarted());
return answer;
}
[3/6] camel git commit: Fix Maven warning
Posted by da...@apache.org.
Fix Maven warning
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a0379715
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a0379715
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a0379715
Branch: refs/heads/master
Commit: a03797159af6e3d376a1e384036c9f90098c29b6
Parents: 64cbbf0
Author: Antonin Stefanutti <an...@stefanutti.fr>
Authored: Tue Feb 23 12:43:45 2016 +0100
Committer: Antonin Stefanutti <an...@stefanutti.fr>
Committed: Tue Feb 23 12:48:24 2016 +0100
----------------------------------------------------------------------
examples/camel-example-cdi-osgi/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/a0379715/examples/camel-example-cdi-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-cdi-osgi/pom.xml b/examples/camel-example-cdi-osgi/pom.xml
index 890ae7e..706b0b2 100755
--- a/examples/camel-example-cdi-osgi/pom.xml
+++ b/examples/camel-example-cdi-osgi/pom.xml
@@ -227,7 +227,7 @@
<build>
<!-- Easier to get the local artifact from the integration tests -->
- <finalName>${artifactId}</finalName>
+ <finalName>${project.artifactId}</finalName>
<plugins>