Package java.beans

Examples of java.beans.XMLDecoder.readObject()


    /*
     * test XMLDecoder constructor with null inputStream argument
     */
    public void test_Constructor_NullInputStream_scenario2() {
        XMLDecoder xmlDecoder = new XMLDecoder(null, null);
        assertNull(xmlDecoder.readObject());
        assertNull(xmlDecoder.getOwner());
        assertNotNull(xmlDecoder.getExceptionListener());
        xmlDecoder.close();
    }

View Full Code Here


    /*
     * test XMLDecoder constructor with null inputStream argument
     */
    public void test_Constructor_NullInputStream_scenario3() {
        XMLDecoder xmlDecoder = new XMLDecoder(null, null, null);
        assertNull(xmlDecoder.readObject());
        assertNull(xmlDecoder.getOwner());
        assertNotNull(xmlDecoder.getExceptionListener());
        xmlDecoder.close();
    }

View Full Code Here

    /*
     * test XMLDecoder constructor with null inputStream argument
     */
    public void test_Constructor_NullInputStream_scenario4() {
        XMLDecoder xmlDecoder = new XMLDecoder(null, null, null, null);
        assertNull(xmlDecoder.readObject());
        assertNull(xmlDecoder.getOwner());
        assertNotNull(xmlDecoder.getExceptionListener());
        xmlDecoder.close();
    }
   
View Full Code Here

            }
        };

        dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes), this, el,
                Thread.currentThread().getContextClassLoader());
        assertEquals(Integer.valueOf("1"), dec.readObject());
        assertEquals(0, exceptions.size());
        dec.close();

        dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes), this, el,
                new MockClassLoader());
View Full Code Here

        dec.close();

        dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes), this, el,
                new MockClassLoader());
        try {
            dec.readObject();
            assertTrue(exceptions.size() > 0);
        } catch (ArrayIndexOutOfBoundsException e) {
            // also valid
        }
        dec.close();
View Full Code Here

        dec.close();
    }

    public void testClose() {
        XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
        assertEquals(Integer.valueOf("1"), dec.readObject());

        dec.close();

        assertEquals(Integer.valueOf("2"), dec.readObject());
        assertEquals(Integer.valueOf("3"), dec.readObject());
View Full Code Here

        XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
        assertEquals(Integer.valueOf("1"), dec.readObject());

        dec.close();

        assertEquals(Integer.valueOf("2"), dec.readObject());
        assertEquals(Integer.valueOf("3"), dec.readObject());
    }

    public void testGetExceptionListener() {
        XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
View Full Code Here

        assertEquals(Integer.valueOf("1"), dec.readObject());

        dec.close();

        assertEquals(Integer.valueOf("2"), dec.readObject());
        assertEquals(Integer.valueOf("3"), dec.readObject());
    }

    public void testGetExceptionListener() {
        XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
        assertNotNull(dec.getExceptionListener());
View Full Code Here

        assertNull(dec.getOwner());
    }

    public void testReadObject_ArrayOutOfBounds() {
        XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
        assertEquals(Integer.valueOf("1"), dec.readObject());
        assertEquals(Integer.valueOf("2"), dec.readObject());
        assertEquals(Integer.valueOf("3"), dec.readObject());

        try {
            dec.readObject();
View Full Code Here

    }

    public void testReadObject_ArrayOutOfBounds() {
        XMLDecoder dec = new XMLDecoder(new ByteArrayInputStream(xml123bytes));
        assertEquals(Integer.valueOf("1"), dec.readObject());
        assertEquals(Integer.valueOf("2"), dec.readObject());
        assertEquals(Integer.valueOf("3"), dec.readObject());

        try {
            dec.readObject();
            fail();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.