--- /dev/null
+public aspect Errors1 {
+ before(): within(is( && !is(AnonymousType)) && staticinitialization(*) {}
+}
--- /dev/null
+public aspect Errors5 {
+ before(): execution(* (is(InnerType) && *).*(..)) {}
+ before(): execution(* (is)) && *).*(..)) {}
+}
+
+class C {
+ class Foo {
+ public void m() {}
+ }
+ public void m() {}
+}
--- /dev/null
+public class SimpleAnnotation {
+}
+
+enum Foo {
+}
+
+@interface WibbleAnno {
+}
+
+class Bar {
+}
+
+interface I {
+}
+
+aspect X {
+ before(): within(is(AnnotationType)) && staticinitialization(*) {}
+}
--- /dev/null
+public class SimpleAnonymous {
+}
+
+enum Foo {
+}
+
+@interface WibbleAnno {
+}
+
+class Bar {
+ Runnable r = new Runnable() {
+ public void run() {}
+ };
+}
+
+interface I {
+}
+
+aspect X {
+ before(): within(is(AnonymousType)) && staticinitialization(*) {}
+}
--- /dev/null
+public class SimpleAspect {
+}
+
+enum Foo {
+}
+
+@interface WibbleAnno {
+}
+
+class Bar {
+ Runnable r = new Runnable() {
+ public void run() {}
+ };
+}
+
+interface I {
+}
+
+aspect X {
+ before(): within(is(AspectType)) && staticinitialization(*) {}
+}
--- /dev/null
+public class SimpleClass {
+}
+
+interface Foo {
+}
+
+class Bar {
+}
+
+aspect X {
+ before(): within(is(ClassType)) && staticinitialization(*) {}
+}
--- /dev/null
+public class SimpleEnum {
+}
+
+enum Foo {
+}
+
+class Bar {
+}
+
+interface I {
+}
+
+aspect X {
+ before(): within(is(EnumType)) && staticinitialization(*) {}
+}
--- /dev/null
+public class SimpleInner {
+}
+
+enum Foo {
+}
+
+@interface WibbleAnno {
+}
+
+class Bar {
+ public class Inner {}
+ Runnable r = new Runnable() {
+ public void run() {}
+ };
+}
+
+interface I {
+}
+
+aspect X {
+ before(): within(is(InnerType)) && staticinitialization(*) {}
+}
--- /dev/null
+public class SimpleInner2 {
+}
+
+enum Foo {
+}
+
+@interface WibbleAnno {
+}
+
+class Bar {
+ public class Inner {}
+ Runnable r = new Runnable() {
+ public void run() {}
+ };
+}
+
+interface I {
+}
+
+aspect X {
+ before(): within(is(InnerType) && !is(AnonymousType)) && staticinitialization(*) {}
+}
--- /dev/null
+public class SimpleInner3 {
+}
+
+enum Foo {
+}
+
+@interface WibbleAnno {
+}
+
+class Bar {
+ public class Inner {
+ public void foo() {}
+ }
+ Runnable r = new Runnable() {
+ public void run() {}
+ };
+}
+
+interface I {
+}
+
+aspect X {
+ before(): execution(* (is(InnerType) && !is(AnonymousType) && *).*(..)) {}
+}
--- /dev/null
+public class SimpleInterface {
+}
+
+interface Foo {
+}
+
+class Bar {
+}
+
+aspect X {
+ before(): within(is(InterfaceType)) && staticinitialization(*) {}
+}
public class Ajc169Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
- /*public void testAmbiguousMethod() {
- runTest("ambiguous method");
- }*/
+ public void testTypePatternCategories_44365_Class() {
+ runTest("type category type patterns - class");
+ }
- public void testChecker() {
- runTest("inserts in messages");
+ public void testTypePatternCategories_44365_Interface() {
+ runTest("type category type patterns - interface");
+ }
+
+ public void testTypePatternCategories_44365_Enum() {
+ runTest("type category type patterns - enum");
}
-/*
- public void testVerifyError() {
- runTest("verifyerror on atAj");
+
+ public void testTypePatternCategories_44365_Annotation() {
+ runTest("type category type patterns - annotation");
+ }
+
+ public void testTypePatternCategories_44365_Anonymous() {
+ runTest("type category type patterns - anonymous");
+ }
+
+ public void testTypePatternCategories_44365_Inner() {
+ runTest("type category type patterns - inner");
}
- public void testDeclareTypeWarning1() {
- runTest("declare type warning - 1");
+ public void testTypePatternCategories_44365_Inner_2() {
+ runTest("type category type patterns - inner - 2");
}
- public void testDeclareTypeWarning2() {
- runTest("declare type warning - 2");
+ public void testTypePatternCategories_44365_Inner_3() {
+ runTest("type category type patterns - inner - 3");
}
- public void testDeclareTypeWarning3() {
- runTest("declare type warning - 3");
+ public void testTypePatternCategories_44365_Aspect() {
+ runTest("type category type patterns - aspect");
+ }
+
+ public void testTypePatternCategories_44365_e1() {
+ runTest("type category type patterns - e1");
+ }
+
+ public void testTypePatternCategories_44365_e2() {
+ runTest("type category type patterns - e2");
+ }
+
+ /*
+ * public void testAmbiguousMethod() { runTest("ambiguous method"); }
+ */
+
+ public void testChecker() {
+ runTest("inserts in messages");
}
- public void testDeclareTypeError1() {
- runTest("declare type error - 1");
- }*/
+ /*
+ * public void testVerifyError() { runTest("verifyerror on atAj"); }
+ *
+ * public void testDeclareTypeWarning1() { runTest("declare type warning - 1"); }
+ *
+ * public void testDeclareTypeWarning2() { runTest("declare type warning - 2"); }
+ *
+ * public void testDeclareTypeWarning3() { runTest("declare type warning - 3"); }
+ *
+ * public void testDeclareTypeError1() { runTest("declare type error - 1"); }
+ */
public void testPr298388() {
runTest("declare mixin and generics");
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
<suite>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - class">
+ <compile files="SimpleClass.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void SimpleClass.<clinit>())' in Type 'SimpleClass'"/>
+ <message kind="weave" text="Join point 'staticinitialization(void Bar.<clinit>())' in Type 'Bar'"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - interface">
+ <compile files="SimpleInterface.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void Foo.<clinit>())' in Type 'Foo'"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - enum">
+ <compile files="SimpleEnum.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void Foo.<clinit>())' in Type 'Foo'"/>
+ </compile>
+ </ajc-test>
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - annotation">
+ <compile files="SimpleAnnotation.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void WibbleAnno.<clinit>())' in Type 'WibbleAnno'"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - anonymous">
+ <compile files="SimpleAnonymous.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void Bar$1.<clinit>())' in Type 'Bar$1'"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - inner">
+ <compile files="SimpleInner.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void Bar$Inner.<clinit>())' in Type 'Bar$Inner'"/>
+ <message kind="weave" text="Join point 'staticinitialization(void Bar$1.<clinit>())' in Type 'Bar$1'"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - inner - 2">
+ <compile files="SimpleInner2.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void Bar$Inner.<clinit>())' in Type 'Bar$Inner'"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - inner - 3">
+ <compile files="SimpleInner3.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-execution(void Bar$Inner.foo())' in Type 'Bar$Inner' (SimpleInner3.java:12) advised"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - aspect">
+ <compile files="SimpleAspect.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'staticinitialization(void X.<clinit>())' in Type 'X'"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - e1">
+ <compile files="Errors1.java" options="-1.5 -showWeaveInfo">
+ <message kind="error" text="Syntax error on token "&&", "ClassType"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs169/pr44365" title="type category type patterns - e2">
+ <compile files="Errors5.java" options="-1.5 -showWeaveInfo">
+ <message kind="error" text="Syntax error on token ")", "(" expected"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs169/pr48080" title="inserts in messages">
<compile files="Warnings.java" options="-1.5">
<message kind="warning" text="UNKNOWN_KEY{}foobar"/>