本文整理匯總了Java中org.apache.camel.component.mock.MockEndpoint.setResultMinimumWaitTime方法的典型用法代碼示例。如果您正苦於以下問題:Java MockEndpoint.setResultMinimumWaitTime方法的具體用法?Java MockEndpoint.setResultMinimumWaitTime怎麽用?Java MockEndpoint.setResultMinimumWaitTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.camel.component.mock.MockEndpoint
的用法示例。
在下文中一共展示了MockEndpoint.setResultMinimumWaitTime方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testSedaConcurrentInOut
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void testSedaConcurrentInOut() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(20);
mock.allMessages().body().startsWith("Bye");
// should at least take 3 sec
mock.setResultMinimumWaitTime(3000);
ExecutorService executors = Executors.newFixedThreadPool(10);
List<Object> replies = new ArrayList<Object>(20);
for (int i = 0; i < 20; i++) {
final int num = i;
Object out = executors.submit(new Callable<Object>() {
public Object call() throws Exception {
return template.requestBody("seda:bar", "Message " + num);
}
});
replies.add(out);
}
assertMockEndpointsSatisfied();
assertEquals(20, replies.size());
executors.shutdownNow();
}
示例2: testDelayConstant
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void testDelayConstant() throws Exception {
MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
resultEndpoint.expectedMessageCount(1);
// should at least take 1 sec to complete
resultEndpoint.setResultMinimumWaitTime(900);
template.sendBody("seda:b", "<hello>world!</hello>");
resultEndpoint.assertIsSatisfied();
}
示例3: testDelayBean
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void testDelayBean() throws Exception {
MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
resultEndpoint.expectedMessageCount(1);
// should at least take 1 sec to complete
resultEndpoint.setResultMinimumWaitTime(900);
template.sendBody("seda:c", "<hello>world!</hello>");
resultEndpoint.assertIsSatisfied();
}
示例4: testExchangeAwareDelayBean
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void testExchangeAwareDelayBean() throws Exception {
MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
resultEndpoint.expectedMessageCount(1);
// should at least take 1 sec to complete
resultEndpoint.setResultMinimumWaitTime(900);
template.sendBodyAndHeader("seda:d", "<hello>world!</hello>", BEAN_DELAYER_HEADER, 1000);
resultEndpoint.assertIsSatisfied();
}
示例5: xxxtestAggregateTimeoutManual
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void xxxtestAggregateTimeoutManual() throws Exception {
MockEndpoint result = getMockEndpoint("mock:result");
// by default the use latest aggregation strategy
result.expectedBodiesReceived("Message 1999");
// should take at least 3 seconds to complete this one
result.setResultMinimumWaitTime(2500);
for (int i = 0; i < 2000; i++) {
template.sendBodyAndHeader("direct:start", "Message " + i, "id", "1");
Thread.sleep(3);
}
assertMockEndpointsSatisfied();
}
示例6: testAggregateTimeoutOnly
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void testAggregateTimeoutOnly() throws Exception {
MockEndpoint result = getMockEndpoint("mock:result");
// by default the use latest aggregation strategy is used so we get message 9
result.expectedBodiesReceived("Message 9");
// should take 3 seconds to complete this one
result.setResultMinimumWaitTime(2500);
for (int i = 0; i < 10; i++) {
template.sendBodyAndHeader("direct:start", "Message " + i, "id", "1");
}
assertMockEndpointsSatisfied();
}
示例7: testSedaConcurrentInOnly
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void testSedaConcurrentInOnly() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(20);
// should at least take 3 sec
mock.setResultMinimumWaitTime(3000);
for (int i = 0; i < 20; i++) {
template.sendBody("seda:foo", "Message " + i);
}
assertMockEndpointsSatisfied();
}
示例8: testSedaConcurrentInOnlyWithAsync
import org.apache.camel.component.mock.MockEndpoint; //導入方法依賴的package包/類
public void testSedaConcurrentInOnlyWithAsync() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(20);
// should at least take 3 sec
mock.setResultMinimumWaitTime(3000);
for (int i = 0; i < 20; i++) {
template.asyncSendBody("seda:foo", "Message " + i);
}
assertMockEndpointsSatisfied();
}