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

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


     */
    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


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

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

        listener.fireSampleEvent(event);

        assertEquals("setSomeValue", getMethodName());
    }
View Full Code Here

     */
    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

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

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

        listener.fireSampleEvent(event);

        assertEquals("setSomeValue", getMethodName());
    }
View Full Code Here

     * fileSampleEvent scenario by throwing RuntimeException
     */
    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

     */
    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

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

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

        listener.fireSampleEvent(event);

        assertEquals("setSomeValue", getMethodName());
    }
View Full Code Here

     * fileSampleEvent scenario by throwing RuntimeException
     */
    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

TOP

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

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.