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 2D4A0788D for ; Sun, 7 Aug 2011 18:58:10 +0000 (UTC) Received: (qmail 1491 invoked by uid 500); 7 Aug 2011 18:58:10 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 1460 invoked by uid 500); 7 Aug 2011 18:58: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 1452 invoked by uid 99); 7 Aug 2011 18:58:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2011 18:58: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; Sun, 07 Aug 2011 18:58:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DFD862388903 for ; Sun, 7 Aug 2011 18:57:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1154748 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/test/ camel-core/src/main/resources/META-INF/services/org/apache/camel/component/ camel-core/src/test/data/ camel-core/src/test/java/org/apache/camel/component/... Date: Sun, 07 Aug 2011 18:57:43 -0000 To: commits@camel.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110807185743.DFD862388903@eris.apache.org> Author: davsclaus Date: Sun Aug 7 18:57:42 2011 New Revision: 1154748 URL: http://svn.apache.org/viewvc?rev=1154748&view=rev Log: CAMEL-4031: resource based components no longer depend on Spring JARs. Added: camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/ - copied from r1154746, camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/ camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/test camel/trunk/camel-core/src/test/data/message1.xml - copied unchanged from r1154746, camel/trunk/components/camel-spring/src/test/data/message1.xml camel/trunk/camel-core/src/test/data/message2.xml - copied unchanged from r1154746, camel/trunk/components/camel-spring/src/test/data/message2.xml camel/trunk/camel-core/src/test/java/org/apache/camel/component/test/ camel/trunk/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/SpringTestEndpointTest.java (contents, props changed) - copied, changed from r1154746, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml (contents, props changed) - copied, changed from r1154746, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/TestEndpointTest-context.xml Removed: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/ camel/trunk/components/camel-spring/src/main/resources/META-INF/services/org/apache/camel/component/test camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/TestEndpointTest-context.xml Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/package.html Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java?rev=1154748&r1=1154746&r2=1154748&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java Sun Aug 7 18:57:42 2011 @@ -48,10 +48,12 @@ public class TestEndpoint extends MockEn @Override protected void doStart() throws Exception { LOG.debug("Consuming expected messages from: {}", expectedMessageEndpoint); + final List expectedBodies = new ArrayList(); EndpointHelper.pollEndpoint(expectedMessageEndpoint, new Processor() { public void process(Exchange exchange) throws Exception { Object body = getInBody(exchange); + LOG.trace("Received message body {}", body); expectedBodies.add(body); } }, timeout); Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/package.html URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/package.html?rev=1154748&r1=1154746&r2=1154748&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/package.html (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/test/package.html Sun Aug 7 18:57:42 2011 @@ -19,7 +19,7 @@ -A Test Endpoint for Pattern Based Testing +A Test Endpoint for Pattern Based Testing Added: camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/test URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/test?rev=1154748&view=auto ============================================================================== --- camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/test (added) +++ camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/component/test Sun Aug 7 18:57:42 2011 @@ -0,0 +1,18 @@ +# +# 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. +# + +class=org.apache.camel.component.test.TestComponent \ No newline at end of file Added: camel/trunk/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java?rev=1154748&view=auto ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java (added) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java Sun Aug 7 18:57:42 2011 @@ -0,0 +1,50 @@ +/** + * 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.test; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; + +/** + * + */ +public class TestEndpointTest extends ContextTestSupport { + + public void testMocksAreValid() throws Exception { + // perform the test, and send in 2 messages we expect + Thread.sleep(500); + template.sendBody("seda:foo", "Hello World"); + template.sendBody("seda:foo", "Bye World"); + + assertMockEndpointsSatisfied(); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + // send 2 bodies to the seda:foo which is the messages we expect + template.sendBody("seda:foo", "Hello World"); + template.sendBody("seda:foo", "Bye World"); + + from("seda:foo") + .to("test:seda:foo"); + } + }; + } +} Copied: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/SpringTestEndpointTest.java (from r1154746, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java) URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/SpringTestEndpointTest.java?p2=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/SpringTestEndpointTest.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java&r1=1154746&r2=1154748&rev=1154748&view=diff ============================================================================== --- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java (original) +++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/SpringTestEndpointTest.java Sun Aug 7 18:57:42 2011 @@ -17,22 +17,16 @@ package org.apache.camel.component.test; import org.apache.camel.CamelContext; -import org.apache.camel.component.mock.MockEndpoint; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests; + +import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext; /** * @version */ -@ContextConfiguration -public class TestEndpointTest extends AbstractJUnit38SpringContextTests { - - @Autowired - protected CamelContext camelContext; +public class SpringTestEndpointTest extends TestEndpointTest { - public void testMocksAreValid() throws Exception { - assertNotNull(camelContext); - MockEndpoint.assertIsSatisfied(camelContext); + protected CamelContext createCamelContext() throws Exception { + return createSpringCamelContext(this, "org/apache/camel/component/test/SpringTestEndpointTest.xml"); } + } Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/SpringTestEndpointTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/SpringTestEndpointTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml (from r1154746, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/TestEndpointTest-context.xml) URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/TestEndpointTest-context.xml&r1=1154746&r2=1154748&rev=1154748&view=diff ============================================================================== --- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/TestEndpointTest-context.xml (original) +++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml Sun Aug 7 18:57:42 2011 @@ -25,8 +25,8 @@ - - + + Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/test/SpringTestEndpointTest.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml