You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/11/12 13:41:10 UTC
svn commit: r1408263 - in /camel/branches/camel-2.10.x: ./
camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java
Author: davsclaus
Date: Mon Nov 12 12:41:09 2012
New Revision: 1408263
URL: http://svn.apache.org/viewvc?rev=1408263&view=rev
Log:
Fixed test
Modified:
camel/branches/camel-2.10.x/ (props changed)
camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1408262
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java?rev=1408263&r1=1408262&r2=1408263&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java Mon Nov 12 12:41:09 2012
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.direct.DirectEndpoint;
import org.apache.camel.component.mock.MockEndpoint;
@@ -36,6 +37,8 @@ import org.apache.camel.component.mock.M
public class SamplingThrottlerTest extends ContextTestSupport {
public void testSamplingFromExchangeStream() throws Exception {
+ NotifyBuilder notify = new NotifyBuilder(context).whenDone(15).create();
+
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(2);
mock.setResultWaitTime(3000);
@@ -43,11 +46,15 @@ public class SamplingThrottlerTest exten
List<Exchange> sentExchanges = new ArrayList<Exchange>();
sendExchangesThroughDroppingThrottler(sentExchanges, 15);
+ notify.matchesMockWaitTime();
mock.assertIsSatisfied();
+
validateDroppedExchanges(sentExchanges, mock.getReceivedCounter());
}
public void testBurstySampling() throws Exception {
+ NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
+
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(2);
mock.setResultWaitTime(3000);
@@ -61,7 +68,9 @@ public class SamplingThrottlerTest exten
// send another 5 now
sendExchangesThroughDroppingThrottler(sentExchanges, 5);
+ notify.matchesMockWaitTime();
mock.assertIsSatisfied();
+
validateDroppedExchanges(sentExchanges, mock.getReceivedCounter());
}
@@ -88,7 +97,7 @@ public class SamplingThrottlerTest exten
executor.shutdownNow();
}
- public void testSamplingUsingmessageFrequency() throws Exception {
+ public void testSamplingUsingMessageFrequency() throws Exception {
long totalMessages = 100;
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(10);
@@ -101,7 +110,7 @@ public class SamplingThrottlerTest exten
mock.assertIsSatisfied();
}
- public void testSamplingUsingmessageFrequencyViaDSL() throws Exception {
+ public void testSamplingUsingMessageFrequencyViaDSL() throws Exception {
long totalMessages = 50;
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(10);