complexdatatypescomplexdatatypessoap11test.java

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

JAVA
610
字号
//        assertNull(stub.retEnumString(null));
//        BitMask input = new BitMask();
//        assertNull(stub.retEnumString(new BitMask()));
//    }


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

        assertNull(stub.retStructS1(null));
        assertNotNull(stub.retStructS1(new Name()));
        Name input = new Name();
        input.setName("ewrterty");
        assertNotNull(stub.retStructS1(input));
    }

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


        assertNull(stub.retArrayString1D(null));
        assertNotNull(stub.retArrayString1D(new ArrayOfstring()));
        ArrayOfstring input = new ArrayOfstring();
        input.setString(new String[]{"foo", "bar"});
        ArrayOfstring ret = stub.retArrayString1D(input);
        assertNotNull(ret);
        assertNotNull(ret.getString());
        assertEquals(ret.getString().length, 2);
    }


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

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

        Calendar input = Calendar.getInstance();
        Calendar ret = stub.retDateTime(input);
        assertNotNull(ret);
        assertEquals(ret, input);
    }

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

        String input = "12345";
        String ret = stub.retGuid(input);
        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};
        DataHandler ret = stub.retByteArray(new DataHandler(new ByteArrayDataSource(input)));
        byte[] bytes = IOUtils.getStreamAsByteArray(ret.getInputStream());
        assertTrue(Arrays.equals(bytes, input));
    }

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


        assertNotNull(stub.retUri("124"));
    }

    /**
     * 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 {
        long ret = stub.retLong(34);
        assertEquals(34, ret);
    }

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

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

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

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

    /**
     * Auto generated test method
     */
    public void testretShort() throws java.lang.Exception {
        short ret = stub.retShort((short)34);
        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.serverside.com/articles/introducingAxiom", "article");
        // now create the Article element with the above namespace
        OMElement articleElement = factory.createOMElement("Article", ns);

        OMElement ret = stub.retObject(articleElement);
        assertNotNull(ret);
        assertEquals(ret.toString(), articleElement.toString());
    }

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

        float ret = stub.retFloat((float)34);
        assertTrue(ret==34);
    }

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

        double ret = stub.retDouble((double)34);
        assertTrue(ret==34);
    }

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

        boolean ret = stub.retBool(true);
        assertTrue(ret);
    }

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

        BigDecimal input = new BigDecimal(12334);
        BigDecimal ret = stub.retDecimal(input);
        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 {
        int ret = stub.retInt((int)34);
        assertEquals((int)34, ret);
    }

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

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

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

        int ret = stub.retChar(34);
        assertEquals(34, ret);
    }

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

        String input = "Abracadabra";
        String ret = stub.retString(input);
        assertNotNull(ret);
        assertEquals(input, ret);
    }

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

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

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

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

        BigInteger input = new BigInteger("34");
        BigInteger ret = stub.retULong(input);
        assertEquals(input, ret);
    }
}
    

⌨️ 快捷键说明

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