]> source.dussan.org Git - aspectj.git/commitdiff
test matching on annotations directly in the java.lang package
authoracolyer <acolyer>
Fri, 14 Apr 2006 16:41:58 +0000 (16:41 +0000)
committeracolyer <acolyer>
Fri, 14 Apr 2006 16:41:58 +0000 (16:41 +0000)
weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java

index b8363d040abd0f0dc025d087bffa342e3dbfe169..6127b2dd8d10269acd99e715ab658814ce18f5ba 100644 (file)
@@ -276,6 +276,13 @@ public class Java15PointcutExpressionTest extends TestCase {
                assertFalse("should not match",sm2.alwaysMatches());                            
        }
        
+       public void testJavaLangMatching() throws Exception {
+               PointcutExpression ex = parser.parsePointcutExpression("@within(java.lang.Deprecated)");
+               Method foo = GoldenOldie.class.getMethod("foo");
+               ShadowMatch sm1 = ex.matchesMethodExecution(foo);
+               assertTrue("should match",sm1.alwaysMatches());
+       }
+       
        protected void setUp() throws Exception {
                super.setUp();
                parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader());
@@ -323,6 +330,10 @@ public class Java15PointcutExpressionTest extends TestCase {
                public void setFriends(List<C> friends) {}
        }
 
+       @Deprecated
+       static class GoldenOldie {
+               public void foo() {}
+       }
 }