Package com.jayway.awaitility.classes

Examples of com.jayway.awaitility.classes.ClassWithMethods


public class ProxyCreatorTest {

    @Test
    public void interceptsStandardMethodCalls() throws Exception {
        ClassWithMethods object = (ClassWithMethods) ProxyCreator.create(ClassWithMethods.class,
                new InvocationHandler() {

                    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                        return "test";
                    }
                });

        assertEquals("test", object.aMethod());
    }
View Full Code Here


        assertEquals("test", object.aMethod());
    }

    @Test
    public void interceptsReflectionMethodCalls() throws Exception {
        ClassWithMethods object = (ClassWithMethods) ProxyCreator.create(ClassWithMethods.class,
                new InvocationHandler() {
                    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                        return "test";
                    }
                });
        Method method = object.getClass().getMethod("aMethod");
        assertEquals("test", method.invoke(object));
    }
View Full Code Here

TOP

Related Classes of com.jayway.awaitility.classes.ClassWithMethods

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.