當前位置: 首頁>>代碼示例>>Java>>正文


Java MockEndpoint.setResultMinimumWaitTime方法代碼示例

本文整理匯總了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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:26,代碼來源:SedaConcurrentTest.java

示例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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:9,代碼來源:DelayerAsyncDelayedTest.java

示例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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:9,代碼來源:DelayerTest.java

示例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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:9,代碼來源:DelayerTest.java

示例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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:15,代碼來源:AggregateTimeoutManualTest.java

示例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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:14,代碼來源:AggregateTimeoutOnlyTest.java

示例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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:14,代碼來源:SedaConcurrentTest.java

示例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();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:14,代碼來源:SedaConcurrentTest.java


注:本文中的org.apache.camel.component.mock.MockEndpoint.setResultMinimumWaitTime方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。