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

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


        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


    /**
     * The test checks the event is fired for object created with the create()
     */
    public void testCreateWithMethodCallWhichIsSetter() {
        InvocationObject invocationObject = new InvocationObject();
        SampleEvent event = new SampleEvent("bean");

        SampleListener listener = EventHandler.create(SampleListener.class,
                invocationObject, "doSomething", "i", null);

        listener.fireSampleEvent(event);

        assertEquals("doSomething", getMethodName());
        assertEquals(event.getI(), invocationObject.getIntValue());
    }
View Full Code Here

    /**
     * fireSampleEvent scenario
     */
    public void testCreateForStaticMethodAsPropertyGetter() {
        InvocationObject invocationObject = new InvocationObject();
        SampleEvent event = new SampleEvent("bean");

        SampleListener listener = EventHandler.create(SampleListener.class,
                invocationObject, "someValue", "j");

        listener.fireSampleEvent(event);
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

    /**
     * The test checks the event is fired for object created with the create()
     */
    public void testCreateWithMethodCallWhichIsSetter() {
        InvocationObject invocationObject = new InvocationObject();
        SampleEvent event = new SampleEvent("bean");

        SampleListener listener = EventHandler.create(SampleListener.class,
                invocationObject, "doSomething", "i", null);

        listener.fireSampleEvent(event);

        assertEquals("doSomething", getMethodName());
        assertEquals(event.getI(), invocationObject.getIntValue());
    }
View Full Code Here

    /**
     * fireSampleEvent scenario
     */
    public void testCreateForStaticMethodAsPropertyGetter() {
        InvocationObject invocationObject = new InvocationObject();
        SampleEvent event = new SampleEvent("bean");

        SampleListener listener = EventHandler.create(SampleListener.class,
                invocationObject, "someValue", "j");

        listener.fireSampleEvent(event);
View Full Code Here

    public void test_Create_WithThrowRuntimeException() {
        // Regression for Harmony-2434
        InvocationObject invocationObject = new InvocationObject();
        SampleListener listener = EventHandler.create(SampleListener.class,invocationObject, "throwRuntimeException");
        try {
            listener.fireSampleEvent(new SampleEvent("bean"));
            fail("Expected RuntimeException thrown");
        } catch (RuntimeException re) {
            // Expected
        }
    }
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

    /**
     * The test checks the event is fired for object created with the create()
     */
    public void testCreateWithMethodCallWhichIsSetter() {
        InvocationObject invocationObject = new InvocationObject();
        SampleEvent event = new SampleEvent("bean");

        SampleListener listener = EventHandler.create(SampleListener.class,
                invocationObject, "doSomething", "i", null);

        listener.fireSampleEvent(event);

        assertEquals("doSomething", getMethodName());
        assertEquals(event.getI(), invocationObject.getIntValue());
    }
View Full Code Here

    /**
     * fireSampleEvent scenario
     */
    public void testCreateForStaticMethodAsPropertyGetter() {
        InvocationObject invocationObject = new InvocationObject();
        SampleEvent event = new SampleEvent("bean");

        SampleListener listener = EventHandler.create(SampleListener.class,
                invocationObject, "someValue", "j");

        listener.fireSampleEvent(event);
View Full Code Here

TOP

Related Classes of org.apache.harmony.beans.tests.support.SampleEvent

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.