Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50C5198B0 for ; Mon, 23 Jan 2012 16:29:10 +0000 (UTC) Received: (qmail 29670 invoked by uid 500); 23 Jan 2012 16:29:10 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 29587 invoked by uid 500); 23 Jan 2012 16:29:09 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 29580 invoked by uid 99); 23 Jan 2012 16:29:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 16:29:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 16:29:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 38F0623888FE for ; Mon, 23 Jan 2012 16:28:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1234885 - in /camel/trunk: components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/ tooling/archetypes/camel-archetype-blueprint/src/main/resources-filtered/META-INF/maven/ tooling/archetypes/camel-archetype-blueprint... Date: Mon, 23 Jan 2012 16:28:43 -0000 To: commits@camel.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120123162844.38F0623888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Mon Jan 23 16:28:43 2012 New Revision: 1234885 URL: http://svn.apache.org/viewvc?rev=1234885&view=rev Log: CAMEL-4914: Improved blueprint archetype for using camel-test-blueprint. Modified: camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/pom.xml camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/blueprint.xml camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/java/RouteTest.java camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/resources/log4j.properties Modified: camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java?rev=1234885&r1=1234884&r2=1234885&view=diff ============================================================================== --- camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java (original) +++ camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java Mon Jan 23 16:28:43 2012 @@ -39,6 +39,7 @@ import de.kalpatec.pojosr.framework.laun import de.kalpatec.pojosr.framework.launch.PojoServiceRegistryFactory; import org.apache.camel.CamelContext; import org.apache.camel.test.CamelTestSupport; +import org.apache.camel.util.FileUtil; import org.apache.camel.util.IOHelper; import org.apache.camel.util.ObjectHelper; import org.ops4j.pax.swissbox.tinybundles.core.TinyBundle; @@ -114,6 +115,8 @@ public abstract class CamelBlueprintTest Iterator it = ObjectHelper.createIterator(descriptor); while (it.hasNext()) { String s = (String) it.next(); + // remove leading / to be able to load resource from the classpath + s = FileUtil.stripLeadingSeparator(s); URL url = ObjectHelper.loadResourceAsURL(s); if (url == null) { throw new FileNotFoundException("Resource " + s + " not found in classpath"); Modified: camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml?rev=1234885&r1=1234884&r2=1234885&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml (original) +++ camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml Mon Jan 23 16:28:43 2012 @@ -57,6 +57,12 @@ + src/test/resources + + **/* + + + ReadMe.txt Modified: camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt?rev=1234885&r1=1234884&r2=1234885&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt (original) +++ camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt Mon Jan 23 16:28:43 2012 @@ -1,6 +1,10 @@ Camel Router Project for Blueprint (OSGi) ========================================= +To build this example use + + mvn install + To deploy the example in OSGi. For example using Apache ServiceMix or Apache Karaf. You will run the following command from its shell: Modified: camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/pom.xml?rev=1234885&r1=1234884&r2=1234885&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/pom.xml (original) +++ camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/pom.xml Mon Jan 23 16:28:43 2012 @@ -60,6 +60,11 @@ ${slf4j-version} + org.slf4j + jcl-over-slf4j + ${slf4j-version} + + log4j log4j ${log4j-version} @@ -94,6 +99,15 @@ + + + + maven-surefire-plugin + + pertest + + + Modified: camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/blueprint.xml URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=1234885&r1=1234884&r2=1234885&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/blueprint.xml (original) +++ camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/blueprint.xml Mon Jan 23 16:28:43 2012 @@ -29,12 +29,12 @@ - + - + Modified: camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/java/RouteTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/java/RouteTest.java?rev=1234885&r1=1234884&r2=1234885&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/java/RouteTest.java (original) +++ camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/java/RouteTest.java Mon Jan 23 16:28:43 2012 @@ -16,10 +16,6 @@ */ package ${package}; -import java.net.URL; -import java.util.Collection; -import java.util.Collections; - import org.apache.camel.test.blueprint.CamelBlueprintTestSupport; import org.junit.Test; @@ -27,19 +23,17 @@ import org.junit.Test; public class RouteTest extends CamelBlueprintTestSupport { @Override - protected Collection getBlueprintDescriptors() { - return Collections.singleton(getClass().getResource("/OSGI-INF/blueprint/blueprint.xml")); + protected String getBlueprintDescriptor() { + return "/OSGI-INF/blueprint/blueprint.xml"; } @Test - public void testDebugger() throws Exception { - // set mock expectations - getMockEndpoint("mock:a").expectedMessageCount(1); - - // send a message - template.sendBody("direct:start", "World"); + public void testRoute() throws Exception { + // the route is timer based, so every 5th second a message is send + // we should then expect at least one message + getMockEndpoint("mock:result").expectedMinimumMessageCount(1); - // assert mocks + // assert expectations assertMockEndpointsSatisfied(); } Modified: camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/resources/log4j.properties URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/resources/log4j.properties?rev=1234885&r1=1234884&r2=1234885&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/resources/log4j.properties (original) +++ camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/src/test/resources/log4j.properties Mon Jan 23 16:28:43 2012 @@ -18,11 +18,9 @@ # # The logging properties used for testing # -log4j.rootLogger=INFO, out +log4j.rootLogger=INFO, file -log4j.logger.org.springframework=WARN #log4j.logger.org.apache.camel=DEBUG -#log4j.logger.org.apache.camel.test.junit4=DEBUG # CONSOLE appender not used by default log4j.appender.out=org.apache.log4j.ConsoleAppender