complexdatatypesdoclitbaretest.java

来自「开源的axis2框架的源码。用于开发WEBSERVER」· Java 代码 · 共 649 行 · 第 1/2 页

JAVA
649
字号
        input.setString(new String[]{"foo", "bar"});
        req.setInArrayString1D(input);
        ComplexDataTypesDocLitBareStub.RetArrayString1DResult ret = stub.retArrayString1D(req);
        assertNotNull(ret);
        assertNotNull(ret.getRetArrayString1DResult().getString());
        assertEquals(ret.getRetArrayString1DResult().getString().length, 2);
    }


    /**
     * Auto generated test method
     */
    public void testretSingle() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InSingle req = new ComplexDataTypesDocLitBareStub.InSingle();
        req.setInSingle(43.0f);
        float ret = stub.retSingle(req).getRetSingleResult();
        assertTrue(ret == 43.0f);
    }

    /**
     * Auto generated test method
     */
    public void testretDateTime() throws java.lang.Exception {

        Calendar input = Calendar.getInstance();
        ComplexDataTypesDocLitBareStub.InDateTime req = new ComplexDataTypesDocLitBareStub.InDateTime();
        req.setInDateTime(input);
        Calendar ret = stub.retDateTime(req).getRetDateTimeResult();
        assertNotNull(ret);
        assertEquals(ret, input);
    }

    /**
     * Auto generated test method
     */
    public void testretGuid() throws java.lang.Exception {

        String input = "12345";
        ComplexDataTypesDocLitBareStub.InGuid req = new ComplexDataTypesDocLitBareStub.InGuid();
        req.setInGuid(input);
        String ret = stub.retGuid(req).getRetGuidResult();
        assertEquals(ret, input);
    }

    /**
     * Auto generated test method
     */
    public void testretByteArray() throws java.lang.Exception {


        byte[] input = new byte[]{(byte) 0xDE, (byte) 0xAD, (byte) 0xBE, (byte) 0xEF};
        ComplexDataTypesDocLitBareStub.RetByteArray req = new ComplexDataTypesDocLitBareStub.RetByteArray();
        req.setInByteArray(new DataHandler(new ByteArrayDataSource(input)));
        DataHandler ret = stub.retByteArray(req).get_return();
        byte[] bytes = IOUtils.getStreamAsByteArray(ret.getInputStream());
        assertTrue(Arrays.equals(bytes, input));
    }

    /**
     * Auto generated test method
     */
    public void testretUri() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InUri req =
                new ComplexDataTypesDocLitBareStub.InUri();
        req.setInUri("124");
        assertNotNull(stub.retUri(req));
    }

    /**
     * Auto generated test method
     */
//    public void testretQName() throws java.lang.Exception {
//        FIXME: Why is QName being mapped to OMElement?
//        assertNull(stub.retQName(null));
//    }

//// TODO: FIXME: Need to figure out how to do enum's. Please don't remove this following section
////    /**
////     * Auto generated test method
////     */
////    public void testretEnumInt() throws java.lang.Exception {
////
////        org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub stub =
////                new org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub();
////
////        org.tempuri.complex.xsd.xsd.RetEnumInt retEnumInt126 =
////                (org.tempuri.complex.xsd.xsd.RetEnumInt) getTestObject(org.tempuri.complex.xsd.xsd.RetEnumInt.class);
////        // todo Fill in the retEnumInt126 here
////
////        assertNotNull(stub.retEnumInt(
////                getParam0(retEnumInt126)
////        ));
////
////
////    }
//
    public void testretLong() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InLong req = new ComplexDataTypesDocLitBareStub.InLong();
        req.setInLong(34);
        long ret = stub.retLong(req).getRetLongResult();
        assertEquals(34, ret);
    }

    //
    /**
     * Auto generated test method
     */
    public void testretUShort() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InUShort req = new ComplexDataTypesDocLitBareStub.InUShort();
        req.setInUShort(34);
        int ret = stub.retUShort(req).getRetUShortResult();
        assertEquals(34, ret);
    }

    /**
     * Auto generated test method
     */
    public void testretUInt() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InUInt req = new ComplexDataTypesDocLitBareStub.InUInt();
        req.setInUInt(34);
        long ret = stub.retUInt(req).getRetUIntResult();
        assertEquals(34, ret);
    }

    /**
     * Auto generated test method
     */
    public void testretByte() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InByte req = new ComplexDataTypesDocLitBareStub.InByte();
        req.setInByte((short) 34);
        short ret = stub.retByte(req).getRetByteResult();
        assertEquals((short) 34, ret);
    }

    /**
     * Auto generated test method
     */
    public void testretSByte() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InSByte req = new ComplexDataTypesDocLitBareStub.InSByte();
        req.setInSByte((byte) 34);
        byte ret = stub.retSByte(req).getRetSByteResult();
        assertEquals((byte) 34, ret);
    }

    /**
     * Auto generated test method
     */
    public void testretShort() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InShort req = new ComplexDataTypesDocLitBareStub.InShort();
        req.setInShort((short) 34);
        short ret = stub.retShort(req).getRetShortResult();

        assertEquals((short) 34, ret);
    }

    //
    /**
     * Auto generated test method
     */
    public void testretObject() throws java.lang.Exception {

        OMFactory factory = OMAbstractFactory.getOMFactory();
        // lets create the namespace object of the Article element
        OMNamespace ns = factory.createOMNamespace("http://www.ibm.com/developerworks/library/ws-axis2soap/index.html", "article");
        // now create the Article element with the above namespace
        OMElement articleElement = factory.createOMElement("Article", ns);

        ComplexDataTypesDocLitBareStub.InObject req = new ComplexDataTypesDocLitBareStub.InObject();
        req.setInObject(articleElement);
        OMElement ret = stub.retObject(req).getRetObjectResult();
        assertNotNull(ret);
        assertEquals(ret.toString(), articleElement.toString());
    }

    /**
     * Auto generated test method
     */
    public void testretFloat() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InFloat req = new ComplexDataTypesDocLitBareStub.InFloat();
        req.setInFloat((float) 34);
        float ret = stub.retFloat(req).getRetFloatResult();
        assertTrue(ret == 34);
    }

    /**
     * Auto generated test method
     */
    public void testretDouble() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InDouble req = new ComplexDataTypesDocLitBareStub.InDouble();
        req.setInDouble(34);
        double ret = stub.retDouble(req).getRetDoubleResult();
        assertTrue(ret == 34);
    }

    /**
     * Auto generated test method
     */
    public void testretBool() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InBool req =
                new ComplexDataTypesDocLitBareStub.InBool();
        req.setInBool(true);
        boolean ret = stub.retBool(req).getRetBoolResult();
        assertTrue(ret);
    }

    /**
     * Auto generated test method
     */
    public void testretDecimal() throws java.lang.Exception {

        BigDecimal input = new BigDecimal(12334);
        ComplexDataTypesDocLitBareStub.InDecimal req = new ComplexDataTypesDocLitBareStub.InDecimal();
        req.setInDecimal(input);
        BigDecimal ret = stub.retDecimal(req).getRetDecimalResult();
        assertNotNull(ret);
        assertEquals(ret, input);
    }

// TODO: FIXME: Need to figure out how to do enum's. Please don't remove this following section
////    /**
////     * Auto generated test method
////     */
////    public void testretEnumString() throws java.lang.Exception {
////
////        org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub stub =
////                new org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub();
////
////        org.tempuri.complex.xsd.xsd.RetEnumString retEnumString198 =
////                (org.tempuri.complex.xsd.xsd.RetEnumString) getTestObject(org.tempuri.complex.xsd.xsd.RetEnumString.class);
////        // todo Fill in the retEnumString198 here
////
////        assertNotNull(stub.retEnumString(
////                getParam0(retEnumString198)
////        ));
////
////
////    }

    //
    /**
     * Auto generated test method
     */
    public void testretInt() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InInt req = new ComplexDataTypesDocLitBareStub.InInt();
        req.setInInt(34);
        int ret = stub.retInt(req).getRetIntResult();
        assertEquals((int) 34, ret);
    }

    /**
     * Auto generated test method
     */
    public void testretInts() throws java.lang.Exception {

        int[] input = new int[]{34, 45};
        ComplexDataTypesDocLitBareStub.RetInts req = new ComplexDataTypesDocLitBareStub.RetInts();
        req.setInInt(input);
        int ret[] = stub.retInts(req).get_return();
        assertTrue(Arrays.equals(input, ret));
    }

    /**
     * Auto generated test method
     */
    public void testretChar() throws java.lang.Exception {
        ComplexDataTypesDocLitBareStub.InChar req = new ComplexDataTypesDocLitBareStub.InChar();
        req.setInChar(34);
        int ret = stub.retChar(req).getRetCharResult();
        assertEquals(34, ret);
    }

    /**
     * Auto generated test method
     */
    public void testretString() throws java.lang.Exception {
        String input = "Abracadabra";
        ComplexDataTypesDocLitBareStub.InString req = new ComplexDataTypesDocLitBareStub.InString();
        req.setInString(input);
        String ret = stub.retString(req).getRetStringResult();
        assertNotNull(ret);
        assertEquals(input, ret);
    }

    /**
     * Auto generated test method
     */
    public void testretStrings() throws java.lang.Exception {

        String[] ret;
        String[] input = new String[]{"Abracadabra"};
        ComplexDataTypesDocLitBareStub.RetStrings req = new ComplexDataTypesDocLitBareStub.RetStrings();
        req.setInString(input);
        ret = stub.retStrings(req).get_return();
        assertNotNull(ret);
        ret = stub.retStrings(req).get_return();
        assertNotNull(ret);
        assertTrue(Arrays.equals(input, ret));
        input = new String[]{"Abracadabra", null, "abc"};
        req.setInString(input);
        ret = stub.retStrings(req).get_return();
        assertNotNull(ret);
        assertTrue(Arrays.equals(input, ret));

        input = new String[]{};
        req.setInString(input);
        ret = stub.retStrings(req).get_return();
        assertNull(ret);
    }

    /**
     * Auto generated test method
     */
    public void testretULong() throws java.lang.Exception {

        BigInteger input = new BigInteger("34");
        ComplexDataTypesDocLitBareStub.InULong req = new ComplexDataTypesDocLitBareStub.InULong();
        req.setInULong(input);
        BigInteger ret = stub.retULong(req).getRetULongResult();
        assertEquals(input, ret);
    }


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?