Examples of SampleBean


Examples of org.apache.harmony.beans.tests.java.beans.EncoderTest.SampleBean

    }

    public void testReadObject_StringCodec() {
        XMLDecoder dec = new XMLDecoder(this.getClass().getResourceAsStream(
                "/xml/SampleBean_StringCodec.xml"));
        SampleBean obj = (SampleBean) dec.readObject();
        assertEquals("<Li Yang> & \"liyang'", obj.getMyid());
        assertEquals("a child", obj.getRef().getMyid());
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.java.beans.EncoderTest.SampleBean

    public void testWriteObject_Integer() throws Exception {
        assertCodedXML(new Integer(3), "/xml/int.xml");
    }

    public void testWriteObject_StringCodec() throws Exception {
        SampleBean b = new SampleBean();
        b.setMyid("<Li Yang> & \"liyang'");
        SampleBean c = new SampleBean();
        c.setMyid("a child");
        b.setRef(c);
        assertCodedXML(b, "/xml/SampleBean_StringCodec.xml");
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.java.beans.EncoderTest.SampleBean

    }

    public void testReadObject_StringCodec() {
        XMLDecoder dec = new XMLDecoder(this.getClass().getResourceAsStream(
                "/xml/SampleBean_StringCodec.xml"));
        SampleBean obj = (SampleBean) dec.readObject();
        assertEquals("<Li Yang> & \"liyang'", obj.getMyid());
        assertEquals("a child", obj.getRef().getMyid());
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.java.beans.EncoderTest.SampleBean

    }

    public void testReadObject_StringCodec() {
        XMLDecoder dec = new XMLDecoder(this.getClass().getResourceAsStream(
                "/xml/SampleBean_StringCodec.xml"));
        SampleBean obj = (SampleBean) dec.readObject();
        assertEquals("<Li Yang> & \"liyang'", obj.getMyid());
        assertEquals("a child", obj.getRef().getMyid());
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.java.beans.EncoderTest.SampleBean

    public void testWriteObject_Integer() throws Exception {
        assertCodedXML(new Integer(3), "/xml/int.xml");
    }

    public void testWriteObject_StringCodec() throws Exception {
        SampleBean b = new SampleBean();
        b.setMyid("<Li Yang> & \"liyang'");
        SampleBean c = new SampleBean();
        c.setMyid("a child");
        b.setRef(c);
        assertCodedXML(b, "/xml/SampleBean_StringCodec.xml");
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.java.beans.EncoderTest.SampleBean

    public void testWriteObject_Integer() throws Exception {
        assertCodedXML(new Integer(3), "/xml/int.xml");
    }

    public void testWriteObject_StringCodec() throws Exception {
        SampleBean b = new SampleBean();
        b.setMyid("<Li Yang> & \"liyang'");
        SampleBean c = new SampleBean();
        c.setMyid("a child");
        b.setRef(c);
        assertCodedXML(b, "/xml/SampleBean_StringCodec.xml");
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.java.beans.EncoderTest.SampleBean

    public void testWriteObject_Integer() throws Exception {
        assertCodedXML(new Integer(3), "/xml/int.xml");
    }

    public void testWriteObject_StringCodec() throws Exception {
        SampleBean b = new SampleBean();
        b.setMyid("<Li Yang> & \"liyang'");
        SampleBean c = new SampleBean();
        c.setMyid("a child");
        b.setRef(c);
        assertCodedXML(b, "/xml/SampleBean_StringCodec.xml");
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.support.SampleBean

    public void testConstructor() throws Exception {
        Expression expr = new Expression(SampleBean.class, "new",
                new Object[] { "hello" });
        Object result = expr.getValue();
        if (result != null && result instanceof SampleBean) {
            SampleBean bean = (SampleBean) result;
            assertEquals("hello", bean.getText());
        } else {
            fail("Cannot instantiate an instance of Bean class.");
        }
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.support.SampleBean

    /**
     * The test checks the correct static method is initialized
     */
    public void testStatic() throws Exception {
        SampleBean theBean = new SampleBean();
        Expression expr = new Expression(SampleBean.class, "create",
                new Object[] { "hello", theBean });

        Object result = expr.getValue();
        if (result != null && result instanceof SampleBean) {
            SampleBean bean = (SampleBean) result;
            assertEquals("hello", bean.getText());
            assertEquals(theBean, bean.getObject());
        } else {
            fail("Cannot instantiate an instance of Bean class by "
                    + "static method.");
        }
    }
View Full Code Here

Examples of org.apache.harmony.beans.tests.support.SampleBean

    /**
     * The test checks the correct getter is initialized
     */
    public void testGetter() throws Exception {
        Expression expr = new Expression(new SampleBean("hello"), "getText",
                new Object[] {});

        Object result = expr.getValue();
        if (result != null && result instanceof String) {
            assertEquals("hello", result);
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.