Search in sources :

Example 1 with NestedArray

use of org.apache.type_test.types1.NestedArray in project cxf by apache.

the class AbstractTypeTestClient2 method testNestedArray.

// org.apache.type_test.types1.NestedArray
@Test
public void testNestedArray() throws Exception {
    if (!shouldRunTest("NestedArray")) {
        return;
    }
    String[][] xs = { { "AAA", "BBB", "CCC" }, { "aaa", "bbb", "ccc" }, { "a_a_a", "b_b_b", "c_c_c" } };
    String[][] ys = { { "XXX", "YYY", "ZZZ" }, { "xxx", "yyy", "zzz" }, { "x_x_x", "y_y_y", "z_z_z" } };
    NestedArray x = new NestedArray();
    NestedArray yOrig = new NestedArray();
    List<UnboundedArray> xList = x.getSubarray();
    List<UnboundedArray> yList = yOrig.getSubarray();
    for (int i = 0; i < 3; i++) {
        UnboundedArray xx = new UnboundedArray();
        xx.getItem().addAll(Arrays.asList(xs[i]));
        xList.add(xx);
        UnboundedArray yy = new UnboundedArray();
        yy.getItem().addAll(Arrays.asList(ys[i]));
        yList.add(yy);
    }
    Holder<NestedArray> y = new Holder<NestedArray>(yOrig);
    Holder<NestedArray> z = new Holder<NestedArray>();
    NestedArray ret;
    if (testDocLiteral) {
        ret = docClient.testNestedArray(x, y, z);
    } else if (testXMLBinding) {
        ret = xmlClient.testNestedArray(x, y, z);
    } else {
        ret = rpcClient.testNestedArray(x, y, z);
    }
    if (!perfTestOnly) {
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                assertEquals("testNestedArray(): Incorrect value for inout param", x.getSubarray().get(i).getItem().get(j), y.value.getSubarray().get(i).getItem().get(j));
                assertEquals("testNestedArray(): Incorrect value for out param", yOrig.getSubarray().get(i).getItem().get(j), z.value.getSubarray().get(i).getItem().get(j));
                assertEquals("testNestedArray(): Incorrect return value", x.getSubarray().get(i).getItem().get(j), ret.getSubarray().get(i).getItem().get(j));
            }
        }
    }
}
Also used : NestedArray(org.apache.type_test.types1.NestedArray) Holder(javax.xml.ws.Holder) UnboundedArray(org.apache.type_test.types1.UnboundedArray) Test(org.junit.Test)

Aggregations

Holder (javax.xml.ws.Holder)1 NestedArray (org.apache.type_test.types1.NestedArray)1 UnboundedArray (org.apache.type_test.types1.UnboundedArray)1 Test (org.junit.Test)1