Package java.beans

Examples of java.beans.PropertyChangeSupport.firePropertyChange()


        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "action1");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("action1", target.getActionRecord());
    }

    public void testInvoke_extend1_1() {
        MockFish fish = new MockFish();
View Full Code Here


                target, "action4");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        try {
            support.firePropertyChange(event);
        } catch (Exception e) {

        }
        assertEquals("action4", target.getActionRecord());
    }
View Full Code Here

                target, "action2");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        try {
            support.firePropertyChange(event);
            fail("Should throw exception");
        } catch (Exception e) {
            // e.printStackTrace();
        }
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "a", "source.a");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("boolean:true", target.getActionRecord());
    }

    public void testInvoke_extend4() {
        MockFish fish = new MockFish();
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "b", "source.a");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("Boolean:true", target.getActionRecord());
    }

    public void testInvoke_extend4_BooleanObject() {
        MockFish fish = new MockFish();
View Full Code Here

                target, "a", "source.booleanObject");

        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("boolean:true", target.getActionRecord());
    }

    public void testInvoke_extend5() {
        MockFish fish = new MockFish();
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "int", "source.int");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("int:1", target.getActionRecord());
    }

    public void testInvoke_extend6() {
        MockFish fish = new MockFish();
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "char", "source.char");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("char:a", target.getActionRecord());
    }

    public void testInvoke_extend7() {
        MockFish fish = new MockFish();
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "byte", "source.byte");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("byte:10", target.getActionRecord());
    }

    public void testInvoke_extend8() {
        MockFish fish = new MockFish();
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "short", "source.short");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("short:100", target.getActionRecord());
    }

    public void testInvoke_extend9() {
        MockFish fish = new MockFish();
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.