Package java.beans

Examples of java.beans.EventHandler.invoke()


      }
    harness.check(target.flag == false, "Test invoke");

    try
      {
  eh.invoke(null, listen1, new Object[] {ev});
      }
    catch (Exception e)
      {
  harness.fail("Invoke listen1 failed " + e.toString());
      }
View Full Code Here


    harness.check(target.flag == true, "Invoke listen1 test");
    target.reset();

    try
      {
  eh.invoke(null, listen2, new Object[] {ev});
      }
    catch (Exception e)
      {
  harness.fail("Invoke listen2 failed " + e.toString());
      }
View Full Code Here

        Object proxy = EventHandler.create(ActionListener.class,
                invocationObject, "someText", "source.text");

        Method m = ActionListener.class.getMethod("actionPerformed",
                new Class[] { ActionEvent.class });
        handler.invoke(proxy, m, new Object[] { new ActionEvent(this, 0, "") });

        assertEquals(invocationObject.getSomeText(), getText());
    }

    /**
 
View Full Code Here

        Object proxy = EventHandler.create(ActionListener.class,
                invocationObject, "someText", "source.text");

        Method m = ActionListener.class.getMethod("actionPerformed",
                new Class[] { ActionEvent.class });
        handler.invoke(proxy, m, new Object[] { new ActionEvent(this, 0, "") });

        assertEquals(invocationObject, handler.getTarget());
        assertEquals(invocationObject.getSomeText(), getText());
    }
View Full Code Here

        Object proxy = EventHandler.create(SampleListener.class,
                invocationObject, "doSomething");

        Method m = SampleListener.class.getMethod("fireSampleEvent",
                new Class[] { SampleEvent.class });
        handler.invoke(proxy, m, new Object[] { new SampleEvent("") });

        assertEquals(invocationObject, handler.getTarget());
        assertEquals("doSomething", getMethodName());

        // Regression test for HARMONY-4033
View Full Code Here

                eventPropertyName, null);
        Method listenerMethod = PropertyChangeListener.class.getMethod(
                "propertyChange", new Class[] { PropertyChangeEvent.class });
        PropertyChangeEvent event = new PropertyChangeEvent(button, "label",
                "1", "5");
        handler.invoke(proxy, listenerMethod, new Object[] { event });
        assertEquals(button.getLabel(), target.getText());
        Method equalsMethod = Object.class.getMethod("equals",
                new Class[] { Object.class });
        assertEquals(Boolean.FALSE, handler.invoke(proxy, equalsMethod,
                new String[] { "mock" }));
View Full Code Here

                "1", "5");
        handler.invoke(proxy, listenerMethod, new Object[] { event });
        assertEquals(button.getLabel(), target.getText());
        Method equalsMethod = Object.class.getMethod("equals",
                new Class[] { Object.class });
        assertEquals(Boolean.FALSE, handler.invoke(proxy, equalsMethod,
                new String[] { "mock" }));
        // Test null method with non-proxy Object.
        handler = new EventHandler(new Object(), "a", "a", "a");
        try {
            handler.invoke(new Object(), null, new Object[] {});
View Full Code Here

        assertEquals(Boolean.FALSE, handler.invoke(proxy, equalsMethod,
                new String[] { "mock" }));
        // Test null method with non-proxy Object.
        handler = new EventHandler(new Object(), "a", "a", "a");
        try {
            handler.invoke(new Object(), null, new Object[] {});
            fail("should throw NPE.");
        } catch (NullPointerException e) {
            // expected;
        }
    }
View Full Code Here

        Object proxy = EventHandler.create(ActionListener.class,
                invocationObject, "someText", "source.text");

        Method m = ActionListener.class.getMethod("actionPerformed",
                new Class[] { ActionEvent.class });
        handler.invoke(proxy, m, new Object[] { new ActionEvent(this, 0, "") });

        assertEquals(invocationObject.getSomeText(), getText());
    }

    /**
 
View Full Code Here

        Object proxy = EventHandler.create(ActionListener.class,
                invocationObject, "someText", "source.text");

        Method m = ActionListener.class.getMethod("actionPerformed",
                new Class[] { ActionEvent.class });
        handler.invoke(proxy, m, new Object[] { new ActionEvent(this, 0, "") });

        assertEquals(invocationObject, handler.getTarget());
        assertEquals(invocationObject.getSomeText(), getText());
        try {
            handler.invoke(proxy, null, new Object[] { new ActionEvent(this, 0,
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.