Package java.beans

Examples of java.beans.XMLEncoder$Record


        assertTrue(out.size() > 0);
        assertNull(enc.get(i));
    }

    public void testXMLEncoder_Null() throws NullPointerException {
        new XMLEncoder(null);
    }
View Full Code Here


    public void testXMLEncoder_Null() throws NullPointerException {
        new XMLEncoder(null);
    }

    public void testGetOwner() {
        XMLEncoder enc = new XMLEncoder(System.out);
        assertNull(enc.getOwner());
    }
View Full Code Here

        XMLEncoder enc = new XMLEncoder(System.out);
        assertNull(enc.getOwner());
    }

    public void testSetOwner() {
        XMLEncoder enc = new XMLEncoder(System.out);
        Object owner = Boolean.FALSE;

        enc.setOwner(owner);
        assertSame(owner, enc.getOwner());

        enc.setOwner(null);
        assertNull(enc.getOwner());
    }
View Full Code Here

        assertNull(enc.getOwner());
    }

    private void assertCodedXML(Object obj, String xmlFile) throws Exception {
        ByteArrayOutputStream temp = new ByteArrayOutputStream();
        XMLEncoder enc = new XMLEncoder(temp);

        assertCodedXML(obj, xmlFile, temp, enc);
    }
View Full Code Here

        TestEventHandler refHandler = new TestEventHandler();
        String saxParserClassName = System.getProperty("org.xml.sax.driver");

        if (enc == null || temp == null) {
            temp = new ByteArrayOutputStream();
            enc = new XMLEncoder(temp);
        }
        enc.writeObject(obj);
        enc.close();
        byte bytes[] = temp.toByteArray();
View Full Code Here

    /**
     * The test checks that java.lang.Byte exemplar store is correct
     */
    public void testEncodeByte() {
        XMLEncoder e = new XMLEncoder(System.out);
        e.setExceptionListener(new ExceptionListener() {
            public void exceptionThrown(Exception e) {
                fail("Exception " + e.getClass() + " is thrown: "
                        + e.getMessage());
            }
        });

        try {
            e.writeObject(new Byte((byte) 123));
        } catch (Exception excp) {
            fail("Exception " + excp.getClass() + " is thrown: "
                    + excp.getMessage());
        } finally {
            e.close();
        }
    }
View Full Code Here

    /**
     * The test checks that java.lang.Character exemplar store is correct
     */
    public void testEncodeCharacter() {
        XMLEncoder e = new XMLEncoder(System.out);
        e.setExceptionListener(new ExceptionListener() {
            public void exceptionThrown(Exception e) {
                fail("Exception " + e.getClass() + " is thrown: "
                        + e.getMessage());
            }
        });

        try {
            e.writeObject(new Character('a'));
        } catch (Exception excp) {
            fail("Exception " + excp.getClass() + " is thrown: "
                    + excp.getMessage());
        } finally {
            e.close();
        }
    }
View Full Code Here

    /**
     * The test checks that java.lang.Class exemplar store is correct
     */
    public void testEncodeClass() {
        XMLEncoder e = new XMLEncoder(System.out);
        e.setExceptionListener(new ExceptionListener() {
            public void exceptionThrown(Exception e) {
                fail("Exception " + e.getClass() + " is thrown: "
                        + e.getMessage());
            }
        });

        try {
            e.writeObject(Object.class);
        } catch (Exception excp) {
            fail("Exception " + excp.getClass() + " is thrown: "
                    + excp.getMessage());
        } finally {
            e.close();
        }
    }
View Full Code Here

    /**
     * The test checks that java.lang.Double exemplar store is correct
     */
    public void testEncodeDouble() {
        XMLEncoder e = new XMLEncoder(System.out);
        e.setExceptionListener(new ExceptionListener() {
            public void exceptionThrown(Exception e) {
                fail("Exception " + e.getClass() + " is thrown: "
                        + e.getMessage());
            }
        });

        try {
            e.writeObject(new Double(0.01));
        } catch (Exception excp) {
            fail("Exception " + excp.getClass() + " is thrown: "
                    + excp.getMessage());
        } finally {
            e.close();
        }
    }
View Full Code Here

    /**
     * The test checks that java.lang.Float exemplar store is correct
     */
    public void testEncodeFloat() {
        XMLEncoder e = new XMLEncoder(System.out);
        e.setExceptionListener(new ExceptionListener() {
            public void exceptionThrown(Exception e) {
                fail("Exception " + e.getClass() + " is thrown: "
                        + e.getMessage());
            }
        });

        try {
            e.writeObject(new Float((float) 0.01));
        } catch (Exception excp) {
            fail("Exception " + excp.getClass() + " is thrown: "
                    + excp.getMessage());
        } finally {
            e.close();
        }
    }
View Full Code Here

TOP

Related Classes of java.beans.XMLEncoder$Record

Copyright © 2018 www.massapicom. 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.