Package org.apache.harmony.beans.tests.support.beancontext.mock

Examples of org.apache.harmony.beans.tests.support.beancontext.mock.MockVetoChangeListener


            throws PropertyVetoException {
        MockBeanContextChildSupport support = new MockBeanContextChildSupport();
        MockBeanContext oldCtx = new MockBeanContext();
        support.setBeanContext(oldCtx);
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockVetoChangeListener l2 = new MockVetoChangeListener();
        support.addPropertyChangeListener("beanContext", l1);
        support.addVetoableChangeListener("beanContext", l2);

        MockBeanContext ctx = new MockBeanContext();

        support.clearLastRecords();
        l1.clearLastEvent();
        l2.clearLastEvent();
        try {
            support.setBeanContext(ctx);
            fail();
        } catch (PropertyVetoException e) {
            // expected
View Full Code Here


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

        support.addVetoableChangeListener(propName, l1);
        support.addVetoableChangeListener(propName, l2);
        support.addVetoableChangeListener(propName, l3);
        l1.clearLastEvent();
        l2.clearLastEvent();
        l3.clearLastEvent();
        try {
            support.fireVetoableChange(propName, oldValue, newValue);
            fail();
        } catch (PropertyVetoException e) {
            // expected
View Full Code Here

    }

    public void testSetLocale_Veto() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockVetoChangeListener l2 = new MockVetoChangeListener();
        support.addPropertyChangeListener("locale", l1);
        support.addVetoableChangeListener("locale", l2);
        assertSame(Locale.getDefault(), support.getLocale());
        support.records.assertRecord("initialize", null);
        support.records.assertEndOfRecords();
View Full Code Here

    }

    public void testSetLocale_Veto() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockVetoChangeListener l2 = new MockVetoChangeListener();
        support.addPropertyChangeListener("locale", l1);
        support.addVetoableChangeListener("locale", l2);
        assertSame(Locale.getDefault(), support.getLocale());
        support.records.assertRecord("initialize", null);
        support.records.assertEndOfRecords();
View Full Code Here

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

        support.addVetoableChangeListener(propName, l1);
        support.addVetoableChangeListener(propName, l2);
        support.addVetoableChangeListener(propName, l3);
        l1.clearLastEvent();
        l2.clearLastEvent();
        l3.clearLastEvent();
        try {
            support.fireVetoableChange(propName, oldValue, newValue);
            fail();
        } catch (PropertyVetoException e) {
            // expected
View Full Code Here

            throws PropertyVetoException {
        MockBeanContextChildSupport support = new MockBeanContextChildSupport();
        MockBeanContext oldCtx = new MockBeanContext();
        support.setBeanContext(oldCtx);
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockVetoChangeListener l2 = new MockVetoChangeListener();
        support.addPropertyChangeListener("beanContext", l1);
        support.addVetoableChangeListener("beanContext", l2);

        MockBeanContext ctx = new MockBeanContext();

        support.clearLastRecords();
        l1.clearLastEvent();
        l2.clearLastEvent();
        try {
            support.setBeanContext(ctx);
            fail();
        } catch (PropertyVetoException e) {
            // expected
View Full Code Here

    }

    public void testSetLocale_Veto() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockVetoChangeListener l2 = new MockVetoChangeListener();
        support.addPropertyChangeListener("locale", l1);
        support.addVetoableChangeListener("locale", l2);
        assertSame(Locale.getDefault(), support.getLocale());
        support.records.assertRecord("initialize", null);
        support.records.assertEndOfRecords();
View Full Code Here

TOP

Related Classes of org.apache.harmony.beans.tests.support.beancontext.mock.MockVetoChangeListener

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.