Package org.nanocontainer.aop

Examples of org.nanocontainer.aop.MethodPointcut


        assertTrue(cut.picks(apricot));
        assertTrue(cut.picks(banana));
    }

    public void testMethodPointcutUnion() {
        MethodPointcut cut = cuts.union(cuts.oneMethod(apple), cuts.oneMethod(apricot));
        assertTrue(cut.picks(apple));
        assertTrue(cut.picks(apricot));
        assertFalse(cut.picks(banana));
        assertFalse(cut.picks(getA));
        assertFalse(cut.picks(getB));
        assertFalse(cut.picks(isA));
        assertFalse(cut.picks(isB));
        assertFalse(cut.picks(setA));
        assertFalse(cut.picks(setB));
    }
View Full Code Here


        } catch (MalformedRegularExpressionException e) {
        }
    }

    public void testObjectMethods() {
        MethodPointcut cut = cuts.objectMethods();
        assertTrue(cut.picks(equals));
        assertTrue(cut.picks(hashCode));
        assertTrue(cut.picks(toString));
        assertFalse(cut.picks(isA));
        assertFalse(cut.picks(setA));
    }
View Full Code Here

        assertFalse(cut.picks(isA));
        assertFalse(cut.picks(setA));
    }

    public void testDeclaringClass() {
        MethodPointcut cut = cuts.declaringClass(cuts.oneClass(Object.class));
        assertTrue(cut.picks(equals));
        assertTrue(cut.picks(hashCode));
        assertTrue(cut.picks(toString));
        assertFalse(cut.picks(isA));
        assertFalse(cut.picks(setA));
    }
View Full Code Here

        assertFalse(cut.picks(isA));
        assertFalse(cut.picks(setA));
    }

    public void testMembersOf() {
        MethodPointcut cut = cuts.membersOf(Foo.class);
        assertTrue(cut.picks(apple));
        assertTrue(cut.picks(equals));
        assertFalse(cut.picks(subFooMethod));
    }
View Full Code Here

        assertTrue(cut.picks(Bar.class));
        assertFalse(cut.picks(FooBar.class));
    }

    public void testCustomMethodPointcuts() {
        MethodPointcut picksApple = new MethodPointcut() {
            public boolean picks(Method method) {
                return method.equals(apple);
            }
        };
        MethodPointcut picksApricot = new MethodPointcut() {
            public boolean picks(Method method) {
                return method.equals(apricot);
            }
        };
        MethodPointcut cut = cuts.union(picksApple, picksApricot);
        assertTrue(cut.picks(apple));
        assertTrue(cut.picks(apricot));
        assertFalse(cut.picks(banana));
    }
View Full Code Here

TOP

Related Classes of org.nanocontainer.aop.MethodPointcut

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.