From e282c5d4de57310227b71ac543cdbb7be36e84ca Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 17 Feb 2005 14:42:31 +0000 Subject: [PATCH] SuppressAjWarnings test. --- tests/java5/suppressedWarnings/A.java | 7 ++++ tests/java5/suppressedWarnings/A1.aj | 6 ++++ tests/java5/suppressedWarnings/A2.aj | 13 ++++++++ tests/java5/suppressedWarnings/A3.aj | 13 ++++++++ .../java5/suppressedWarnings/Suppression1.aj | 32 +++++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 tests/java5/suppressedWarnings/A.java create mode 100644 tests/java5/suppressedWarnings/A1.aj create mode 100644 tests/java5/suppressedWarnings/A2.aj create mode 100644 tests/java5/suppressedWarnings/A3.aj create mode 100644 tests/java5/suppressedWarnings/Suppression1.aj diff --git a/tests/java5/suppressedWarnings/A.java b/tests/java5/suppressedWarnings/A.java new file mode 100644 index 000000000..394703c2a --- /dev/null +++ b/tests/java5/suppressedWarnings/A.java @@ -0,0 +1,7 @@ +import org.aspectj.lang.annotation.*; + +public class A { + + public static void main(String [] argv) { + } +} diff --git a/tests/java5/suppressedWarnings/A1.aj b/tests/java5/suppressedWarnings/A1.aj new file mode 100644 index 000000000..1770fe39f --- /dev/null +++ b/tests/java5/suppressedWarnings/A1.aj @@ -0,0 +1,6 @@ +import org.aspectj.lang.annotation.*; +public aspect A1 { + + before(): execution(* foo(..)) { // wont match + } +} diff --git a/tests/java5/suppressedWarnings/A2.aj b/tests/java5/suppressedWarnings/A2.aj new file mode 100644 index 000000000..c56dbf02d --- /dev/null +++ b/tests/java5/suppressedWarnings/A2.aj @@ -0,0 +1,13 @@ +import org.aspectj.lang.annotation.*; +public aspect A2 { + + before(): execution(* foo(..)) { // wont match + } + + @SuppressAjWarnings + before(): execution(* foo(..)) { // wont match - but suppressed + } + @SuppressAjWarnings("Bananas") // this wont prevent the lint advice not match warning + before(): execution(* foo(..)) { // wont match + } +} diff --git a/tests/java5/suppressedWarnings/A3.aj b/tests/java5/suppressedWarnings/A3.aj new file mode 100644 index 000000000..a57de6f7d --- /dev/null +++ b/tests/java5/suppressedWarnings/A3.aj @@ -0,0 +1,13 @@ +import org.aspectj.lang.annotation.*; +public aspect A3 { + + before(): execution(* foo(..)) { // wont match + } + + @SuppressAjWarnings("adviceDidNotMatch") + before(): execution(* foo(..)) { // wont match - but suppressed + } + + before(): execution(* foo(..)) { // wont match + } +} diff --git a/tests/java5/suppressedWarnings/Suppression1.aj b/tests/java5/suppressedWarnings/Suppression1.aj new file mode 100644 index 000000000..2b1d869e3 --- /dev/null +++ b/tests/java5/suppressedWarnings/Suppression1.aj @@ -0,0 +1,32 @@ +import org.aspectj.lang.annotation.*; + +// 5 pieces of advice. Numbers 2, 4, 5 should not report a warning for not matching +public class Suppression1 { + + public static void main(String []argv) { + } +} + + +aspect A { + + before(): call(* *(..)) && !within(A) {//13 + } + + @SuppressAjWarnings + before(): call(* *(..)) && !within(A) {//17 + } + + @SuppressAjWarnings("bananas") + before(): call(* *(..)) && !within(A) {//21 + } + + @SuppressAjWarnings("adviceDidNotMatch") + before(): call(* *(..)) && !within(A) {//25 + } + + @SuppressAjWarnings({"adviceDidNotMatch","custard"}) + before(): call(* *(..)) && !within(A) {//29 + } + +} -- 2.39.5