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


Java InputOrder.setCustomerId方法代碼示例

本文整理匯總了Java中camelinaction.order.InputOrder.setCustomerId方法的典型用法代碼示例。如果您正苦於以下問題:Java InputOrder.setCustomerId方法的具體用法?Java InputOrder.setCustomerId怎麽用?Java InputOrder.setCustomerId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在camelinaction.order.InputOrder的用法示例。


在下文中一共展示了InputOrder.setCustomerId方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testOrderOk

import camelinaction.order.InputOrder; //導入方法依賴的package包/類
@Test
public void testOrderOk() throws Exception {
    // there should be 0 row in the database when we start
    int rows = jdbc.queryForObject("select count(*) from riders_order", Integer.class);
    assertEquals(0, rows);

    InputOrder input = new InputOrder();
    input.setCustomerId("4444");
    input.setRefNo("57123");
    input.setPartId("333");
    input.setAmount("50");

    // give CXF time to wake up
    Thread.sleep(2000);

    OutputOrder reply = template.requestBody("cxf:bean:orderEndpoint", input, OutputOrder.class);
    assertEquals("OK", reply.getCode());

    // there should be 1 row in the database with the inserted order
    rows = jdbc.queryForObject("select count(*) from riders_order", Integer.class);
    assertEquals(1, rows);
}
 
開發者ID:camelinaction,項目名稱:camelinaction2,代碼行數:23,代碼來源:OrderTest.java

示例2: testOrderFailOnce

import camelinaction.order.InputOrder; //導入方法依賴的package包/類
@Test
public void testOrderFailOnce() throws Exception {
    // there should be 0 row in the database when we start
    int rows = jdbc.queryForObject("select count(*) from riders_order", Integer.class);
    assertEquals(0, rows);

    InputOrder input = new InputOrder();
    input.setCustomerId("4444");
    // by using FAIL-ONCE as ref no we simulate failure in first processing
    input.setRefNo("FAIL-ONCE");
    input.setPartId("333");
    input.setAmount("50");

    // give CXF time to wake up
    Thread.sleep(2000);

    OutputOrder reply = template.requestBody("cxf:bean:orderEndpoint", input, OutputOrder.class);
    assertEquals("OK", reply.getCode());

    // there should be 1 row in the database with the inserted order
    rows = jdbc.queryForObject("select count(*) from riders_order", Integer.class);
    assertEquals(1, rows);
}
 
開發者ID:camelinaction,項目名稱:camelinaction2,代碼行數:24,代碼來源:OrderTest.java

示例3: testOrderFailAll

import camelinaction.order.InputOrder; //導入方法依賴的package包/類
@Test
public void testOrderFailAll() throws Exception {
    // there should be 0 row in the database when we start
    int rows = jdbc.queryForObject("select count(*) from riders_order", Integer.class);
    assertEquals(0, rows);

    InputOrder input = new InputOrder();
    input.setCustomerId("4444");
    // by using FATAL as ref no we simulate failure in all processing
    input.setRefNo("FATAL");
    input.setPartId("333");
    input.setAmount("50");

    // give CXF time to wake up
    Thread.sleep(2000);

    OutputOrder reply = template.requestBody("cxf:bean:orderEndpoint", input, OutputOrder.class);
    assertEquals("ERROR: Simulated fatal error", reply.getCode());

    // there should still be 0 row in the database as the entire route was rolled back
    rows = jdbc.queryForObject("select count(*) from riders_order", Integer.class);
    assertEquals(0, rows);
}
 
開發者ID:camelinaction,項目名稱:camelinaction2,代碼行數:24,代碼來源:OrderTest.java

示例4: testOrderOk

import camelinaction.order.InputOrder; //導入方法依賴的package包/類
@Test
public void testOrderOk() throws Exception {
    // there should be 0 row in the database when we start
    assertEquals(0, jdbc.queryForInt("select count(*) from riders_order"));

    InputOrder input = new InputOrder();
    input.setCustomerId("4444");
    input.setRefNo("57123");
    input.setPartId("333");
    input.setAmount("50");

    // give CXF time to wake up
    Thread.sleep(2000);

    OutputOrder reply = template.requestBody("cxf:bean:orderEndpoint", input, OutputOrder.class);
    assertEquals("OK", reply.getCode());

    // there should be 1 row in the database with the inserted order
    assertEquals(1, jdbc.queryForInt("select count(*) from riders_order"));
}
 
開發者ID:camelinaction,項目名稱:camelinaction,代碼行數:21,代碼來源:OrderTest.java

示例5: testOrderFailOnce

import camelinaction.order.InputOrder; //導入方法依賴的package包/類
@Test
public void testOrderFailOnce() throws Exception {
    // there should be 0 row in the database when we start
    assertEquals(0, jdbc.queryForInt("select count(*) from riders_order"));

    InputOrder input = new InputOrder();
    input.setCustomerId("4444");
    // by using FAIL-ONCE as ref no we simulate failure in first processing
    input.setRefNo("FAIL-ONCE");
    input.setPartId("333");
    input.setAmount("50");

    // give CXF time to wake up
    Thread.sleep(2000);

    OutputOrder reply = template.requestBody("cxf:bean:orderEndpoint", input, OutputOrder.class);
    assertEquals("OK", reply.getCode());

    // there should be 1 row in the database with the inserted order
    assertEquals(1, jdbc.queryForInt("select count(*) from riders_order"));
}
 
開發者ID:camelinaction,項目名稱:camelinaction,代碼行數:22,代碼來源:OrderTest.java

示例6: testOrderFailAll

import camelinaction.order.InputOrder; //導入方法依賴的package包/類
@Test
public void testOrderFailAll() throws Exception {
    // there should be 0 row in the database when we start
    assertEquals(0, jdbc.queryForInt("select count(*) from riders_order"));

    InputOrder input = new InputOrder();
    input.setCustomerId("4444");
    // by using FATAL as ref no we simulate failure in all processing
    input.setRefNo("FATAL");
    input.setPartId("333");
    input.setAmount("50");

    // give CXF time to wake up
    Thread.sleep(2000);

    OutputOrder reply = template.requestBody("cxf:bean:orderEndpoint", input, OutputOrder.class);
    assertEquals("ERROR: Simulated fatal error", reply.getCode());

    // there should still be 0 row in the database as the entire route was rolled back
    assertEquals(0, jdbc.queryForInt("select count(*) from riders_order"));
}
 
開發者ID:camelinaction,項目名稱:camelinaction,代碼行數:22,代碼來源:OrderTest.java


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