コード例 #1
0
  /** Test for array types */
  protected void basicArrayInputTypes() {
    TestUtils.showMessage(this.epr + " - arrayInputTypes");
    List<List<String>> params = new ArrayList<List<String>>();
    params.add(this.getList("country", "USA"));
    params.add(this.getList("state", "CA"));
    params.add(this.getList("state", "MA"));
    params.add(this.getList("creditLimit", "50000"));
    params.add(this.getList("city", "San Rafael"));
    params.add(this.getList("city", "San Francisco"));
    params.add(this.getList("city", "San Diego"));
    params.add(this.getList("city", "Los Angeles"));
    params.add(this.getList("city", "Brisbane"));
    params.add(this.getList("contactFirstName", "Julie"));
    try {
      OMElement result = TestUtils.callOperationWithArray(this.epr, "basic_array_type_op", params);
      assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
      String val =
          TestUtils.getFirstValue(
              result, "/Customers/Customer/customerNumber", TestUtils.DEFAULT_DS_WS_NAMESPACE);
      assertTrue(Integer.parseInt(val) > 0);
    } catch (Exception e) {

      e.printStackTrace();
      fail(e.getMessage());
    }
  }
コード例 #2
0
 /** Test with a simple select statement with attributes. */
 protected void basicSelectWithAttributes() {
   TestUtils.showMessage(this.epr + " - basicSelectWithAttributes");
   try {
     OMElement result = TestUtils.callOperation(this.epr, "select_attributes_op", null);
     assertTrue(TestUtils.validateResultStructure(result, TestUtils.PAYMENTS_XSD_PATH));
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
コード例 #3
0
 /** Test with a simple select statement with the given fields. */
 protected void basicSelectWithFields() {
   TestUtils.showMessage(this.epr + " - basicSelectWithFields");
   try {
     OMElement result = TestUtils.callOperation(this.epr, "select_op_given_fields", null);
     assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
コード例 #4
0
 public void testExcelOldNoInts() {
   TestUtils.showMessage(this.epr + " - testExcelOldNoInts");
   try {
     TestUtils.checkForService(this.epr);
     OMElement result = TestUtils.callOperation(this.epr, "customers_old_no_ints_op", null);
     assertTrue(TestUtils.validateResultStructure(result, TestUtils.OFFICES_XSD_PATH));
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
コード例 #5
0
 /** Test Excel 2007 file datasource */
 public void testExcelNewFormatNoHeader() {
   TestUtils.showMessage(this.epr + " - testExcelNewFormatNoHeader");
   try {
     TestUtils.checkForService(this.epr);
     OMElement result = TestUtils.callOperation(this.epr, "excel_new_op", null);
     assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
コード例 #6
0
 /** Test with a simple select statement to get a row count. */
 protected void basicSelectCount() {
   TestUtils.showMessage(this.epr + " - basicSelectCount");
   try {
     OMElement result = TestUtils.callOperation(this.epr, "select_op_count", null);
     assertTrue(TestUtils.validateResultStructure(result, TestUtils.ORDER_COUNT_XSD_PATH));
     String val =
         TestUtils.getFirstValue(
             result, "/Orders/OrderDetails/orderDetailsCount", TestUtils.DEFAULT_DS_WS_NAMESPACE);
     assertTrue(Integer.parseInt(val) > 0);
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
コード例 #7
0
  protected void basicDecimalOutputType() {
    TestUtils.showMessage(this.epr + " - decimalOutputTypes");
    try {
      OMElement result = TestUtils.callOperation(this.epr, "basic_decimal_type_op", null);
      String val =
          TestUtils.getFirstValue(
              result, "/Salary/EmpSalaryInfo/employeeSalary", TestUtils.DEFAULT_DS_WS_NAMESPACE);
      assertTrue(val.equals(TestUtils.DECIMAL_RESULT_VALUE));
    } catch (Exception e) {

      e.printStackTrace();
      fail(e.getMessage());
    }
  }
コード例 #8
0
 /** Test to merge data from several call-query statements in an operation */
 @SuppressWarnings("unchecked")
 protected void basicCallQueryMerge() {
   TestUtils.showMessage(this.epr + " - basicCallQueryMerge");
   try {
     OMElement result = TestUtils.callOperation(this.epr, "basic_merge_op", null);
     assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
     int c = 0;
     Iterator<OMElement> elItr = result.getChildrenWithName(new QName("Customer"));
     while (elItr.hasNext()) {
       assertNotNull(elItr.next());
       c++;
     }
     assertTrue(c == 5);
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }