Author: cmueller Date: Mon Apr 11 21:00:17 2011 New Revision: 1091208 URL: http://svn.apache.org/viewvc?rev=1091208&view=rev Log: fixed the osgi integration test for the aws-s3 component
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3IntegrationTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3Test.java camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelContext.xml camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelIntegrationContext.xml Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3IntegrationTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3IntegrationTest.java?rev=1091208&r1=1091207&r2=1091208&view=diff ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3IntegrationTest.java (original) +++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3IntegrationTest.java Mon Apr 11 21:00:17 2011 @@ -16,6 +16,12 @@ */ package org.apache.camel.itest.osgi.aws; +import static org.ops4j.pax.exam.CoreOptions.equinox; +import static org.ops4j.pax.exam.CoreOptions.felix; +import static org.ops4j.pax.exam.OptionUtils.combine; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory; + import java.io.InputStream; import org.apache.camel.EndpointInject; @@ -23,7 +29,6 @@ import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; import org.apache.camel.Message; import org.apache.camel.Processor; -import org.apache.camel.ProducerTemplate; import org.apache.camel.component.aws.s3.S3Constants; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.itest.osgi.OSGiIntegrationSpringTestSupport; @@ -36,19 +41,10 @@ import org.ops4j.pax.exam.junit.Configur import org.ops4j.pax.exam.junit.JUnit4TestRunner; import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; -import static org.ops4j.pax.exam.CoreOptions.equinox; -import static org.ops4j.pax.exam.CoreOptions.felix; -import static org.ops4j.pax.exam.OptionUtils.combine; -import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; -import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory; - @RunWith(JUnit4TestRunner.class) @Ignore("Test fails") public class AwsS3IntegrationTest extends OSGiIntegrationSpringTestSupport { - @EndpointInject(uri = "direct:start") - private ProducerTemplate template; - @EndpointInject(uri = "mock:result") private MockEndpoint result; @@ -61,7 +57,7 @@ public class AwsS3IntegrationTest extend public void sendInOnly() throws Exception { result.expectedMessageCount(1); - Exchange exchange = template.send("direct:start", ExchangePattern.InOnly, new Processor() { + Exchange exchange = template.send("direct:start-s3", ExchangePattern.InOnly, new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader(S3Constants.KEY, "CamelUnitTest"); exchange.getIn().setBody("This is my bucket content."); @@ -79,7 +75,7 @@ public class AwsS3IntegrationTest extend public void sendInOut() throws Exception { result.expectedMessageCount(1); - Exchange exchange = template.send("direct:start", ExchangePattern.InOut, new Processor() { + Exchange exchange = template.send("direct:start-s3", ExchangePattern.InOut, new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader(S3Constants.KEY, "CamelUnitTest"); exchange.getIn().setBody("This is my bucket content."); Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3Test.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3Test.java?rev=1091208&r1=1091207&r2=1091208&view=diff ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3Test.java (original) +++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/aws/AwsS3Test.java Mon Apr 11 21:00:17 2011 @@ -16,6 +16,12 @@ */ package org.apache.camel.itest.osgi.aws; +import static org.ops4j.pax.exam.CoreOptions.equinox; +import static org.ops4j.pax.exam.CoreOptions.felix; +import static org.ops4j.pax.exam.OptionUtils.combine; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory; + import java.io.InputStream; import org.apache.camel.EndpointInject; @@ -23,12 +29,10 @@ import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; import org.apache.camel.Message; import org.apache.camel.Processor; -import org.apache.camel.ProducerTemplate; import org.apache.camel.component.aws.s3.S3Constants; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.itest.osgi.OSGiIntegrationSpringTestSupport; import org.apache.karaf.testing.Helper; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; @@ -36,20 +40,10 @@ import org.ops4j.pax.exam.junit.Configur import org.ops4j.pax.exam.junit.JUnit4TestRunner; import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; -import static org.ops4j.pax.exam.CoreOptions.equinox; -import static org.ops4j.pax.exam.CoreOptions.felix; -import static org.ops4j.pax.exam.OptionUtils.combine; -import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; -import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory; - @RunWith(JUnit4TestRunner.class) -@Ignore("Test fails") public class AwsS3Test extends OSGiIntegrationSpringTestSupport { - @EndpointInject(uri = "direct:start") - private ProducerTemplate template; - - @EndpointInject(uri = "mock:result") + @EndpointInject(uri = "mock:result-s3") private MockEndpoint result; @Override @@ -61,7 +55,7 @@ public class AwsS3Test extends OSGiInteg public void sendInOnly() throws Exception { result.expectedMessageCount(1); - Exchange exchange = template.send("direct:start", ExchangePattern.InOnly, new Processor() { + Exchange exchange = template.send("direct:start-s3", ExchangePattern.InOnly, new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader(S3Constants.KEY, "CamelUnitTest"); exchange.getIn().setBody("This is my bucket content."); @@ -79,7 +73,7 @@ public class AwsS3Test extends OSGiInteg public void sendInOut() throws Exception { result.expectedMessageCount(1); - Exchange exchange = template.send("direct:start", ExchangePattern.InOut, new Processor() { + Exchange exchange = template.send("direct:start-s3", ExchangePattern.InOut, new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader(S3Constants.KEY, "CamelUnitTest"); exchange.getIn().setBody("This is my bucket content."); Modified: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelContext.xml URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelContext.xml?rev=1091208&r1=1091207&r2=1091208&view=diff ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelContext.xml (original) +++ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelContext.xml Mon Apr 11 21:00:17 2011 @@ -35,9 +35,21 @@ <from uri="direct:start-sns"/> <to uri="aws-sns://MyTopic?amazonSNSClient=#amazonSNSClient"/> </route> + + <route> + <from uri="direct:start-s3"/> + <to uri="aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client"/> + </route> + + <route> + <from uri="aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&maxMessagesPerPoll=5"/> + <to uri="mock:result-s3"/> + </route> </camelContext> <bean id="amazonSQSClient" class="org.apache.camel.itest.osgi.aws.AmazonSQSClientMock"/> <bean id="amazonSNSClient" class="org.apache.camel.itest.osgi.aws.AmazonSNSClientMock"/> + + <bean id="amazonS3Client" class="org.apache.camel.itest.osgi.aws.AmazonS3ClientMock"/> </beans> \ No newline at end of file Modified: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelIntegrationContext.xml URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelIntegrationContext.xml?rev=1091208&r1=1091207&r2=1091208&view=diff ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelIntegrationContext.xml (original) +++ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/aws/CamelIntegrationContext.xml Mon Apr 11 21:00:17 2011 @@ -35,5 +35,15 @@ <from uri="direct:start-sns"/> <to uri="aws-sns://MyTopic?accessKey=xxx&secretKey=yyy"/> </route> + + <route> + <from uri="direct:start-s3"/> + <to uri="aws-s3://mycamelbucket?accessKey=xxx&secretKey=yyy"/> + </route> + + <route> + <from uri="aws-s3://mycamelbucket?accessKey=xxx&secretKey=yyy&maxMessagesPerPoll=5"/> + <to uri="mock:result-s3"/> + </route> </camelContext> </beans> \ No newline at end of file