Examples of BeanContextChildSupport


Examples of java.beans.beancontext.BeanContextChildSupport

    public void testSerialization_WithPeer() throws IOException,
            ClassNotFoundException {
        MockBeanContextChildDelegateS peer = new MockBeanContextChildDelegateS(
                "id of peer");
        BeanContextChildSupport support = peer.support;
        MockPropertyChangeListener pcl1 = new MockPropertyChangeListener();
        MockPropertyChangeListenerS pcl2 = new MockPropertyChangeListenerS(
                "id of pcl2");
        MockVetoableChangeListener vcl1 = new MockVetoableChangeListener();
        MockVetoableChangeListenerS vcl2 = new MockVetoableChangeListenerS(
                "id of vcl2");
        support.addPropertyChangeListener("beanContext", pcl1);
        support.addPropertyChangeListener("beanContext", pcl2);
        support.addVetoableChangeListener("beanContext", vcl1);
        support.addVetoableChangeListener("beanContext", vcl2);

        assertEqualsSerially(support,
                (BeanContextChildSupport) SerializationTester
                        .getDeserilizedObject(support));
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

     public void testSerialization_Compatibility() throws IOException,
             ClassNotFoundException, Exception {
         MockBeanContextChildDelegateS peer = new MockBeanContextChildDelegateS(
                 "id of peer");
         BeanContextChildSupport support = peer.support;
         MockPropertyChangeListener pcl1 = new MockPropertyChangeListener();
         MockPropertyChangeListenerS pcl2 = new MockPropertyChangeListenerS(
                 "id of pcl2");
         MockVetoableChangeListener vcl1 = new MockVetoableChangeListener();
         MockVetoableChangeListenerS vcl2 = new MockVetoableChangeListenerS(
                 "id of vcl2");
         support.addPropertyChangeListener("beanContext", pcl1);
         support.addPropertyChangeListener("beanContext", pcl2);
         support.addVetoableChangeListener("beanContext", vcl1);
         support.addVetoableChangeListener("beanContext", vcl2);
         SerializationTest.verifyGolden(this, support, new SerializableAssert(){
             public void assertDeserialized(Serializable orig, Serializable ser) {
                 assertEqualsSerially((BeanContextChildSupport) orig,
                         (BeanContextChildSupport) ser);
             }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

     * <p>
     *
     * @see BeanContextChildSupport#BeanContextChildSupport(BeanContextChild)
     */
    public void testConstructorBeanContextChild() throws Exception {
        new BeanContextChildSupport(null);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

     * <p>
     *
     * @see BeanContextChildSupport#BeanContextChildSupport()
     */
    public void testConstructor() throws Exception {
        new BeanContextChildSupport();
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

    /**
     * Test method setBeanContext() with BeanContext parameter.
     * <p>
     */
    public void testSetBeanContextBeanContext() throws Exception {
        BeanContextChildSupport sup = new BeanContextChildSupport();
        sup.setBeanContext(new BeanContextSupport());

        assertNotNull("BeanContext should not be null", sup.getBeanContext());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

    public static void main(String[] args) throws Exception {
        junit.textui.TestRunner.run(BeanContextChildSupportTest.class);
    }

    public void testAddPropertyChangeListener_NullParam() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.addPropertyChangeListener(null, new MockPropertyChangeListener());
        support.addPropertyChangeListener("property name", null);
        support.firePropertyChange("property name", "old value",
                "new value");
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        support.firePropertyChange("property name", "old value",
                "new value");
    }

    public void testAddPropertyChangeListener() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockPropertyChangeListener l2 = new MockPropertyChangeListener();
        String propName = "property name";
        Object oldValue = new Integer(1);
        Object newValue = new Integer(5);

        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);

        support.addPropertyChangeListener(propName, l1);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertSame(oldValue, l1.lastEvent.getOldValue());
        assertSame(newValue, l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);

        support.addPropertyChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertSame(oldValue, l1.lastEvent.getOldValue());
        assertSame(newValue, l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertEquals(propName, l2.lastEvent.getPropertyName());
        assertSame(oldValue, l2.lastEvent.getOldValue());
        assertSame(newValue, l2.lastEvent.getNewValue());
        assertSame(support, l2.lastEvent.getSource());

        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange("xxx", oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertNull(l2.lastEvent);
    }

    public void testAddVetoableChangeListener_NullParam()
            throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.addVetoableChangeListener(null,
                new MockVetoableChangeListener());
        support.addVetoableChangeListener("property name", null);
        support.fireVetoableChange("property name", "old value", "new value");
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        support.addVetoableChangeListener("property name", null);
        support.fireVetoableChange("property name", "old value", "new value");
    }

    public void testAddVetoableChangeListener() throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockVetoableChangeListener l1 = new MockVetoableChangeListener();
        MockVetoableChangeListener l2 = new MockVetoableChangeListener();
        String propName = "property name";
        Object oldValue = new Integer(1);
        Object newValue = new Integer(5);

        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);

        support.addVetoableChangeListener(propName, l1);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertSame(oldValue, l1.lastEvent.getOldValue());
        assertSame(newValue, l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);

        support.addVetoableChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertSame(oldValue, l1.lastEvent.getOldValue());
        assertSame(newValue, l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertEquals(propName, l2.lastEvent.getPropertyName());
        assertSame(oldValue, l2.lastEvent.getOldValue());
        assertSame(newValue, l2.lastEvent.getNewValue());
        assertSame(support, l2.lastEvent.getSource());

        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange("xxx", oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

    /*
     * Class under test for void BeanContextChildSupport()
     */
    public void testBeanContextChildSupport() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        assertSame(support, support.getBeanContextChildPeer());
        assertSame(support, support.beanContextChildPeer);
    }
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.