[4/4] git commit: Upgarded pax-exam version of camel-itest-karaf to 3.4.0
Upgarded pax-exam version of camel-itest-karaf to 3.4.0 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fe438ef7 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fe438ef7 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fe438ef7 Branch: refs/heads/master Commit: fe438ef79b601424b7bec444629662db79b94754 Parents: b70c418 Author: Willem Jiang willem.ji...@gmail.com Authored: Tue Aug 26 10:11:08 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Tue Aug 26 14:08:13 2014 +0800 -- tests/camel-itest-karaf/pom.xml | 12 +- .../camel/itest/karaf/AbstractFeatureTest.java | 25 +--- .../apache/camel/itest/karaf/CamelAhcTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelAmqpTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelApnsTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelAtomTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelAvroTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelAwsTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelBamTest.java | 6 ++--- .../camel/itest/karaf/CamelBase64Test.java | 6 ++--- .../itest/karaf/CamelBeanValidatorTest.java | 6 ++--- .../camel/itest/karaf/CamelBeanioTest.java | 6 ++--- .../camel/itest/karaf/CamelBindyTest.java | 6 ++--- .../camel/itest/karaf/CamelCacheTest.java | 6 ++--- .../camel/itest/karaf/CamelCastorTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelCmisTest.java | 6 ++--- .../camel/itest/karaf/CamelCometdTest.java | 6 ++--- .../camel/itest/karaf/CamelContextTest.java | 6 ++--- .../camel/itest/karaf/CamelCouchDBTest.java | 6 ++--- .../camel/itest/karaf/CamelCryptoTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelCsvTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelCxfTest.java | 6 ++--- .../camel/itest/karaf/CamelDisruptorTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelDnsTest.java | 6 ++--- .../camel/itest/karaf/CamelDropboxTest.java | 6 ++--- .../itest/karaf/CamelElasticsearchTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelExecTest.java | 6 ++--- .../camel/itest/karaf/CamelFacebookTest.java| 6 ++--- .../camel/itest/karaf/CamelFlatpackTest.java| 6 ++--- .../apache/camel/itest/karaf/CamelFopTest.java | 6 ++--- .../camel/itest/karaf/CamelFreemarkerTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelFtpTest.java | 6 ++--- .../camel/itest/karaf/CamelGeocoderTest.java| 6 ++--- .../camel/itest/karaf/CamelGroovyTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelGsonTest.java | 6 ++--- .../itest/karaf/CamelGuavaEventBusTest.java | 6 ++--- .../camel/itest/karaf/CamelGuiceTest.java | 6 ++--- .../camel/itest/karaf/CamelHazelcastTest.java | 6 ++--- .../camel/itest/karaf/CamelHbaseTest.java | 6 ++--- .../camel/itest/karaf/CamelHdfs2Test.java | 6 ++--- .../apache/camel/itest/karaf/CamelHdfsTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelHl7Test.java | 6 ++--- .../camel/itest/karaf/CamelHttp4Test.java | 6 ++--- .../apache/camel/itest/karaf/CamelHttpTest.java | 6 ++--- .../camel/itest/karaf/CamelIbatisTest.java | 6 ++--- .../camel/itest/karaf/CamelInfinispanTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelIrcTest.java | 6 ++--- .../camel/itest/karaf/CamelJacksonTest.java | 6 ++--- .../camel/itest/karaf/CamelJasyptTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelJaxbTest.java | 6 ++--- .../camel/itest/karaf/CamelJcloudsTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelJcrTest.java | 6 ++--- .../itest/karaf/CamelJdbcAggregatorTest.java| 6 ++--- .../apache/camel/itest/karaf/CamelJdbcTest.java | 6 ++--- .../camel/itest/karaf/CamelJettyTest.java | 6 ++--- .../camel/itest/karaf/CamelJgroupsTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelJibxTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelJingTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelJmsTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelJmxTest.java | 6 ++--- .../camel/itest/karaf/CamelJosqlTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelJpaTest.java | 6 ++--- .../camel/itest/karaf/CamelJsonpathTest.java| 6 ++--- .../camel/itest/karaf/CamelJt400Test.java | 6 ++--- .../apache/camel/itest/karaf/CamelJuelTest.java | 6 ++--- .../camel/itest/karaf/CamelJxpathTest.java | 6 ++--- .../camel/itest/karaf/CamelKafkaTest.java | 6 ++--- .../camel/itest/karaf/CamelKratiTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelLdapTest.java | 6 ++--- .../camel/itest/karaf/CamelLuceneTest.java | 6 ++--- .../apache/camel/itest/karaf/CamelMailTest.java | 6 ++--- .../camel/itest/karaf/CamelMetricsTest.java | 6 ++---
[3/4] Upgarded pax-exam version of camel-itest-karaf to 3.4.0
http://git-wip-us.apache.org/repos/asf/camel/blob/fe438ef7/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJxpathTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJxpathTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJxpathTest.java index 6794fd3..e70a0d5 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJxpathTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJxpathTest.java @@ -19,10 +19,10 @@ package org.apache.camel.itest.karaf; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.Configuration; -import org.ops4j.pax.exam.junit.JUnit4TestRunner; +import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.junit.PaxExam; -@RunWith(JUnit4TestRunner.class) +@RunWith(PaxExam.class) public class CamelJxpathTest extends AbstractFeatureTest { public static final String COMPONENT = extractName(CamelJxpathTest.class); http://git-wip-us.apache.org/repos/asf/camel/blob/fe438ef7/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKafkaTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKafkaTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKafkaTest.java index d0e7587..0f6cf0f 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKafkaTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKafkaTest.java @@ -19,10 +19,10 @@ package org.apache.camel.itest.karaf; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.Configuration; -import org.ops4j.pax.exam.junit.JUnit4TestRunner; +import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.junit.PaxExam; -@RunWith(JUnit4TestRunner.class) +@RunWith(PaxExam.class) public class CamelKafkaTest extends AbstractFeatureTest { public static final String COMPONENT = extractName(CamelKafkaTest.class); http://git-wip-us.apache.org/repos/asf/camel/blob/fe438ef7/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKratiTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKratiTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKratiTest.java index 582b9c9..cd602fc 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKratiTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelKratiTest.java @@ -19,10 +19,10 @@ package org.apache.camel.itest.karaf; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.Configuration; -import org.ops4j.pax.exam.junit.JUnit4TestRunner; +import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.junit.PaxExam; -@RunWith(JUnit4TestRunner.class) +@RunWith(PaxExam.class) public class CamelKratiTest extends AbstractFeatureTest { public static final String COMPONENT = extractName(CamelKratiTest.class); http://git-wip-us.apache.org/repos/asf/camel/blob/fe438ef7/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelLdapTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelLdapTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelLdapTest.java index a381e18..eea6c99 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelLdapTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelLdapTest.java @@ -19,10 +19,10 @@ package org.apache.camel.itest.karaf; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.Configuration; -import org.ops4j.pax.exam.junit.JUnit4TestRunner; +import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.junit.PaxExam; -@RunWith(JUnit4TestRunner.class) +@RunWith(PaxExam.class) public class CamelLdapTest extends AbstractFeatureTest { public static final String COMPONENT = extractName(CamelLdapTest.class); http://git-wip-us.apache.org/repos/asf/camel/blob/fe438ef7/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelLuceneTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelLuceneTest.java
[2/4] git commit: CAMEL-7615 Enabled the test of CxfRsBlueprintRouterTest
CAMEL-7615 Enabled the test of CxfRsBlueprintRouterTest Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e65f67e3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e65f67e3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e65f67e3 Branch: refs/heads/master Commit: e65f67e34905a01ffae7664d81f728d8a7bb9b4f Parents: fe438ef Author: Willem Jiang willem.ji...@gmail.com Authored: Tue Aug 26 14:05:57 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Tue Aug 26 14:08:13 2014 +0800 -- tests/camel-itest-osgi/pom.xml | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e65f67e3/tests/camel-itest-osgi/pom.xml -- diff --git a/tests/camel-itest-osgi/pom.xml b/tests/camel-itest-osgi/pom.xml index ca89992..a6dc6c4 100644 --- a/tests/camel-itest-osgi/pom.xml +++ b/tests/camel-itest-osgi/pom.xml @@ -267,7 +267,7 @@ /dependency dependency groupIdorg.springframework/groupId - artifactIdspring-context-support/artifactId + artifactIdspring-context-support/artifactId scopetest/scope /dependency dependency @@ -300,12 +300,12 @@ /dependency dependency groupIdorg.apache.camel/groupId - artifactIdcamel-mail/artifactId + artifactIdcamel-mail/artifactId scopetest/scope /dependency dependency groupIdorg.apache.camel/groupId - artifactIdcamel-test/artifactId + artifactIdcamel-test/artifactId scopetest/scope /dependency dependency @@ -375,19 +375,19 @@ artifactIdcxf-rt-rs-extension-providers/artifactId version${cxf-version}/version scopetest/scope - /dependency + /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-transports-http-jetty/artifactId version${cxf-version}/version scopetest/scope - /dependency + /dependency dependency - groupIdorg.apache.cxf/groupId + groupIdorg.apache.cxf/goupId artifactIdcxf-rt-ws-security/artifactId version${cxf-version}/version scopetest/scope - /dependency + /dependency dependency groupIdorg.codehaus.jettison/groupId artifactIdjettison/artifactId @@ -486,7 +486,6 @@ excludes exclude**/FIXMETest.*/exclude exclude**/FtpConsumeTest.*/exclude - exclude**/CxfRsBlueprintRouterTest.*/exclude exclude**/BlobStoreRouteTest.*/exclude !-- CAMEL-6134 -- exclude**/BlobStoreBlueprintRouteTest.*/exclude !-- CAMEL-6134 -- /excludes @@ -494,7 +493,7 @@ karafVersion${karaf-version}/karafVersion /systemPropertyVariables /configuration - /plugin + /plugin !-- CXF wsdl2java generator, will plugin to the compile goal -- plugin @@ -549,7 +548,7 @@ /plugin /plugins /build - + profiles profile idci-build-profile/id
[1/4] git commit: Fixed the mvn test error of camel-itest-karaf
Repository: camel Updated Branches: refs/heads/master b70c4189c - 9863ac9e4 Fixed the mvn test error of camel-itest-karaf Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9863ac9e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9863ac9e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9863ac9e Branch: refs/heads/master Commit: 9863ac9e42640bbc6448ab9763643093a7ffb4ee Parents: e65f67e Author: Willem Jiang willem.ji...@gmail.com Authored: Tue Aug 26 14:07:50 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Tue Aug 26 14:08:13 2014 +0800 -- tests/camel-itest-karaf/pom.xml | 2 - .../camel/itest/karaf/AbstractFeatureTest.java | 77 +- .../camel/itest/karaf/org.ops4j.pax.url.mvn.cfg | 103 +++ 3 files changed, 154 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/9863ac9e/tests/camel-itest-karaf/pom.xml -- diff --git a/tests/camel-itest-karaf/pom.xml b/tests/camel-itest-karaf/pom.xml index 9e5e6b4..219ac8c 100644 --- a/tests/camel-itest-karaf/pom.xml +++ b/tests/camel-itest-karaf/pom.xml @@ -163,8 +163,6 @@ artifactIdmaven-surefire-plugin/artifactId configuration forkModepertest/forkMode -redirectTestOutputToFiletrue/redirectTestOutputToFile -argLine-Xmx256m/argLine systemPropertyVariables karafVersion${karaf-version}/karafVersion /systemPropertyVariables http://git-wip-us.apache.org/repos/asf/camel/blob/9863ac9e/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java index 9cd900c..c164b9a 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java @@ -18,12 +18,15 @@ package org.apache.camel.itest.karaf; import java.io.File; +import java.lang.reflect.Field; +import java.nio.charset.Charset; import javax.inject.Inject; import org.apache.camel.CamelContext; import org.apache.camel.impl.DefaultRouteContext; import org.apache.camel.model.DataFormatDefinition; import org.apache.camel.osgi.CamelContextFactory; +import static org.ops4j.pax.exam.CoreOptions.vmOption; import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; import org.ops4j.pax.exam.karaf.options.LogLevelOption; import org.junit.After; @@ -49,10 +52,14 @@ public abstract class AbstractFeatureTest { @Before public void setUp() throws Exception { +LOG.info(Calling the setUp method ); +LOG.info(The BundleContext is + bundleContext); +Thread.sleep(3000); } @After public void tearDown() throws Exception { +LOG.info(Calling the tearDown method ); } protected void testComponent(String component) throws Exception { @@ -114,12 +121,19 @@ public abstract class AbstractFeatureTest { } protected CamelContext createCamelContext() throws Exception { +LOG.info(Creating the CamelContext ...); +setThreadContextClassLoader(); CamelContextFactory factory = new CamelContextFactory(); factory.setBundleContext(bundleContext); LOG.info(Get the bundleContext is + bundleContext); return factory.createContext(); } +protected void setThreadContextClassLoader() { +// set the thread context classloader current bundle classloader + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); +} + public static String extractName(Class? clazz) { String name = clazz.getName(); int id0 = name.indexOf(Camel) + Camel.length(); @@ -139,7 +153,7 @@ public abstract class AbstractFeatureTest { return mavenBundle(). groupId(org.apache.camel.karaf). artifactId(apache-camel). -classifier(features).type(xml).versionAsInProject(); +versionAsInProject().type(xml/features); } public static UrlReference getKarafFeatureUrl() { @@ -151,32 +165,43 @@ public abstract class AbstractFeatureTest { artifactId(standard).version(karafVersion).type(type); } +private static void switchPlatformEncodingToUTF8() { +try { +
git commit: CAMEL-7741 Added karaf3 profile for running itest with karaf3
Repository: camel Updated Branches: refs/heads/master 9863ac9e4 - 2f8bc8045 CAMEL-7741 Added karaf3 profile for running itest with karaf3 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2f8bc804 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2f8bc804 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2f8bc804 Branch: refs/heads/master Commit: 2f8bc804586f41ba346ccb30b1bcf96b5c702c09 Parents: 9863ac9 Author: Willem Jiang willem.ji...@gmail.com Authored: Tue Aug 26 14:41:35 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Tue Aug 26 14:51:54 2014 +0800 -- parent/pom.xml | 1 + tests/camel-itest-karaf/pom.xml | 14 .../camel/itest/karaf/AbstractFeatureTest.java | 13 ++- tests/camel-itest-osgi/pom.xml | 36 ++-- .../itest/osgi/OSGiIntegrationTestSupport.java | 15 +++- 5 files changed, 66 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 8a6293e..6cb99a9 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -269,6 +269,7 @@ kafka-version0.8.1/kafka-version kafka-bundle-version0.8.1_1/kafka-bundle-version karaf-version2.3.6/karaf-version +karaf3-version3.0.1/karaf3-version kie-version6.0.0.Final/kie-version krati-version0.4.9/krati-version kxml2-bundle-version2.3.0_2/kxml2-bundle-version http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/tests/camel-itest-karaf/pom.xml -- diff --git a/tests/camel-itest-karaf/pom.xml b/tests/camel-itest-karaf/pom.xml index 219ac8c..9944170 100644 --- a/tests/camel-itest-karaf/pom.xml +++ b/tests/camel-itest-karaf/pom.xml @@ -66,6 +66,14 @@ groupIdorg.eclipse/groupId artifactIdosgi/artifactId /exclusion +exclusion +groupIdorg.apache.karaf/groupId +artifactIdorg.apache.karaf.client/artifactId +/exclusion +exclusion +groupIdorg.apache.felix/groupId +artifactIdorg.apache.felix.framework/artifactId +/exclusion /exclusions /dependency dependency @@ -200,6 +208,12 @@ /plugins /build /profile +profile +idkaraf3/id +properties +karaf-version${karaf3-version}/karaf-version +/properties +/profile /profiles /project http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java index c164b9a..736b465 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java @@ -176,14 +176,25 @@ public abstract class AbstractFeatureTest { } } +private static String getKarafVersion() { +String karafVersion = System.getProperty(karafVersion); +if (karafVersion == null) { +// setup the default version of it +karafVersion = 2.3.6; +} +return karafVersion; +} + public static Option[] configure(String feature) { switchPlatformEncodingToUTF8(); +String karafVersion = getKarafVersion(); +LOG.info(*** The karaf version is + karafVersion + ***); Option[] options = new Option[]{ KarafDistributionOption.karafDistributionConfiguration() .frameworkUrl(maven().groupId(org.apache.karaf).artifactId(apache-karaf).type(tar.gz).versionAsInProject()) -.karafVersion(2.3.6) +.karafVersion(karafVersion) .name(Apache Karaf) .useDeployFolder(false).unpackDirectory(new File(target/paxexam/unpack/)), http://git-wip-us.apache.org/repos/asf/camel/blob/2f8bc804/tests/camel-itest-osgi/pom.xml -- diff --git a/tests/camel-itest-osgi/pom.xml b/tests/camel-itest-osgi/pom.xml
[CONF] Apache Camel Camel 2.14.0 Release
Claus Ibsen edited the page: Camel 2.14.0 Release ... Timer consumer is now scheduled after CamelContext has started all routes, to ensure other routes is running when timer routes is triggered to run. Netty HTTP now returns HTTP status 404 if resource not found instead of 503. Fixed the MongoDBreadPreferenceoption which used to cause an IllegalArgumentExceptionto be thrown. Fixed issue with Netty producer may leak HashWhealTimer instances when having many producers that are not reused. Fixed issue with Netty consumer should wait for join to complete when joining a multicast group over UDP Improved stability when testing withcamel-test-blueprint component. Netty HTTPnow removes headerFilterStrategy option after resolvingit Fixed POJO aggregating when the parameter type was referring to a type that was class annotated. FixedMyBatisto keep the message body as-is when calling stored procedures, if the procedure returns data as OUT parameters. Fixed Camel Karaf commands to work with multiple CamelContext from the same bundle. Fixed Advice-With to work with transacted routes defined in XML DSL Fixed Advice-With to work with Content Based Router when adding outputs to the when clauses. Fixed Advice-With to honor autoStartup option. FixedOnCompletion to route the completedExchangeeven if it was marked to stop / failed due exception / handled by error handler etc. Fixed using@EndpointInject with ref in RouteBuilderclasses, to enlist the endpoints in JMX during starting CamelContext when using OSGi New Enterprise Integration Patterns ... View Online Like View Changes Stop watching space Manage Notifications This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software
[2/5] git commit: Polished
Polished Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2e43bd6a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2e43bd6a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2e43bd6a Branch: refs/heads/master Commit: 2e43bd6a31ef3583340a1fc174ad91243118d2c2 Parents: 254d60f Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 09:50:45 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 09:56:45 2014 +0200 -- .../org/apache/camel/blueprint/BlueprintCamelContext.java| 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2e43bd6a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java -- diff --git a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java index a379505..5f3b33e 100644 --- a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java +++ b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java @@ -183,13 +183,13 @@ public class BlueprintCamelContext extends DefaultCamelContext implements Servic private void maybeStart() throws Exception { LOG.trace(maybeStart: {}, this); -// allow to regsiter the BluerintCamelContext eager in the OSGi Service Registry, which ex is needed +// allow to register the BluerintCamelContext eager in the OSGi Service Registry, which ex is needed // for unit testing with camel-test-blueprint boolean eager = true.equalsIgnoreCase(System.getProperty(registerBlueprintCamelContextEager)); if (eager) { -for (EventNotifier notifer : getManagementStrategy().getEventNotifiers()) { -if (notifer instanceof OsgiCamelContextPublisher) { -OsgiCamelContextPublisher publisher = (OsgiCamelContextPublisher) notifer; +for (EventNotifier notifier : getManagementStrategy().getEventNotifiers()) { +if (notifier instanceof OsgiCamelContextPublisher) { +OsgiCamelContextPublisher publisher = (OsgiCamelContextPublisher) notifier; publisher.registerCamelContext(this); break; }
[3/5] git commit: Polished
Polished Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/254d60f3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/254d60f3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/254d60f3 Branch: refs/heads/master Commit: 254d60f33ad462eb9ca04cdcf8c4e2d1747d7d0f Parents: 2f8bc80 Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 08:45:49 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 09:56:45 2014 +0200 -- .../org/apache/camel/blueprint/BlueprintPropertiesParser.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/254d60f3/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesParser.java -- diff --git a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesParser.java b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesParser.java index d1bbde6..9c5a3f0 100644 --- a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesParser.java +++ b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesParser.java @@ -155,12 +155,12 @@ public class BlueprintPropertiesParser extends DefaultPropertiesParser { String delegateAnswer = delegate.parseProperty(key, answer != null ? answer : value, properties); if (delegateAnswer != null) { answer = delegateAnswer; -log.debug(delegate property parser parsed the property key:{} as value: {}, key, answer); +log.debug(Delegate property parser parsed the property key: {} as value: {}, key, answer); } } if (answer == null) { -throw new IllegalArgumentException(Cannot parser the property key: + key + with value: + value); +throw new IllegalArgumentException(Property placeholder key: + key + not found); } log.trace(Returning parsed property key: {} as value: {}, key, answer);
[4/5] git commit: CAMEL-7745: EndpointInject using ref should be enlisted in JMX when using OSGi such as blueprint.
CAMEL-7745: EndpointInject using ref should be enlisted in JMX when using OSGi such as blueprint. Conflicts: components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2c1f12dc Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2c1f12dc Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2c1f12dc Branch: refs/heads/camel-2.13.x Commit: 2c1f12dc04d2064fbfadbdd1f08eeaa6e2a17929 Parents: 48567a2 Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 09:51:40 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 09:58:04 2014 +0200 -- .../java/org/apache/camel/CamelContext.java | 23 .../apache/camel/impl/DefaultCamelContext.java | 14 .../DefaultManagementLifecycleStrategy.java | 5 + .../xml/AbstractCamelContextFactoryBean.java| 6 + 4 files changed, 48 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2c1f12dc/camel-core/src/main/java/org/apache/camel/CamelContext.java -- diff --git a/camel-core/src/main/java/org/apache/camel/CamelContext.java b/camel-core/src/main/java/org/apache/camel/CamelContext.java index 15c5436..40dd7cd 100644 --- a/camel-core/src/main/java/org/apache/camel/CamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/CamelContext.java @@ -368,6 +368,14 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration { //--- /** + * Method to signal to {@link CamelContext} that the process to initialize setup routes is in progress. + * + * @param done ttfalse/tt to start the process, call again with tttrue/tt to signal its done. + * @see #isSetupRoutes() + */ +void setupRoutes(boolean done); + +/** * Returns a list of the current route definitions * * @return list of the current route definitions @@ -646,6 +654,21 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration { */ boolean isStartingRoutes(); +/** + * Indicates whether current thread is setting up route(s) as part of starting Camel from spring/blueprint. + * p/ + * This can be useful to know by {@link LifecycleStrategy} or the likes, in case + * they need to react differently. + * p/ + * As the startup procedure of {@link CamelContext} is slightly different when using plain Java versus + * Spring or Blueprint, then we need to know when Spring/Blueprint is setting up the routes, which + * can happen after the {@link CamelContext} itself is in started state, due the asynchronous event nature + * of especially Blueprint. + * + * @return tttrue/tt if current thread is setting up route(s), or ttfalse/tt if not. + */ +boolean isSetupRoutes(); + // Properties //--- http://git-wip-us.apache.org/repos/asf/camel/blob/2c1f12dc/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java -- diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java index e38bc71..deec2e9 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java @@ -178,6 +178,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon private volatile boolean firstStartDone; private volatile boolean doNotStartRoutesOnFirstStart; private final ThreadLocalBoolean isStartingRoutes = new ThreadLocalBoolean(); +private final ThreadLocalBoolean isSetupRoutes = new ThreadLocalBoolean(); private Boolean autoStartup = Boolean.TRUE; private Boolean trace = Boolean.FALSE; private Boolean messageHistory = Boolean.TRUE; @@ -792,6 +793,11 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon return answer != null answer; } +public boolean isSetupRoutes() { +Boolean answer = isSetupRoutes.get(); +return answer != null answer; +} + public void stopRoute(RouteDefinition route) throws Exception { stopRoute(route.idOrCreate(nodeIdFactory)); } @@ -1389,6 +1395,14 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon this.lifecycleStrategies.add(lifecycleStrategy); } +public void
[5/5] git commit: CAMEL-7745: EndpointInject using ref should be enlisted in JMX when using OSGi such as blueprint.
CAMEL-7745: EndpointInject using ref should be enlisted in JMX when using OSGi such as blueprint. Conflicts: components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6f3b86cf Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6f3b86cf Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6f3b86cf Branch: refs/heads/camel-2.12.x Commit: 6f3b86cf8217277edd94cff473e3c747a33b39bc Parents: f341506 Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 09:51:40 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 09:58:34 2014 +0200 -- .../java/org/apache/camel/CamelContext.java | 23 .../apache/camel/impl/DefaultCamelContext.java | 14 .../DefaultManagementLifecycleStrategy.java | 5 + .../xml/AbstractCamelContextFactoryBean.java| 6 + 4 files changed, 48 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6f3b86cf/camel-core/src/main/java/org/apache/camel/CamelContext.java -- diff --git a/camel-core/src/main/java/org/apache/camel/CamelContext.java b/camel-core/src/main/java/org/apache/camel/CamelContext.java index 319e3a0..56aebd6 100644 --- a/camel-core/src/main/java/org/apache/camel/CamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/CamelContext.java @@ -367,6 +367,14 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration { //--- /** + * Method to signal to {@link CamelContext} that the process to initialize setup routes is in progress. + * + * @param done ttfalse/tt to start the process, call again with tttrue/tt to signal its done. + * @see #isSetupRoutes() + */ +void setupRoutes(boolean done); + +/** * Returns a list of the current route definitions * * @return list of the current route definitions @@ -645,6 +653,21 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration { */ boolean isStartingRoutes(); +/** + * Indicates whether current thread is setting up route(s) as part of starting Camel from spring/blueprint. + * p/ + * This can be useful to know by {@link LifecycleStrategy} or the likes, in case + * they need to react differently. + * p/ + * As the startup procedure of {@link CamelContext} is slightly different when using plain Java versus + * Spring or Blueprint, then we need to know when Spring/Blueprint is setting up the routes, which + * can happen after the {@link CamelContext} itself is in started state, due the asynchronous event nature + * of especially Blueprint. + * + * @return tttrue/tt if current thread is setting up route(s), or ttfalse/tt if not. + */ +boolean isSetupRoutes(); + // Properties //--- http://git-wip-us.apache.org/repos/asf/camel/blob/6f3b86cf/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java -- diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java index bbb8bde..0f2f3a9 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java @@ -176,6 +176,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon private volatile boolean firstStartDone; private volatile boolean doNotStartRoutesOnFirstStart; private final ThreadLocalBoolean isStartingRoutes = new ThreadLocalBoolean(); +private final ThreadLocalBoolean isSetupRoutes = new ThreadLocalBoolean(); private Boolean autoStartup = Boolean.TRUE; private Boolean trace = Boolean.FALSE; private Boolean messageHistory = Boolean.TRUE; @@ -790,6 +791,11 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon return answer != null answer; } +public boolean isSetupRoutes() { +Boolean answer = isSetupRoutes.get(); +return answer != null answer; +} + public void stopRoute(RouteDefinition route) throws Exception { stopRoute(route.idOrCreate(nodeIdFactory)); } @@ -1294,6 +1300,14 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon this.lifecycleStrategies.add(lifecycleStrategy); } +public void
[1/5] git commit: CAMEL-7745: EndpointInject using ref should be enlisted in JMX when using OSGi such as blueprint.
Repository: camel Updated Branches: refs/heads/camel-2.12.x f341506ea - 6f3b86cf8 refs/heads/camel-2.13.x 48567a23d - 2c1f12dc0 refs/heads/master 2f8bc8045 - e1f9e26e6 CAMEL-7745: EndpointInject using ref should be enlisted in JMX when using OSGi such as blueprint. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e1f9e26e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e1f9e26e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e1f9e26e Branch: refs/heads/master Commit: e1f9e26e6aaf9f92e93f5851bf7189f01e819aa0 Parents: 2e43bd6 Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 09:51:40 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 09:56:45 2014 +0200 -- .../java/org/apache/camel/CamelContext.java | 23 .../apache/camel/impl/DefaultCamelContext.java | 14 .../DefaultManagementLifecycleStrategy.java | 5 + .../xml/AbstractCamelContextFactoryBean.java| 6 + 4 files changed, 48 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e1f9e26e/camel-core/src/main/java/org/apache/camel/CamelContext.java -- diff --git a/camel-core/src/main/java/org/apache/camel/CamelContext.java b/camel-core/src/main/java/org/apache/camel/CamelContext.java index ae31c51..23ba36d 100644 --- a/camel-core/src/main/java/org/apache/camel/CamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/CamelContext.java @@ -397,6 +397,14 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration { //--- /** + * Method to signal to {@link CamelContext} that the process to initialize setup routes is in progress. + * + * @param done ttfalse/tt to start the process, call again with tttrue/tt to signal its done. + * @see #isSetupRoutes() + */ +void setupRoutes(boolean done); + +/** * Returns a list of the current route definitions * * @return list of the current route definitions @@ -707,6 +715,21 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration { */ boolean isStartingRoutes(); +/** + * Indicates whether current thread is setting up route(s) as part of starting Camel from spring/blueprint. + * p/ + * This can be useful to know by {@link LifecycleStrategy} or the likes, in case + * they need to react differently. + * p/ + * As the startup procedure of {@link CamelContext} is slightly different when using plain Java versus + * Spring or Blueprint, then we need to know when Spring/Blueprint is setting up the routes, which + * can happen after the {@link CamelContext} itself is in started state, due the asynchronous event nature + * of especially Blueprint. + * + * @return tttrue/tt if current thread is setting up route(s), or ttfalse/tt if not. + */ +boolean isSetupRoutes(); + // Properties //--- http://git-wip-us.apache.org/repos/asf/camel/blob/e1f9e26e/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java -- diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java index abf0c9a..666ee4a 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java +++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java @@ -186,6 +186,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon private volatile boolean firstStartDone; private volatile boolean doNotStartRoutesOnFirstStart; private final ThreadLocalBoolean isStartingRoutes = new ThreadLocalBoolean(); +private final ThreadLocalBoolean isSetupRoutes = new ThreadLocalBoolean(); private Boolean autoStartup = Boolean.TRUE; private Boolean trace = Boolean.FALSE; private Boolean messageHistory = Boolean.TRUE; @@ -803,6 +804,11 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon return answer != null answer; } +public boolean isSetupRoutes() { +Boolean answer = isSetupRoutes.get(); +return answer != null answer; +} + public void stopRoute(RouteDefinition route) throws Exception { stopRoute(route.idOrCreate(nodeIdFactory)); } @@ -1423,6 +1429,14 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
svn commit: r920438 - in /websites/production/camel/content: cache/main.pageCache camel-2140-release.html
Author: buildbot Date: Tue Aug 26 08:18:24 2014 New Revision: 920438 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2140-release.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-2140-release.html == --- websites/production/camel/content/camel-2140-release.html (original) +++ websites/production/camel/content/camel-2140-release.html Tue Aug 26 08:18:24 2014 @@ -84,7 +84,7 @@ tbody tr td valign=top width=100% -div class=wiki-content maincontenth1 id=Camel2.14.0Release-Camel2.14.0release(currentlyinprogress)Camel 2.14.0 release (currently in progress)/h1div style=padding-right:20px;float:left;margin-left:-20px;pimg class=confluence-embedded-image confluence-external-resource src=http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; data-image-src=http://camel.apache.org/download.data/camel-box-v1.0-150x200.png;/p/divdiv style=min-height:200px#160;/divh2 id=Camel2.14.0Release-NewandNoteworthyNew and Noteworthy/h2pWelcome to the 2.14.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)/pulliSupport for running on Java 1.8 JVMs/liliSpring 4.x supported./lilia shape=rect href=rest-dsl.htmlREST DSL/a to define REST services using a REST style with verbs such as get/post/put/delete etc. The Rest DSL supports Java and XML DSL./lilia shape=rect href=rest-dsl.htmlREST DSL /a integrated with a shape=rect href=swagger.htmlSwagger/a to expose the service as swagger apis./liliSimple language defined in routes using resultType as boolean is now evaluated as predicate instead of as expression./liliIntroduced RuntimeEndpointRegistry to capture runtime usage of endpoints in use during routing, such as dynamic endpoints from dynamic a shape=rect href=eip.htmlEIP/as./liliAdded event notification for routes added and removed./liliAllow to configure cache size in Recipient List, Routing Slip and Dynamic Router EIPs; and as well turn caching off./lilia shape=rect href=netty-http.htmlNetty HTTP/a#160;producer now supports the spanCamelHttpPath header to define a dynamic context-path and query parameters to call the remote http server./span/lilispana shape=rect href=polling-consumer.htmlPolling Consumer/a#160;allows to configure initial queue size and whether to block when full when using the default #160;codeEventDrivenPollingConsumer/code which most components does. We now block by default, as otherwise the message may be lost if the queue was full, and a new message was offered./span/lilispana shape=rect class=external-link href=https://issues.apache.org/jira/browse/CAMEL-7435;Added/a a generic callback to configure the a shape=rect href=apns.htmlAPNS/a service builder./span/lilispanAdded#160;codeStreamList/code option to the#160;a shape=rect href=jdbc.htmlJDBC/a component/span/liliAllow to define Simple expressions for sql parameters of the a shape=rect href=sql-component.htmlSQL/a component.spanbr clear=none/span/liliA new XML tokenizer that is truly XML-aware (e.g., supporting XML namespaces and complex hierarchical structures)/liliAdded option#160;codeparallelAggregate/code to a shape=rect href=multicast.htmlMulticast/a, a shape=rect href=splitter.htmlSplitter/a and a s hape=rect href=recipient-list.htmlRecipient List/a#160;EIPs/liliSupport to set the variable map from message header in a shape=rect href=velocity.htmlVelocity/a, a shape=rect href=freemarker.htmlFreemarker/a, a shape=rect href=stringtemplate.htmlStringTemplate/a./lilispanAdded HazelcastInstance option to#160;spana shape=rect href=hazelcast-component.htmlHazelcast/a component./span/span/liliProducers from static a shape=rect href=eip.htmlEIPs/a such as lt;togt; is is now also enlisted in a shape=rect href=camel-jmx.htmlJMX/a when Camel is starting routes./liliUnmarshal json to pojo using#160;codecamel-jackson/code now supports a header to tell Camel what the pojo class name is, to allow more dynamic behavior, as otherwise the class name would be hardcoded./liliAlso allow to configure#160;codecamel-jackson/code to skip null values, by setting includes to#160;codeNOT_NULL/code./lili And#160;codecamel-jackson/code can now easily be configured to unmarshal to a#160;codeListlt;pojogt;/code#160;or codeListlt;Mapgt;/code#160;instead of either a single pojo or#160;codeMap/code type.#160;/liliIntroduced#160;codeSynchronizationRouteAware/code allowing to have callbacks before/after an Exchange is being routed. This allows to trigger custom code at these points, for example after a route, but before a Consumer writes any response back to a caller
git commit: CAMEL-7742: Add rounding, decimal, grouping attributes for @DateField, add unit tests
Repository: camel Updated Branches: refs/heads/master e1f9e26e6 - 2854e18ff CAMEL-7742: Add rounding, decimal, grouping attributes for @DateField, add unit tests Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2854e18f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2854e18f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2854e18f Branch: refs/heads/master Commit: 2854e18ff985ffb9abaca305038801f6c508f0c4 Parents: e1f9e26 Author: Charles Moulliard ch0...@gmail.com Authored: Tue Aug 26 10:34:12 2014 +0200 Committer: Charles Moulliard ch0...@gmail.com Committed: Tue Aug 26 10:34:12 2014 +0200 -- .../camel/dataformat/bindy/FormatFactory.java | 38 +++ .../dataformat/bindy/annotation/DataField.java | 21 .../bindy/format/BigDecimalPatternFormat.java | 34 ++ .../bindy/format/NumberPatternFormat.java | 52 - .../bindy/number/BindyFormatUnmarshallTest.java | 105 --- .../BindyBigDecimalGroupingUnmarshallTest.java | 93 .../BindyBigDecimalRoundingUnmarshallTest.java | 89 7 files changed, 303 insertions(+), 129 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2854e18f/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormatFactory.java -- diff --git a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormatFactory.java b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormatFactory.java index d5dc68b..794aace 100755 --- a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormatFactory.java +++ b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormatFactory.java @@ -24,25 +24,7 @@ import java.util.Locale; import org.apache.camel.dataformat.bindy.annotation.DataField; import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField; -import org.apache.camel.dataformat.bindy.format.BigDecimalFormat; -import org.apache.camel.dataformat.bindy.format.BigIntegerFormat; -import org.apache.camel.dataformat.bindy.format.BooleanFormat; -import org.apache.camel.dataformat.bindy.format.ByteFormat; -import org.apache.camel.dataformat.bindy.format.BytePatternFormat; -import org.apache.camel.dataformat.bindy.format.CharacterFormat; -import org.apache.camel.dataformat.bindy.format.DatePatternFormat; -import org.apache.camel.dataformat.bindy.format.DoubleFormat; -import org.apache.camel.dataformat.bindy.format.DoublePatternFormat; -import org.apache.camel.dataformat.bindy.format.EnumFormat; -import org.apache.camel.dataformat.bindy.format.FloatFormat; -import org.apache.camel.dataformat.bindy.format.FloatPatternFormat; -import org.apache.camel.dataformat.bindy.format.IntegerFormat; -import org.apache.camel.dataformat.bindy.format.IntegerPatternFormat; -import org.apache.camel.dataformat.bindy.format.LongFormat; -import org.apache.camel.dataformat.bindy.format.LongPatternFormat; -import org.apache.camel.dataformat.bindy.format.ShortFormat; -import org.apache.camel.dataformat.bindy.format.ShortPatternFormat; -import org.apache.camel.dataformat.bindy.format.StringFormat; +import org.apache.camel.dataformat.bindy.format.*; import org.apache.camel.util.ObjectHelper; @@ -61,13 +43,17 @@ public final class FormatFactory { * @param pattern is the pattern to be used during the formatting of the data * @param locale optional locale for NumberFormat and DateFormat parsing. * @param precision optional scale for BigDecimal parsing. + * @param rounding optional rounding mode to be used to scale BigDecimal with precision value * @param impliedDecimalSeparator optional flag for floating-point values + * @param decimalSeparator optional decimal separator for BigDecimal + * @param groupingSeparator optional grouping separator for BigDecimal * @return Format the formatter * @throws IllegalArgumentException if not suitable formatter is found */ @SuppressWarnings(unchecked) private static Format? doGetFormat(Class? clazz, String pattern, String locale, - String timezone, int precision, boolean impliedDecimalSeparator) + String timezone, int precision, String rounding, + boolean impliedDecimalSeparator, String decimalSeparator, String groupingSeparator) throws Exception { if (clazz == byte.class || clazz == Byte.class) { return ObjectHelper.isNotEmpty(pattern) @@ -94,7 +80,9 @@ public final class FormatFactory { ? new DoublePatternFormat(pattern, getLocale(locale)) : new
[CONF] Apache Camel iBATIS
Claus Ibsen edited the page: iBATIS ... Warning title Prefer MyBatis The Apache iBatis project is no longer active. The project is moved outside Apache and is now know as the MyBatis project.Therefore we encourage users to use MyBatis instead. This camel-ibatis component will be removed in Camel 3.0. iBatis do not support Spring 4.x. So you can only use Spring 3.x or older with iBatis. Maven users will need to add the following dependency to their pom.xml for this component: Code Block xml dependency groupIdorg.apache.camel/groupId artifactIdcamel-ibatis/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency
svn commit: r920441 [1/2] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache ibatis.html
Author: buildbot Date: Tue Aug 26 09:19:04 2014 New Revision: 920441 Log: Production update by buildbot for camel Modified: websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/ibatis.html Modified: websites/production/camel/content/book-component-appendix.html == --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Tue Aug 26 09:19:04 2014 @@ -1529,11 +1529,11 @@ template.send(quot;direct:alias-verify /div /div pThe strongcxf:/strong component provides integration with a shape=rect href=http://cxf.apache.org;Apache CXF/a for connecting to JAX-WS services hosted in CXF./ppstyle type=text/css/*![CDATA[*/ -div.rbtoc1408972730480 {padding: 0px;} -div.rbtoc1408972730480 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1408972730480 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1409044661949 {padding: 0px;} +div.rbtoc1409044661949 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1409044661949 li {margin-left: 0px;padding-left: 0px;} -/*]]*//style/pdiv class=toc-macro rbtoc1408972730480 +/*]]*//style/pdiv class=toc-macro rbtoc1409044661949 ul class=toc-indentationlia shape=rect href=#CXF-CXFComponentCXF Component/a ul class=toc-indentationlia shape=rect href=#CXF-URIformatURI format/a/lilia shape=rect href=#CXF-OptionsOptions/a ul class=toc-indentationlia shape=rect href=#CXF-ThedescriptionsofthedataformatsThe descriptions of the dataformats/a @@ -5470,84 +5470,30 @@ httpComponent.setHttpClientConfigurer(ne ]]/script /div/divpAs long as you implement the HttpClientConfigurer and configure your keystore and truststore as described above, it will work fine./pp/ph3 id=BookComponentAppendix-SeeAlso.22See Also/h3 ullia shape=rect href=configuring-camel.htmlConfiguring Camel/a/lilia shape=rect href=component.htmlComponent/a/lilia shape=rect href=endpoint.htmlEndpoint/a/lilia shape=rect href=getting-started.htmlGetting Started/a/li/ulul class=alternatelia shape=rect href=jetty.htmlJetty/a/li/ul -h2 id=BookComponentAppendix-iBATISiBATIS/h2 - -pThe strongibatis:/strong component allows you to query, poll, insert, update and delete data in a relational database using a shape=rect class=external-link href=http://ibatis.apache.org/;Apache iBATIS/a./p - -div class=aui-message problem shadowed information-macro +h2 id=BookComponentAppendix-iBATISiBATIS/h2pThe strongibatis:/strong component allows you to query, poll, insert, update and delete data in a relational database using a shape=rect class=external-link href=http://ibatis.apache.org/;Apache iBATIS/a./p div class=aui-message problem shadowed information-macro p class=titlePrefer MyBatis/p span class=aui-icon icon-problemIcon/span div class=message-content - -pThe Apache iBatis project is no longer active. The project is moved outside Apache and is now know as the MyBatis project.br clear=none -Therefore we encourage users to use a shape=rect href=mybatis.htmlMyBatis/a instead. This camel-ibatis component will be removed in Camel 3.0./p +pThe Apache iBatis project is no longer active. The project is moved outside Apache and is now know as the MyBatis project.br clear=noneTherefore we encourage users to use a shape=rect href=mybatis.htmlMyBatis/a instead. This camel-ibatis component will be removed in Camel 3.0./ppiBatis do not support Spring 4.x. So you can only use Spring 3.x or older with iBatis./p /div /div - - -pMaven users will need to add the following dependency to their codepom.xml/code for this component:/p -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: xml; gutter: false type=syntaxhighlighter![CDATA[ -lt;dependencygt; +pMaven users will need to add the following dependency to their codepom.xml/code for this component:/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: xml; gutter: false type=syntaxhighlighter![CDATA[lt;dependencygt; lt;groupIdgt;org.apache.camellt;/groupIdgt; lt;artifactIdgt;camel-ibatislt;/artifactIdgt; lt;versiongt;x.x.xlt;/versiongt; lt;!-- use the same version as your Camel core version --gt; lt;/dependencygt; ]]/script -/div/div - -h3 id=BookComponentAppendix-URIformat.27URI format/h3 - -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[ -ibatis:statementName[?options]
svn commit: r920441 [2/2] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache ibatis.html
Modified: websites/production/camel/content/ibatis.html == --- websites/production/camel/content/ibatis.html (original) +++ websites/production/camel/content/ibatis.html Tue Aug 26 09:19:04 2014 @@ -86,84 +86,30 @@ tbody tr td valign=top width=100% -div class=wiki-content maincontenth2 id=iBATIS-iBATISiBATIS/h2 - -pThe strongibatis:/strong component allows you to query, poll, insert, update and delete data in a relational database using a shape=rect class=external-link href=http://ibatis.apache.org/;Apache iBATIS/a./p - -div class=aui-message problem shadowed information-macro +div class=wiki-content maincontenth2 id=iBATIS-iBATISiBATIS/h2pThe strongibatis:/strong component allows you to query, poll, insert, update and delete data in a relational database using a shape=rect class=external-link href=http://ibatis.apache.org/;Apache iBATIS/a./p div class=aui-message problem shadowed information-macro p class=titlePrefer MyBatis/p span class=aui-icon icon-problemIcon/span div class=message-content - -pThe Apache iBatis project is no longer active. The project is moved outside Apache and is now know as the MyBatis project.br clear=none -Therefore we encourage users to use a shape=rect href=mybatis.htmlMyBatis/a instead. This camel-ibatis component will be removed in Camel 3.0./p +pThe Apache iBatis project is no longer active. The project is moved outside Apache and is now know as the MyBatis project.br clear=noneTherefore we encourage users to use a shape=rect href=mybatis.htmlMyBatis/a instead. This camel-ibatis component will be removed in Camel 3.0./ppiBatis do not support Spring 4.x. So you can only use Spring 3.x or older with iBatis./p /div /div - - -pMaven users will need to add the following dependency to their codepom.xml/code for this component:/p -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: xml; gutter: false type=syntaxhighlighter![CDATA[ -lt;dependencygt; +pMaven users will need to add the following dependency to their codepom.xml/code for this component:/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: xml; gutter: false type=syntaxhighlighter![CDATA[lt;dependencygt; lt;groupIdgt;org.apache.camellt;/groupIdgt; lt;artifactIdgt;camel-ibatislt;/artifactIdgt; lt;versiongt;x.x.xlt;/versiongt; lt;!-- use the same version as your Camel core version --gt; lt;/dependencygt; ]]/script -/div/div - -h3 id=iBATIS-URIformatURI format/h3 - -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[ -ibatis:statementName[?options] +/div/divh3 id=iBATIS-URIformatURI format/h3div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[ibatis:statementName[?options] ]]/script -/div/div - -pWhere strongstatementName/strong is the name in the iBATIS XML configuration file which maps to the query, insert, update or delete operation you wish to evaluate./p - -pYou can append query options to the URI in the following format, code?option=valueamp;option=valueamp;.../code/p - -pThis component will by default load the iBatis SqlMapConfig file from the root of the classpath and expected named as codeSqlMapConfig.xml/code.br clear=none -It uses Spring resource loading so you can define it using codeclasspath/code, codefile/code or codehttp/code as prefix to load resources with those schemes.br clear=none -In Camel 2.2 you can configure this on the iBatisComponent with the codesetSqlMapConfig(String)/code method./p - -h3 id=iBATIS-OptionsOptions/h3 -div class=confluenceTableSmall -div class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThp Option /p/thth colspan=1 rowspan=1 class=confluenceThp Type /p/thth colspan=1 rowspan=1 class=confluenceThp Default /p/thth colspan=1 rowspan=1 class=confluenceThp Description /p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdp codeconsumer.onConsume/code /p/tdtd colspan=1 rowspan=1 class=confluenceTdp codeString/code /p/tdtd colspan=1 rowspan=1 class=confluenceTdp codenull/code /p/tdtd colspan=1 rowspan=1 class=confluenceTdp Statements to run after consuming. Can be used, for example, to update rows after they have been consumed and processed in Camel. See sample later. Multiple statements can be separated with comma. /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp codeconsumer.useIterator/code /p/tdtd colspan=1 rowspa n=1 class=confluenceTdp
[CONF] Apache Camel Swagger
Claus Ibsen edited the page: Swagger ... Code Block dependency groupIdorg.apache.camel/groupId artifactIdcamel-swagger/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency Using To use this The Swagger servlet is integrated with Spring orServletListener Component. Component Servlet ClassName spring org.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServlet servletlistener org.apache.camel.component.swagger.servletlistener.ServletListenerRestSwaggerApiDeclarationServlet The servlet support the same options when using spring or servletlistener. When using Spring you need to configure theorg.apache.camel.component.swagger.RestSwaggerApiDeclarationServletspring.SpringRestSwaggerApiDeclarationServletin theWEB-INF/web.xmlfile as shown below: Code Block !-- to setup Camel Swagger api servlet when using Spring -- servlet servlet-nameApiDeclarationServlet/servlet-name servlet-classorg.apache.camel.component.swagger.RestSwaggerApiDeclarationServletspring.SpringRestSwaggerApiDeclarationServlet/servlet-class init-param param-namebase.path/param-name param-valuehttp://localhost:8080/rest/param-value /init-param init-param param-nameapi.path/param-name
[2/2] git commit: CAMEL-7689: camel-swagger has a spring servlet when using spring to lookup CamelContext.
CAMEL-7689: camel-swagger has a spring servlet when using spring to lookup CamelContext. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/374dbd91 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/374dbd91 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/374dbd91 Branch: refs/heads/master Commit: 374dbd913a44cfce2ee1173113dcea6f6951328a Parents: 2854e18 Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 11:41:46 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 11:56:08 2014 +0200 -- components/camel-swagger/pom.xml| 5 +-- .../RestSwaggerApiDeclarationServlet.scala | 28 +--- ...SpringRestSwaggerApiDeclarationServlet.scala | 47 .../src/main/webapp/WEB-INF/web.xml | 3 +- 4 files changed, 63 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/374dbd91/components/camel-swagger/pom.xml -- diff --git a/components/camel-swagger/pom.xml b/components/camel-swagger/pom.xml index 29c945a..f78defa 100644 --- a/components/camel-swagger/pom.xml +++ b/components/camel-swagger/pom.xml @@ -44,12 +44,11 @@ artifactIdcamel-core/artifactId /dependency -!-- - TODO: we should avoid spring dependency and have some plugin/spi - -- +!-- if using spring then the spring-web is assumed to be provided -- dependency groupIdorg.springframework/groupId artifactIdspring-web/artifactId + scopeprovided/scope /dependency dependency http://git-wip-us.apache.org/repos/asf/camel/blob/374dbd91/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala -- diff --git a/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala index 4fa6297..925042f 100644 --- a/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala +++ b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala @@ -19,27 +19,21 @@ package org.apache.camel.component.swagger import javax.servlet.http.{HttpServlet, HttpServletResponse, HttpServletRequest} import javax.servlet.ServletConfig -import com.wordnik.swagger.core.SwaggerContext import com.wordnik.swagger.core.filter.SpecFilter import com.wordnik.swagger.core.util.JsonSerializer import com.wordnik.swagger.config.{SwaggerConfig, ConfigFactory, FilterFactory} import com.wordnik.swagger.model.{ApiInfo, ResourceListing, ApiListingReference} -import org.springframework.web.context.support.WebApplicationContextUtils -import org.springframework.web.context.WebApplicationContext import org.apache.camel.CamelContext import org.slf4j.LoggerFactory /** * A Http Servlet to expose the REST services as Swagger APIs. */ -class RestSwaggerApiDeclarationServlet extends HttpServlet { - - // TODO: this has spring dependency, find a way to make it work with blueprint/spring/cdi/servlet-listener etc +abstract class RestSwaggerApiDeclarationServlet extends HttpServlet { private val LOG = LoggerFactory.getLogger(classOf[RestSwaggerApiDeclarationServlet]) - var spring: WebApplicationContext = null val reader = new RestSwaggerReader() var camel: CamelContext = null val swaggerConfig: SwaggerConfig = ConfigFactory.config @@ -80,18 +74,20 @@ class RestSwaggerApiDeclarationServlet extends HttpServlet { val apiInfo = new ApiInfo(title, description, termsOfServiceUrl, contact, license, licenseUrl) swaggerConfig.setApiInfo(apiInfo) -spring = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext) -if (spring != null) { - camel = spring.getBean(classOf[CamelContext]) - if (camel != null) { -// TODO: if this is not sufficient we need to use Camel's resolveClass API instead - SwaggerContext.registerClassLoader(camel.getApplicationContextClassLoader) - } +camel = lookupCamelContext(config) +if (camel == null) { + LOG.warn(Cannot find CamelContext to be used.) } - -LOG.info(init found spring {}, spring) } + /** + * Used for implementations to lookup the CamelContext to be used. + * + * @param config the servlet config + * @return the CamelContext to use, or ttnull/tt if no CamelContext was found + */ + def lookupCamelContext(config: ServletConfig) : CamelContext + override protected def
[1/2] git commit: CAMEL-7689: camel-swagger has a servletlistener servlet when using that to lookup CamelContext.
Repository: camel Updated Branches: refs/heads/master 2854e18ff - 5094d6006 CAMEL-7689: camel-swagger has a servletlistener servlet when using that to lookup CamelContext. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5094d600 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5094d600 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5094d600 Branch: refs/heads/master Commit: 5094d60061af6b2bb874a4c05e557c3a5c4c5699 Parents: 374dbd9 Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 11:54:57 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 11:56:08 2014 +0200 -- ...stenerRestSwaggerApiDeclarationServlet.scala | 40 1 file changed, 40 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5094d600/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/servletlistener/ServletListenerRestSwaggerApiDeclarationServlet.scala -- diff --git a/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/servletlistener/ServletListenerRestSwaggerApiDeclarationServlet.scala b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/servletlistener/ServletListenerRestSwaggerApiDeclarationServlet.scala new file mode 100644 index 000..56cd25e --- /dev/null +++ b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/servletlistener/ServletListenerRestSwaggerApiDeclarationServlet.scala @@ -0,0 +1,40 @@ +/** + * 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.component.swagger.servletlistener + +import javax.servlet.ServletConfig + +import com.wordnik.swagger.core.SwaggerContext + +import org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet +import org.apache.camel.CamelContext + +/** + * To lookup CamelContext from the a href=http://camel.apache.org/servletlistener-component.html;servletlistener/a component. + */ +class ServletListenerRestSwaggerApiDeclarationServlet extends RestSwaggerApiDeclarationServlet { + + override def lookupCamelContext(config: ServletConfig): CamelContext = { +val obj = config.getServletContext.getAttribute(CamelContext) +if (obj != null) { + camel = obj.asInstanceOf[CamelContext] + SwaggerContext.registerClassLoader(camel.getApplicationContextClassLoader) +} +camel + } + +}
svn commit: r920444 - in /websites/production/camel/content: cache/main.pageCache swagger.html
Author: buildbot Date: Tue Aug 26 10:18:31 2014 New Revision: 920444 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/swagger.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/swagger.html == --- websites/production/camel/content/swagger.html (original) +++ websites/production/camel/content/swagger.html Tue Aug 26 10:18:31 2014 @@ -92,11 +92,11 @@ lt;!-- use the same version as your Camel core version --gt; lt;/dependencygt; ]]/script -/div/divh3 id=Swagger-UsingUsing/h3pTo use this you need to configure the#160;codeorg.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet/code#160;in the#160;codeWEB-INF/web.xml/code#160;file as shown below:/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl -script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[ lt;!-- to setup Camel Swagger api servlet --gt; +/div/divh3 id=Swagger-UsingUsing/h3pThe Swagger servlet is integrated with Spring or#160;a shape=rect href=servletlistener-component.htmlServletListener Component/a.#160;/pdiv class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThComponent/thth colspan=1 rowspan=1 class=confluenceThServlet ClassName/th/trtrtd colspan=1 rowspan=1 class=confluenceTdspring/tdtd colspan=1 rowspan=1 class=confluenceTdcodeorg.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServlet/code#160;/td/trtrtd colspan=1 rowspan=1 class=confluenceTdservletlistener/tdtd colspan=1 rowspan=1 class=confluenceTdcodeorg.apache.camel.component.swagger.servletlistener.ServletListenerRestSwaggerApiDeclarationServlet/code/td/tr/tbody/table/divpThe servlet support the same options when using spring or servletlistener./ppWhen using Spring you nee d to configure the#160;codeorg.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServlet/code#160;in the#160;codeWEB-INF/web.xml/code#160;file as shown below:/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[ lt;!-- to setup Camel Swagger api servlet when using Spring --gt; lt;servletgt; lt;servlet-namegt;ApiDeclarationServletlt;/servlet-namegt; - lt;servlet-classgt;org.apache.camel.component.swagger.RestSwaggerApiDeclarationServletlt;/servlet-classgt; + lt;servlet-classgt;org.apache.camel.component.swagger.spring.SpringRestSwaggerApiDeclarationServletlt;/servlet-classgt; lt;init-paramgt; lt;param-namegt;base.pathlt;/param-namegt; lt;param-valuegt;http://localhost:8080/restlt;/param-valuegt;
git commit: Add test case covering Camel Custom Tracer
Repository: camel Updated Branches: refs/heads/master 5094d6006 - 8c2fa7c56 Add test case covering Camel Custom Tracer Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8c2fa7c5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8c2fa7c5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8c2fa7c5 Branch: refs/heads/master Commit: 8c2fa7c561caaef73338146657096f5be36ef1d8 Parents: 5094d60 Author: Charles Moulliard ch0...@gmail.com Authored: Tue Aug 26 14:20:52 2014 +0200 Committer: Charles Moulliard ch0...@gmail.com Committed: Tue Aug 26 14:20:52 2014 +0200 -- .../osgi/blueprint/BlueprintTracerTest.java | 84 .../camel/itest/osgi/blueprint/blueprint-29.xml | 38 + 2 files changed, 122 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/8c2fa7c5/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java -- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java new file mode 100644 index 000..170faf7 --- /dev/null +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java @@ -0,0 +1,84 @@ +package org.apache.camel.itest.osgi.blueprint; + +import org.apache.camel.CamelContext; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.processor.interceptor.DefaultTraceEventMessage; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.PaxExam; +import org.ops4j.pax.tinybundles.core.TinyBundles; +import org.osgi.framework.Constants; + +import static org.ops4j.pax.exam.OptionUtils.combine; + +@RunWith(PaxExam.class) +public class BlueprintTracerTest extends OSGiBlueprintTestSupport { + +private String name = BlueprintTracerTest.class.getName(); + +@Test +public void testTracer() throws Exception { +// start bundle +getInstalledBundle(name).start(); + +// must use the camel context from osgi +CamelContext ctx = getOsgiService(CamelContext.class, (camel.context.symbolicname= + name + ), 1); + +ProducerTemplate myTemplate = ctx.createProducerTemplate(); +myTemplate.start(); + +// do our testing +MockEndpoint result = ctx.getEndpoint(mock:result, MockEndpoint.class); +result.expectedMessageCount(1); + +MockEndpoint tracer = ctx.getEndpoint(mock:traced, MockEndpoint.class); + +myTemplate.sendBody(direct:start, Hello World); + +result.assertIsSatisfied(); + +DefaultTraceEventMessage em = tracer.getReceivedExchanges().get(0).getIn().getBody(DefaultTraceEventMessage.class); +assertEquals(Hello Camel, em.getBody()); + +assertEquals(String, em.getBodyType()); +assertEquals(null, em.getCausedByException()); +assertNotNull(em.getExchangeId()); +assertNotNull(em.getShortExchangeId()); +assertNotNull(em.getExchangePattern()); +assertEquals(direct://start, em.getFromEndpointUri()); +// there is always a breadcrumb header +assertNotNull(em.getHeaders()); +assertNotNull(em.getProperties()); +assertNull(em.getOutBody()); +assertNull(em.getOutBodyType()); +assertNull(em.getOutHeaders()); +assertNull(em.getPreviousNode()); +assertNotNull(em.getToNode()); +assertNotNull(em.getTimestamp()); + +myTemplate.stop(); +} + +@Configuration +public static Option[] configure() throws Exception { + +Option[] options = combine( +getDefaultCamelKarafOptions(), + +bundle(TinyBundles.bundle() +.add(OSGI-INF/blueprint/test.xml, BlueprintTracerTest.class.getResource(blueprint-29.xml)) +.set(Constants.BUNDLE_SYMBOLICNAME, BlueprintTracerTest.class.getName()) +.set(Constants.BUNDLE_VERSION, 1.0.0) +.set(Constants.DYNAMICIMPORT_PACKAGE, *) +.build()).noStart(), + +// using the features to install the camel components +loadCamelFeatures(camel-blueprint)); + +return options; +} + +} http://git-wip-us.apache.org/repos/asf/camel/blob/8c2fa7c5/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml -- diff --git
git commit: Extend the test case to add a customTraceEventHandler
Repository: camel Updated Branches: refs/heads/master 8c2fa7c56 - 0b86b0014 Extend the test case to add a customTraceEventHandler Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0b86b001 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0b86b001 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0b86b001 Branch: refs/heads/master Commit: 0b86b001420e35c137726e9a38b4cfc5b23e314c Parents: 8c2fa7c Author: Charles Moulliard ch0...@gmail.com Authored: Tue Aug 26 14:25:53 2014 +0200 Committer: Charles Moulliard ch0...@gmail.com Committed: Tue Aug 26 14:25:53 2014 +0200 -- .../org/apache/camel/itest/osgi/blueprint/blueprint-29.xml| 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0b86b001/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml -- diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml index 8dea9c8..4235ba3 100644 --- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml +++ b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml @@ -33,6 +33,9 @@ property name=logLevel value=INFO/ property name=logName value=org.apache.camel.blueprint.log/ property name=destination ref=traced/ +property name=traceHandler ref=myTraceEventHandler/ /bean +bean id=myTraceEventHandler class=org.apache.camel.processor.interceptor.DefaultTraceEventHandler/ + /blueprint
git commit: CAMEL-7747: Braader jline version range so we can support more Karaf versions.
Repository: camel Updated Branches: refs/heads/master 0b86b0014 - 91b7e2be6 CAMEL-7747: Braader jline version range so we can support more Karaf versions. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/91b7e2be Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/91b7e2be Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/91b7e2be Branch: refs/heads/master Commit: 91b7e2be68926098fd91378db9bbbc35200fd1e3 Parents: 0b86b00 Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 14:25:57 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 14:26:12 2014 +0200 -- platforms/karaf/commands/pom.xml | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/91b7e2be/platforms/karaf/commands/pom.xml -- diff --git a/platforms/karaf/commands/pom.xml b/platforms/karaf/commands/pom.xml index eb62b65..f0fa7f7 100644 --- a/platforms/karaf/commands/pom.xml +++ b/platforms/karaf/commands/pom.xml @@ -80,6 +80,7 @@ org.apache.felix.gogo.commands;version=[0.6,1), org.apache.karaf.shell.console;version=[2.2,4), org.slf4j.*;version=[1.6,2), + jline.*;version=[2.1,3), * /Import-Package Private-Package
git commit: There is an issue with Blueprint. To be fixed
Repository: camel Updated Branches: refs/heads/master 91b7e2be6 - b84e7e923 There is an issue with Blueprint. To be fixed Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b84e7e92 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b84e7e92 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b84e7e92 Branch: refs/heads/master Commit: b84e7e9232e894a53ba29487654b8d37a6854a41 Parents: 91b7e2b Author: Charles Moulliard ch0...@gmail.com Authored: Tue Aug 26 15:37:31 2014 +0200 Committer: Charles Moulliard ch0...@gmail.com Committed: Tue Aug 26 15:37:31 2014 +0200 -- tests/camel-itest-osgi/pom.xml | 1 + .../osgi/blueprint/BlueprintTracerTest.java | 3 +- .../osgi/blueprint/MyTraceEventHandler.java | 69 .../camel/itest/osgi/blueprint/blueprint-29.xml | 6 +- 4 files changed, 75 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b84e7e92/tests/camel-itest-osgi/pom.xml -- diff --git a/tests/camel-itest-osgi/pom.xml b/tests/camel-itest-osgi/pom.xml index 0d89681..a1be199 100644 --- a/tests/camel-itest-osgi/pom.xml +++ b/tests/camel-itest-osgi/pom.xml @@ -496,6 +496,7 @@ exclude**/FtpConsumeTest.*/exclude exclude**/BlobStoreRouteTest.*/exclude !-- CAMEL-6134 -- exclude**/BlobStoreBlueprintRouteTest.*/exclude !-- CAMEL-6134 -- + exclude**/BlueprintTracerTest.*/exclude !-- We get a Gave up waiting for service ((objectClass=org.apache.camel.CamelContext) -- /excludes systemPropertyVariables karafVersion${karaf-version}/karafVersion http://git-wip-us.apache.org/repos/asf/camel/blob/b84e7e92/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java -- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java index 170faf7..f372e26 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java @@ -25,7 +25,7 @@ public class BlueprintTracerTest extends OSGiBlueprintTestSupport { getInstalledBundle(name).start(); // must use the camel context from osgi -CamelContext ctx = getOsgiService(CamelContext.class, (camel.context.symbolicname= + name + ), 1); +CamelContext ctx = getOsgiService(CamelContext.class, (camel.context.symbolicname= + name + ), 3); ProducerTemplate myTemplate = ctx.createProducerTemplate(); myTemplate.start(); @@ -73,6 +73,7 @@ public class BlueprintTracerTest extends OSGiBlueprintTestSupport { .set(Constants.BUNDLE_SYMBOLICNAME, BlueprintTracerTest.class.getName()) .set(Constants.BUNDLE_VERSION, 1.0.0) .set(Constants.DYNAMICIMPORT_PACKAGE, *) +.add(MyTraceEventHandler.class) .build()).noStart(), // using the features to install the camel components http://git-wip-us.apache.org/repos/asf/camel/blob/b84e7e92/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java -- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java new file mode 100644 index 000..fcc7b75 --- /dev/null +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java @@ -0,0 +1,69 @@ +package org.apache.camel.itest.osgi.blueprint; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.model.ProcessorDefinition; +import org.apache.camel.processor.interceptor.TraceEventHandler; +import org.apache.camel.processor.interceptor.TraceInterceptor; + +import java.util.LinkedList; +import java.util.List; + +public class MyTraceEventHandler implements TraceEventHandler { + +private ListStringBuilder eventMessages; + +public MyTraceEventHandler() { +this.eventMessages = new LinkedListStringBuilder(); +} + +public static void recordComplete(StringBuilder message, ProcessorDefinition? node, Exchange exchange) { +message.append(Complete: );
[1/2] git commit: CAMEL-7576: Turn of online update checker for ehcache
Repository: camel Updated Branches: refs/heads/camel-2.12.x 6f3b86cf8 - 103bae421 refs/heads/camel-2.13.x 2c1f12dc0 - 40b308409 CAMEL-7576: Turn of online update checker for ehcache Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/40b30840 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/40b30840 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/40b30840 Branch: refs/heads/camel-2.13.x Commit: 40b308409ed21d480545dd8317fbbf8ce3ba3acd Parents: 2c1f12d Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 15:47:52 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 15:48:25 2014 +0200 -- .../component/cache/CacheManagerFactory.java| 22 +++- 1 file changed, 21 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/40b30840/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java -- diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java index f2476cb..1a69a7c 100755 --- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java +++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java @@ -17,16 +17,35 @@ package org.apache.camel.component.cache; import net.sf.ehcache.CacheManager; +import net.sf.ehcache.config.Configuration; import org.apache.camel.support.ServiceSupport; +import org.apache.camel.util.ReflectionHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class CacheManagerFactory extends ServiceSupport { +private static final Logger LOG = LoggerFactory.getLogger(CacheManagerFactory.class); private CacheManager cacheManager; public synchronized CacheManager getInstance() { if (cacheManager == null) { cacheManager = createCacheManagerInstance(); + +// always turn off ET phone-home +LOG.debug(Turning off EHCache update checker ...); +Configuration config = cacheManager.getConfiguration(); +try { +// need to set both the system property and bypass the setUpdateCheck method as that can be changed dynamically +System.setProperty(net.sf.ehcache.skipUpdateCheck, true); + ReflectionHelper.setField(config.getClass().getDeclaredField(updateCheck), config, false); + +LOG.info(Turned off EHCache update checker. updateCheck={}, config.getUpdateCheck()); +} catch (Throwable e) { +// ignore +LOG.warn(Error turning off EHCache update checker. Beware information sent over the internet!, e); +} } - + return cacheManager; } @@ -48,6 +67,7 @@ public abstract class CacheManagerFactory extends ServiceSupport { // shutdown cache manager when stopping if (cacheManager != null) { cacheManager.shutdown(); +cacheManager = null; } } }
git commit: Remove MyTraceEventHandler class as this is irrelevant for the test
Repository: camel Updated Branches: refs/heads/master b84e7e923 - 85e35dadc Remove MyTraceEventHandler class as this is irrelevant for the test Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/85e35dad Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/85e35dad Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/85e35dad Branch: refs/heads/master Commit: 85e35dadc8e3990fff6db3ebe8c2c148e5a5df5c Parents: b84e7e9 Author: Charles Moulliard ch0...@gmail.com Authored: Tue Aug 26 15:49:23 2014 +0200 Committer: Charles Moulliard ch0...@gmail.com Committed: Tue Aug 26 15:49:23 2014 +0200 -- .../osgi/blueprint/BlueprintTracerTest.java | 1 - .../osgi/blueprint/MyTraceEventHandler.java | 69 .../camel/itest/osgi/blueprint/blueprint-29.xml | 7 +- 3 files changed, 2 insertions(+), 75 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/85e35dad/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java -- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java index f372e26..05d0c66 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java @@ -73,7 +73,6 @@ public class BlueprintTracerTest extends OSGiBlueprintTestSupport { .set(Constants.BUNDLE_SYMBOLICNAME, BlueprintTracerTest.class.getName()) .set(Constants.BUNDLE_VERSION, 1.0.0) .set(Constants.DYNAMICIMPORT_PACKAGE, *) -.add(MyTraceEventHandler.class) .build()).noStart(), // using the features to install the camel components http://git-wip-us.apache.org/repos/asf/camel/blob/85e35dad/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java -- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java deleted file mode 100644 index fcc7b75..000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.apache.camel.itest.osgi.blueprint; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.model.ProcessorDefinition; -import org.apache.camel.processor.interceptor.TraceEventHandler; -import org.apache.camel.processor.interceptor.TraceInterceptor; - -import java.util.LinkedList; -import java.util.List; - -public class MyTraceEventHandler implements TraceEventHandler { - -private ListStringBuilder eventMessages; - -public MyTraceEventHandler() { -this.eventMessages = new LinkedListStringBuilder(); -} - -public static void recordComplete(StringBuilder message, ProcessorDefinition? node, Exchange exchange) { -message.append(Complete: ); -message.append(node.getLabel() + : ); -message.append(exchange.getIn().getBody()); -} - -public static void recordIn(StringBuilder message, ProcessorDefinition? node, Exchange exchange) { -message.append(In: ); -message.append(node.getLabel() + : ); -message.append(exchange.getIn().getBody()); -} - -public static void recordOut(StringBuilder message, ProcessorDefinition? node, Exchange exchange) { -message.append(Out: ); -message.append(node.getLabel() + : ); -if (null != exchange.getOut()) { -message.append(exchange.getOut().getBody()); -} -if (null != exchange.getException()) { -Exception ex = exchange.getException(); -message.append(\t); -message.append(Ex: ); -message.append(ex.getMessage()); -} -} - -private synchronized void storeMessage(StringBuilder message) { -eventMessages.add(message); -} - -public void traceExchange(ProcessorDefinition? node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception { -StringBuilder message = new StringBuilder(); -recordComplete(message, node, exchange); -storeMessage(message); -} - -public Object traceExchangeIn(ProcessorDefinition? node, Processor target,
[2/2] git commit: CAMEL-7576: Turn of online update checker for ehcache
CAMEL-7576: Turn of online update checker for ehcache Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/103bae42 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/103bae42 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/103bae42 Branch: refs/heads/camel-2.12.x Commit: 103bae421fac197830d5628b924e4ea1669b2ed5 Parents: 6f3b86c Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 15:47:52 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 15:48:36 2014 +0200 -- .../component/cache/CacheManagerFactory.java| 22 +++- 1 file changed, 21 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/103bae42/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java -- diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java index f2476cb..1a69a7c 100755 --- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java +++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java @@ -17,16 +17,35 @@ package org.apache.camel.component.cache; import net.sf.ehcache.CacheManager; +import net.sf.ehcache.config.Configuration; import org.apache.camel.support.ServiceSupport; +import org.apache.camel.util.ReflectionHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class CacheManagerFactory extends ServiceSupport { +private static final Logger LOG = LoggerFactory.getLogger(CacheManagerFactory.class); private CacheManager cacheManager; public synchronized CacheManager getInstance() { if (cacheManager == null) { cacheManager = createCacheManagerInstance(); + +// always turn off ET phone-home +LOG.debug(Turning off EHCache update checker ...); +Configuration config = cacheManager.getConfiguration(); +try { +// need to set both the system property and bypass the setUpdateCheck method as that can be changed dynamically +System.setProperty(net.sf.ehcache.skipUpdateCheck, true); + ReflectionHelper.setField(config.getClass().getDeclaredField(updateCheck), config, false); + +LOG.info(Turned off EHCache update checker. updateCheck={}, config.getUpdateCheck()); +} catch (Throwable e) { +// ignore +LOG.warn(Error turning off EHCache update checker. Beware information sent over the internet!, e); +} } - + return cacheManager; } @@ -48,6 +67,7 @@ public abstract class CacheManagerFactory extends ServiceSupport { // shutdown cache manager when stopping if (cacheManager != null) { cacheManager.shutdown(); +cacheManager = null; } } }
[3/3] git commit: Merge branch 'CAMEL-7748' of https://github.com/kevinearls/camel
Merge branch 'CAMEL-7748' of https://github.com/kevinearls/camel Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/52acd075 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/52acd075 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/52acd075 Branch: refs/heads/master Commit: 52acd075026bafd1e77f9b3b31435b1cf19051ad Parents: 64be7d2 d70039b Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 15:50:27 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 15:50:27 2014 +0200 -- .../org/apache/camel/component/twitter/UriConfigurationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --
[1/3] git commit: Fix for CAMEL-7748 Test was failing because of change in returning json schema object types
Repository: camel Updated Branches: refs/heads/master 85e35dadc - 52acd0750 Fix for CAMEL-7748 Test was failing because of change in returning json schema object types Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d70039b1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d70039b1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d70039b1 Branch: refs/heads/master Commit: d70039b14e971654af9e13a080954ee46f233456 Parents: 91b7e2b Author: Kevin Earls ke...@kevinearls.com Authored: Tue Aug 26 15:15:01 2014 +0200 Committer: Kevin Earls ke...@kevinearls.com Committed: Tue Aug 26 15:15:01 2014 +0200 -- .../org/apache/camel/component/twitter/UriConfigurationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/d70039b1/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java -- diff --git a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java index 4ff51a6..eda9bdd 100644 --- a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java +++ b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java @@ -74,8 +74,8 @@ public class UriConfigurationTest extends Assert { String json = compConf.createParameterJsonSchema(); assertNotNull(json); -assertTrue(json.contains(\accessToken\: { \type\: \java.lang.String\ })); -assertTrue(json.contains(\consumerKey\: { \type\: \java.lang.String\ })); +assertTrue(json.contains(\accessToken\: { \type\: \string\ })); +assertTrue(json.contains(\consumerKey\: { \type\: \string\ })); } @Test
[2/3] git commit: CAMEL-7576: Turn of online update checker for ehcache
CAMEL-7576: Turn of online update checker for ehcache Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/64be7d20 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/64be7d20 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/64be7d20 Branch: refs/heads/master Commit: 64be7d2089e6d0943fb949cf37562401b7c95aee Parents: 85e35da Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 15:47:52 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 15:50:20 2014 +0200 -- .../component/cache/CacheManagerFactory.java| 22 +++- 1 file changed, 21 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/64be7d20/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java -- diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java index f2476cb..1a69a7c 100755 --- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java +++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheManagerFactory.java @@ -17,16 +17,35 @@ package org.apache.camel.component.cache; import net.sf.ehcache.CacheManager; +import net.sf.ehcache.config.Configuration; import org.apache.camel.support.ServiceSupport; +import org.apache.camel.util.ReflectionHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class CacheManagerFactory extends ServiceSupport { +private static final Logger LOG = LoggerFactory.getLogger(CacheManagerFactory.class); private CacheManager cacheManager; public synchronized CacheManager getInstance() { if (cacheManager == null) { cacheManager = createCacheManagerInstance(); + +// always turn off ET phone-home +LOG.debug(Turning off EHCache update checker ...); +Configuration config = cacheManager.getConfiguration(); +try { +// need to set both the system property and bypass the setUpdateCheck method as that can be changed dynamically +System.setProperty(net.sf.ehcache.skipUpdateCheck, true); + ReflectionHelper.setField(config.getClass().getDeclaredField(updateCheck), config, false); + +LOG.info(Turned off EHCache update checker. updateCheck={}, config.getUpdateCheck()); +} catch (Throwable e) { +// ignore +LOG.warn(Error turning off EHCache update checker. Beware information sent over the internet!, e); +} } - + return cacheManager; } @@ -48,6 +67,7 @@ public abstract class CacheManagerFactory extends ServiceSupport { // shutdown cache manager when stopping if (cacheManager != null) { cacheManager.shutdown(); +cacheManager = null; } } }
git commit: Fix for CAMEL-7749 restore @Ignore on testTXForceShutdown
Repository: camel Updated Branches: refs/heads/master 52acd0750 - 99a76e706 Fix for CAMEL-7749 restore @Ignore on testTXForceShutdown Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/99a76e70 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/99a76e70 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/99a76e70 Branch: refs/heads/master Commit: 99a76e70678b4a99ff7139fed7bd393dafaacf6f Parents: 52acd07 Author: Kevin Earls ke...@kevinearls.com Authored: Tue Aug 26 15:58:08 2014 +0200 Committer: Kevin Earls ke...@kevinearls.com Committed: Tue Aug 26 15:58:08 2014 +0200 -- .../camel/component/jms/issues/JmsTXForceShutdownIssueTest.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/99a76e70/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsTXForceShutdownIssueTest.java -- diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsTXForceShutdownIssueTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsTXForceShutdownIssueTest.java index 0cb0461..d94b048 100644 --- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsTXForceShutdownIssueTest.java +++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsTXForceShutdownIssueTest.java @@ -40,7 +40,7 @@ public class JmsTXForceShutdownIssueTest extends CamelSpringTestSupport { } @Test -//@Ignore(This is a manual test, start Apache ActiveMQ broker manually first, using bin/activemq console) +@Ignore(This is a manual test, start Apache ActiveMQ broker manually first, using bin/activemq console) // and make sure to setup tcp transport connector on the remote AMQ broker in the conf/activemq.xml file // transportConnectors // transportConnector name=openwire uri=tcp://0.0.0.0:61616/
git commit: CAMEL-7741 Fixed the karaf start up error with -Pkaraf3
Repository: camel Updated Branches: refs/heads/master 99a76e706 - 5ab756b3c CAMEL-7741 Fixed the karaf start up error with -Pkaraf3 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5ab756b3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5ab756b3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5ab756b3 Branch: refs/heads/master Commit: 5ab756b3c24d11682fb104044918d4f0b15a6e91 Parents: 99a76e7 Author: Willem Jiang willem.ji...@gmail.com Authored: Tue Aug 26 22:34:33 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Tue Aug 26 22:34:58 2014 +0800 -- .../java/org/apache/camel/itest/karaf/AbstractFeatureTest.java | 2 +- .../org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5ab756b3/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java index 736b465..89589af 100644 --- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java @@ -202,7 +202,7 @@ public abstract class AbstractFeatureTest { KarafDistributionOption.keepRuntimeFolder(), // override the config.properties (to fix pax-exam bug) - KarafDistributionOption.replaceConfigurationFile(etc/config.properties, new File(src/test/resources/org/apache/camel/itest/karaf/config.properties)), + //KarafDistributionOption.replaceConfigurationFile(etc/config.properties, new File(src/test/resources/org/apache/camel/itest/karaf/config.properties)), KarafDistributionOption.replaceConfigurationFile(etc/custom.properties, new File(src/test/resources/org/apache/camel/itest/karaf/custom.properties)), KarafDistributionOption.replaceConfigurationFile(etc/org.ops4j.pax.url.mvn.cfg, new File(src/test/resources/org/apache/camel/itest/karaf/org.ops4j.pax.url.mvn.cfg)), http://git-wip-us.apache.org/repos/asf/camel/blob/5ab756b3/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java -- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java index 6543f60..52f7bbf 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java @@ -162,7 +162,7 @@ public class OSGiIntegrationTestSupport extends CamelTestSupport { KarafDistributionOption.keepRuntimeFolder(), // override the config.properties (to fix pax-exam bug) - KarafDistributionOption.replaceConfigurationFile(etc/config.properties, new File(src/test/resources/org/apache/camel/itest/karaf/config.properties)), + // KarafDistributionOption.replaceConfigurationFile(etc/config.properties, new File(src/test/resources/org/apache/camel/itest/karaf/config.properties)), KarafDistributionOption.replaceConfigurationFile(etc/custom.properties, new File(src/test/resources/org/apache/camel/itest/karaf/custom.properties)), KarafDistributionOption.replaceConfigurationFile(etc/org.ops4j.pax.url.mvn.cfg, new File(src/test/resources/org/apache/camel/itest/karaf/org.ops4j.pax.url.mvn.cfg)),
git commit: CAMEL-7688: Improved XPathBuilder init default xpath builder. Thanks to Chris Watts for the patch.
Repository: camel Updated Branches: refs/heads/master 5ab756b3c - d0a36fe12 CAMEL-7688: Improved XPathBuilder init default xpath builder. Thanks to Chris Watts for the patch. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d0a36fe1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d0a36fe1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d0a36fe1 Branch: refs/heads/master Commit: d0a36fe129a68a8d85cf1aee96a35d1ad84ccb5b Parents: 5ab756b Author: Claus Ibsen davscl...@apache.org Authored: Tue Aug 26 22:28:28 2014 +0200 Committer: Claus Ibsen davscl...@apache.org Committed: Tue Aug 26 22:28:28 2014 +0200 -- .../apache/camel/builder/xml/XPathBuilder.java | 70 +--- 1 file changed, 32 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/d0a36fe1/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java -- diff --git a/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java index 47406fa..d618705 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java +++ b/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java @@ -79,7 +79,7 @@ import static org.apache.camel.builder.xml.Namespaces.isMatchingNamespaceOrEmpty * p/ * This implementation is thread safe by using thread locals and pooling to allow concurrency. * p/ - * bImportant:/b After configuring the {@link XPathBuilder} its adviced to invoke {@link #start()} + * bImportant:/b After configuring the {@link XPathBuilder} its advised to invoke {@link #start()} * to prepare the builder before using; though the builder will auto-start on first use. * * @see XPathConstants#NODESET @@ -137,7 +137,7 @@ public class XPathBuilder extends ServiceSupport implements Expression, Predicat } /** - * @param text The XPath expression + * @param text The XPath expression * @param resultType The result type that the XPath expression will return. * @return A new XPathBuilder object */ @@ -294,7 +294,7 @@ public class XPathBuilder extends ServiceSupport implements Expression, Predicat } /** - * Sets the expression result type to the given {@code resultType} + * Sets the expression result type to the given {@code resultType} * * @return the current builder */ @@ -469,8 +469,8 @@ public class XPathBuilder extends ServiceSupport implements Expression, Predicat public String getHeaderName() { return headerName; } - -public void setHeaderName(String headerName) { + +public void setHeaderName(String headerName) { this.headerName = headerName; } @@ -519,9 +519,6 @@ public class XPathBuilder extends ServiceSupport implements Expression, Predicat return new XPathFunction() { @SuppressWarnings(rawtypes) public Object evaluate(List list) throws XPathFunctionException { -if (exchange == null) { -return null; -} return exchange.get().getIn().getBody(); } }; @@ -547,7 +544,7 @@ public class XPathBuilder extends ServiceSupport implements Expression, Predicat return new XPathFunction() { @SuppressWarnings(rawtypes) public Object evaluate(List list) throws XPathFunctionException { -if (exchange != null !list.isEmpty()) { +if (!list.isEmpty()) { Object value = list.get(0); if (value != null) { String text = exchange.get().getContext().getTypeConverter().convertTo(String.class, value); @@ -639,7 +636,7 @@ public class XPathBuilder extends ServiceSupport implements Expression, Predicat return new XPathFunction() { @SuppressWarnings(rawtypes) public Object evaluate(List list) throws XPathFunctionException { -if (exchange != null !list.isEmpty()) { +if (!list.isEmpty()) { Object value = list.get(0); if (value != null) { String text = exchange.get().getContext().getTypeConverter().convertTo(String.class, value); @@ -678,7 +675,7 @@ public class XPathBuilder extends ServiceSupport implements Expression, Predicat return new XPathFunction() { @SuppressWarnings(rawtypes) public Object evaluate(List list) throws XPathFunctionException { -if (exchange != null !list.isEmpty()) { +if (!list.isEmpty()) {
git commit: CAMEL-7448 updated Throttler to use previous maximumRequestsPerPeriod value if missing
Repository: camel Updated Branches: refs/heads/master d0a36fe12 - 35bde2b29 CAMEL-7448 updated Throttler to use previous maximumRequestsPerPeriod value if missing Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/35bde2b2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/35bde2b2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/35bde2b2 Branch: refs/heads/master Commit: 35bde2b29f616d2f3b51e81b805b4ea635d228c9 Parents: d0a36fe Author: boday bo...@apache.org Authored: Tue Aug 26 15:57:39 2014 -0700 Committer: boday bo...@apache.org Committed: Tue Aug 26 15:57:39 2014 -0700 -- .../org/apache/camel/processor/Throttler.java | 2 +- .../camel/processor/ThrottlerNullEvalTest.java | 26 +--- 2 files changed, 24 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/35bde2b2/camel-core/src/main/java/org/apache/camel/processor/Throttler.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java index f70325d..c986bf7 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java +++ b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java @@ -108,7 +108,7 @@ public class Throttler extends DelayProcessorSupport implements Traceable { protected long calculateDelay(Exchange exchange) { // evaluate as Object first to see if we get any result at all Object result = maxRequestsPerPeriodExpression.evaluate(exchange, Object.class); -if (result == null) { +if (maximumRequestsPerPeriod == 0 result == null) { throw new RuntimeExchangeException(The max requests per period expression was evaluated as null: + maxRequestsPerPeriodExpression, exchange); } http://git-wip-us.apache.org/repos/asf/camel/blob/35bde2b2/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java index a3db8ae..6205059 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java @@ -24,21 +24,41 @@ import org.apache.camel.builder.RouteBuilder; */ public class ThrottlerNullEvalTest extends ContextTestSupport { -public void testNullEvalTest() throws Exception { +public void testFirstNullEvalTest() throws Exception { getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Bye World); getMockEndpoint(mock:dead).expectedBodiesReceived(Kaboom); -template.sendBodyAndHeader(seda:a, Hello World, max, 2); template.sendBodyAndHeader(seda:a, Kaboom, max, null); +template.sendBodyAndHeader(seda:a, Hello World, max, 2); template.sendBodyAndHeader(seda:a, Bye World, max, 2); assertMockEndpointsSatisfied(); } -public void testNoHeaderTest() throws Exception { +public void testFirstNoHeaderTest() throws Exception { getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Bye World); getMockEndpoint(mock:dead).expectedBodiesReceived(Kaboom); +template.sendBody(seda:a, Kaboom); +template.sendBodyAndHeader(seda:a, Hello World, max, 2); +template.sendBodyAndHeader(seda:a, Bye World, max, 2); + +assertMockEndpointsSatisfied(); +} + +public void testNullEvalTest() throws Exception { +getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Kaboom, Bye World); + +template.sendBodyAndHeader(seda:a, Hello World, max, 2); +template.sendBodyAndHeader(seda:a, Kaboom, max, null); +template.sendBodyAndHeader(seda:a, Bye World, max, 2); + +assertMockEndpointsSatisfied(); +} + +public void testNoHeaderTest() throws Exception { +getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Kaboom, Bye World); + template.sendBodyAndHeader(seda:a, Hello World, max, 2); template.sendBody(seda:a, Kaboom); template.sendBodyAndHeader(seda:a, Bye World, max, 2);
git commit: CAMEL-7448 updated Throttler to use previous maximumRequestsPerPeriod value if missing
Repository: camel Updated Branches: refs/heads/camel-2.13.x 40b308409 - f9340dcaf CAMEL-7448 updated Throttler to use previous maximumRequestsPerPeriod value if missing Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f9340dca Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f9340dca Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f9340dca Branch: refs/heads/camel-2.13.x Commit: f9340dcaf830f08cc2a0476402a081399553258c Parents: 40b3084 Author: boday bo...@apache.org Authored: Tue Aug 26 15:57:39 2014 -0700 Committer: boday bo...@apache.org Committed: Tue Aug 26 20:42:20 2014 -0700 -- .../org/apache/camel/processor/Throttler.java | 2 +- .../camel/processor/ThrottlerNullEvalTest.java | 26 +--- 2 files changed, 24 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/f9340dca/camel-core/src/main/java/org/apache/camel/processor/Throttler.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java index 6b51a2c..fb38495 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/Throttler.java +++ b/camel-core/src/main/java/org/apache/camel/processor/Throttler.java @@ -105,7 +105,7 @@ public class Throttler extends DelayProcessorSupport implements Traceable { protected long calculateDelay(Exchange exchange) { // evaluate as Object first to see if we get any result at all Object result = maxRequestsPerPeriodExpression.evaluate(exchange, Object.class); -if (result == null) { +if (maximumRequestsPerPeriod == 0 result == null) { throw new RuntimeExchangeException(The max requests per period expression was evaluated as null: + maxRequestsPerPeriodExpression, exchange); } http://git-wip-us.apache.org/repos/asf/camel/blob/f9340dca/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java index a3db8ae..6205059 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/ThrottlerNullEvalTest.java @@ -24,21 +24,41 @@ import org.apache.camel.builder.RouteBuilder; */ public class ThrottlerNullEvalTest extends ContextTestSupport { -public void testNullEvalTest() throws Exception { +public void testFirstNullEvalTest() throws Exception { getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Bye World); getMockEndpoint(mock:dead).expectedBodiesReceived(Kaboom); -template.sendBodyAndHeader(seda:a, Hello World, max, 2); template.sendBodyAndHeader(seda:a, Kaboom, max, null); +template.sendBodyAndHeader(seda:a, Hello World, max, 2); template.sendBodyAndHeader(seda:a, Bye World, max, 2); assertMockEndpointsSatisfied(); } -public void testNoHeaderTest() throws Exception { +public void testFirstNoHeaderTest() throws Exception { getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Bye World); getMockEndpoint(mock:dead).expectedBodiesReceived(Kaboom); +template.sendBody(seda:a, Kaboom); +template.sendBodyAndHeader(seda:a, Hello World, max, 2); +template.sendBodyAndHeader(seda:a, Bye World, max, 2); + +assertMockEndpointsSatisfied(); +} + +public void testNullEvalTest() throws Exception { +getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Kaboom, Bye World); + +template.sendBodyAndHeader(seda:a, Hello World, max, 2); +template.sendBodyAndHeader(seda:a, Kaboom, max, null); +template.sendBodyAndHeader(seda:a, Bye World, max, 2); + +assertMockEndpointsSatisfied(); +} + +public void testNoHeaderTest() throws Exception { +getMockEndpoint(mock:result).expectedBodiesReceived(Hello World, Kaboom, Bye World); + template.sendBodyAndHeader(seda:a, Hello World, max, 2); template.sendBody(seda:a, Kaboom); template.sendBodyAndHeader(seda:a, Bye World, max, 2);
git commit: CAMEL-7751 Fixed the typo of Trace interceptor with thanks to Ramon.
Repository: camel Updated Branches: refs/heads/master 35bde2b29 - 02973683e CAMEL-7751 Fixed the typo of Trace interceptor with thanks to Ramon. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/02973683 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/02973683 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/02973683 Branch: refs/heads/master Commit: 02973683eea2a9d61dc19c5d0f56ee4abfac9835 Parents: 35bde2b Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 27 13:06:19 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 27 13:06:19 2014 +0800 -- .../main/java/org/apache/camel/processor/interceptor/Tracer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/02973683/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java index 432a572..36d784e 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java +++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java @@ -324,7 +324,7 @@ public class Tracer implements InterceptStrategy, Service { * Remove the given tracehandler */ public void removeTraceHandler(TraceEventHandler traceHandler) { -this.traceHandlers.add(traceHandler); +this.traceHandlers.remove(traceHandler); } public String getJpaTraceEventMessageClassName() {
[1/2] git commit: CAMEL-7751 Fixed the typo of Trace interceptor with thanks to Ramon.
Repository: camel Updated Branches: refs/heads/camel-2.12.x 103bae421 - 61b17143f refs/heads/camel-2.13.x f9340dcaf - d4cf2860e CAMEL-7751 Fixed the typo of Trace interceptor with thanks to Ramon. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d4cf2860 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d4cf2860 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d4cf2860 Branch: refs/heads/camel-2.13.x Commit: d4cf2860eec866dcb6bb0850b66fc3fe915b35c8 Parents: f9340dc Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 27 13:06:19 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 27 13:08:05 2014 +0800 -- .../main/java/org/apache/camel/processor/interceptor/Tracer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/d4cf2860/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java index 432a572..36d784e 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java +++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java @@ -324,7 +324,7 @@ public class Tracer implements InterceptStrategy, Service { * Remove the given tracehandler */ public void removeTraceHandler(TraceEventHandler traceHandler) { -this.traceHandlers.add(traceHandler); +this.traceHandlers.remove(traceHandler); } public String getJpaTraceEventMessageClassName() {
[2/2] git commit: CAMEL-7751 Fixed the typo of Trace interceptor with thanks to Ramon.
CAMEL-7751 Fixed the typo of Trace interceptor with thanks to Ramon. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/61b17143 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/61b17143 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/61b17143 Branch: refs/heads/camel-2.12.x Commit: 61b17143f3879b7ef2b195f9b4177f18b916d241 Parents: 103bae4 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 27 13:06:19 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 27 13:08:13 2014 +0800 -- .../main/java/org/apache/camel/processor/interceptor/Tracer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/61b17143/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java index 432a572..36d784e 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java +++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java @@ -324,7 +324,7 @@ public class Tracer implements InterceptStrategy, Service { * Remove the given tracehandler */ public void removeTraceHandler(TraceEventHandler traceHandler) { -this.traceHandlers.add(traceHandler); +this.traceHandlers.remove(traceHandler); } public String getJpaTraceEventMessageClassName() {
[CONF] Apache Camel RabbitMQ
willem jiang edited the page: RabbitMQ Comment: CAMEL-7552 ... div class confluenceTableSmall Property Default Description autoAck true If messages should be auto acknowledged autoDelete true If it is true, the exchange will be deleted when it is no longer in use durable true If we are declaring a durable exchange (the exchange will survive a server restart)
git commit: CAMEL-7552 RabbitMQ Component: property to allow declare or not queue and exchange with thanks to Ramon
Repository: camel Updated Branches: refs/heads/master 02973683e - 5d3b9457e CAMEL-7552 RabbitMQ Component: property to allow declare or not queue and exchange with thanks to Ramon Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5d3b9457 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5d3b9457 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5d3b9457 Branch: refs/heads/master Commit: 5d3b9457ee917328034281ab2b43957011d90072 Parents: 0297368 Author: Willem Jiang willem.ji...@gmail.com Authored: Wed Aug 27 13:56:39 2014 +0800 Committer: Willem Jiang willem.ji...@gmail.com Committed: Wed Aug 27 13:56:39 2014 +0800 -- .../camel/component/rabbitmq/RabbitMQConsumer.java | 4 +++- .../camel/component/rabbitmq/RabbitMQEndpoint.java | 12 +++- .../camel/component/rabbitmq/RabbitMQProducer.java | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5d3b9457/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java -- diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java index 7d8b4d1..09e6ea3 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java @@ -86,7 +86,9 @@ public class RabbitMQConsumer extends DefaultConsumer { private void startConsumers() throws IOException { // First channel used to declare Exchange and Queue Channel channel = openChannel(); -endpoint.declareExchangeAndQueue(channel); +if (getEndpoint().isDeclare()) { +endpoint.declareExchangeAndQueue(channel); +} startConsumer(channel); // Other channels for (int i = 1; i endpoint.getConcurrentConsumers(); i++) { http://git-wip-us.apache.org/repos/asf/camel/blob/5d3b9457/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java -- diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java index d0484b1..78a01ef 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java @@ -73,7 +73,6 @@ public class RabbitMQEndpoint extends DefaultEndpoint { private Boolean automaticRecoveryEnabled; private Integer networkRecoveryInterval; private Boolean topologyRecoveryEnabled; - //If it is true, prefetchSize, prefetchCount, prefetchGlobal will be used for basicOqs before starting RabbitMQConsumer private boolean prefetchEnabled; //Default in RabbitMq is 0. @@ -85,6 +84,9 @@ public class RabbitMQEndpoint extends DefaultEndpoint { * Number of concurrent consumer threads */ private int concurrentConsumers = 1; + +//Declares a queue and exchange in RabbitMQ, then binds both. +private boolean declare = true; public RabbitMQEndpoint() { } @@ -472,4 +474,12 @@ public class RabbitMQEndpoint extends DefaultEndpoint { public void setConcurrentConsumers(int concurrentConsumers) { this.concurrentConsumers = concurrentConsumers; } + +public boolean isDeclare() { +return declare; +} + +public void setDeclare(boolean declare) { +this.declare = declare; +} } http://git-wip-us.apache.org/repos/asf/camel/blob/5d3b9457/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java -- diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java index ea02ce2..f5c7eb4 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java @@ -56,8 +56,9 @@ public class RabbitMQProducer extends DefaultProducer { log.trace(Creating channel...); this.channel = conn.createChannel(); log.debug(Created channel: