1 10 package org.nanocontainer.aop.dynaop; 11 12 import dynaop.ClassPointcut; 13 import org.jmock.Mock; 14 import org.jmock.MockObjectTestCase; 15 16 19 public class DynaopClassPointcutTestCase extends MockObjectTestCase { 20 21 private Mock mockDelegate = mock(dynaop.ClassPointcut.class); 22 23 public void testPicks() { 24 mockDelegate.expects(once()).method("picks").with(eq(String .class)).will(returnValue(false)); 25 mockDelegate.expects(once()).method("picks").with(eq(Integer .class)).will(returnValue(true)); 26 27 ClassPointcut pointcut = new DynaopClassPointcut((ClassPointcut) mockDelegate.proxy()); 28 assertFalse(pointcut.picks(String .class)); 29 assertTrue(pointcut.picks(Integer .class)); 30 } 31 32 } | Popular Tags |