camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1293005 - /camel/trunk/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/integration/S3ComponentIntegrationTest.java
Date Thu, 23 Feb 2012 22:53:06 GMT
Author: cmueller
Date: Thu Feb 23 22:53:06 2012
New Revision: 1293005

URL: http://svn.apache.org/viewvc?rev=1293005&view=rev
Log:
added test for user forum issue

Modified:
    camel/trunk/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/integration/S3ComponentIntegrationTest.java

Modified: camel/trunk/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/integration/S3ComponentIntegrationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/integration/S3ComponentIntegrationTest.java?rev=1293005&r1=1293004&r2=1293005&view=diff
==============================================================================
--- camel/trunk/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/integration/S3ComponentIntegrationTest.java
(original)
+++ camel/trunk/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/integration/S3ComponentIntegrationTest.java
Thu Feb 23 22:53:06 2012
@@ -42,11 +42,18 @@ public class S3ComponentIntegrationTest 
     
     @Test
     public void sendInOnly() throws Exception {
-        result.expectedMessageCount(1);
+        result.expectedMessageCount(2);
         
-        Exchange exchange = template.send("direct:start", ExchangePattern.InOnly, new Processor()
{
+        Exchange exchange1 = template.send("direct:start", ExchangePattern.InOnly, new Processor()
{
             public void process(Exchange exchange) throws Exception {
-                exchange.getIn().setHeader(S3Constants.KEY, "CamelUnitTest");
+                exchange.getIn().setHeader(S3Constants.KEY, "CamelUnitTest1");
+                exchange.getIn().setBody("This is my bucket content.");
+            }
+        });
+        
+        Exchange exchange2 = template.send("direct:start", ExchangePattern.InOnly, new Processor()
{
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(S3Constants.KEY, "CamelUnitTest2");
                 exchange.getIn().setBody("This is my bucket content.");
             }
         });
@@ -54,8 +61,10 @@ public class S3ComponentIntegrationTest 
         assertMockEndpointsSatisfied();
         
         assertResultExchange(result.getExchanges().get(0));
+        assertResultExchange(result.getExchanges().get(1));
         
-        assertResponseMessage(exchange.getIn());
+        assertResponseMessage(exchange1.getIn());
+        assertResponseMessage(exchange2.getIn());
     }
 
     @Test
@@ -80,7 +89,7 @@ public class S3ComponentIntegrationTest 
         assertIsInstanceOf(InputStream.class, resultExchange.getIn().getBody());
         assertEquals("This is my bucket content.", resultExchange.getIn().getBody(String.class));
         assertEquals("mynewcamelbucket", resultExchange.getIn().getHeader(S3Constants.BUCKET_NAME));
-        assertEquals("CamelUnitTest", resultExchange.getIn().getHeader(S3Constants.KEY));
+        assertTrue(resultExchange.getIn().getHeader(S3Constants.KEY, String.class).startsWith("CamelUnitTest"));
         assertNull(resultExchange.getIn().getHeader(S3Constants.VERSION_ID)); // not enabled
on this bucket
         assertNotNull(resultExchange.getIn().getHeader(S3Constants.LAST_MODIFIED));
         assertEquals("3a5c8b1ad448bca04584ecb55b836264", resultExchange.getIn().getHeader(S3Constants.E_TAG));



Mime
View raw message