You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2009/02/02 19:54:58 UTC
svn commit: r740076 - in /camel/trunk/components/camel-spring/src/test:
java/org/apache/camel/spring/processor/scattergather/
resources/org/apache/camel/spring/processor/scattergather/
Author: janstey
Date: Mon Feb 2 18:54:58 2009
New Revision: 740076
URL: http://svn.apache.org/viewvc?rev=740076&view=rev
Log:
CAMEL-1173 - Add some snippets for wiki entry
Modified:
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/LowestQuoteAggregationStrategy.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/MyVendor.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/ScatterGatherTest.java
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/scattergather/scatter-gather.xml
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/LowestQuoteAggregationStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/LowestQuoteAggregationStrategy.java?rev=740076&r1=740075&r2=740076&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/LowestQuoteAggregationStrategy.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/LowestQuoteAggregationStrategy.java Mon Feb 2 18:54:58 2009
@@ -19,6 +19,7 @@
import org.apache.camel.Exchange;
import org.apache.camel.processor.aggregate.AggregationStrategy;
+// START SNIPPET: e1
public class LowestQuoteAggregationStrategy implements AggregationStrategy {
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
if (oldExchange.getIn().getBody(int.class) < newExchange.getIn().getBody(int.class)) {
@@ -27,4 +28,5 @@
return newExchange;
}
}
-}
\ No newline at end of file
+}
+// END SNIPPET: e1
\ No newline at end of file
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/MyVendor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/MyVendor.java?rev=740076&r1=740075&r2=740076&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/MyVendor.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/MyVendor.java Mon Feb 2 18:54:58 2009
@@ -21,6 +21,7 @@
import org.apache.camel.ProducerTemplate;
import org.apache.camel.language.XPath;
+//START SNIPPET: e1
public class MyVendor {
private int beerPrice;
@@ -39,4 +40,5 @@
throw new Exception("No quote available for " + item);
}
}
-}
\ No newline at end of file
+}
+//END SNIPPET: e1
\ No newline at end of file
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/ScatterGatherTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/ScatterGatherTest.java?rev=740076&r1=740075&r2=740076&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/ScatterGatherTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/scattergather/ScatterGatherTest.java Mon Feb 2 18:54:58 2009
@@ -30,12 +30,16 @@
public void testScatterAndGather() throws Exception {
MockEndpoint result = getMockEndpoint("mock:result");
result.expectedMessageCount(1);
+ // START SNIPPET: e1
result.expectedBodiesReceived(1); // expect the lowest quote
-
+ // END SNIPPET: e1
+
+ // START SNIPPET: e2
Map<String, Object> headers = new HashMap<String, Object>();
headers.put("listOfVendors", "bean:vendor1, bean:vendor2, bean:vendor3");
headers.put("quoteRequestId", "quoteRequest-1");
template.sendBodyAndHeaders("direct:start", "<quote_request item=\"beer\"/>", headers);
+ // END SNIPPET: e2
result.assertIsSatisfied();
}
Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/scattergather/scatter-gather.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/scattergather/scatter-gather.xml?rev=740076&r1=740075&r2=740076&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/scattergather/scatter-gather.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/scattergather/scatter-gather.xml Mon Feb 2 18:54:58 2009
@@ -22,7 +22,7 @@
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
">
- <!-- START SNIPPET: example -->
+ <!-- START SNIPPET: e1 -->
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="direct:start"/>
@@ -40,7 +40,9 @@
</aggregate>
</route>
</camelContext>
+ <!-- END SNIPPET: e1 -->
+ <!-- START SNIPPET: e2 -->
<bean id="aggregatorStrategy" class="org.apache.camel.spring.processor.scattergather.LowestQuoteAggregationStrategy"/>
<bean id="vendor1" class="org.apache.camel.spring.processor.scattergather.MyVendor">
@@ -60,5 +62,5 @@
<value>3</value>
</constructor-arg>
</bean>
- <!-- END SNIPPET: example -->
+ <!-- END SNIPPET: e2 -->
</beans>