aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-02-17 15:08:20 +0000
committeraclement <aclement>2005-02-17 15:08:20 +0000
commit3f697268336f4c493a167253d091a7cca9365d1b (patch)
tree47f7b376c824eafcd301ca58f6f48bcefa7b30d9
parent4a3f3643037a0d5d37bea64beb5bae013c5168af (diff)
downloadaspectj-3f697268336f4c493a167253d091a7cca9365d1b.tar.gz
aspectj-3f697268336f4c493a167253d091a7cca9365d1b.zip
SuppressAjWarnings test.
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java6
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java46
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml17
4 files changed, 66 insertions, 5 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 9f83d703f..556f2d4ea 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -38,11 +38,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
}
public void test_typeProcessingOrderWhenDeclareParents() {
- try {
- runTest("Order of types passed to compiler determines weaving behavior");
- } finally {
- System.err.println(ajc.getLastCompilationResult().getStandardError());
- }
+ runTest("Order of types passed to compiler determines weaving behavior");
}
public void test_aroundMethod() {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
index 098224728..97d2e4520 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
@@ -37,6 +37,8 @@ public class AllTestsAspectJ150 {
suite.addTest(Autoboxing.suite());
suite.addTest(Annotations.suite());
suite.addTest(AnnotationBinding.suite());
+
+ suite.addTest(SuppressedWarnings.suite());
//$JUnit-END$
return suite;
}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java b/tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java
new file mode 100644
index 000000000..8f1e7d295
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc150;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class SuppressedWarnings extends XMLBasedAjcTestCase {
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(SuppressedWarnings.class);
+ }
+
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
+ }
+
+ // Check basic suppression
+ public void testSuppression1() {
+ runTest("suppressing non-matching advice warnings");
+ }
+
+ // Checks source contexts aren't put out incorrectly
+ // NOTE: Source contexts only come out if the primary source location in a message
+ // matches the file currently being dealt with. Because advice not matching
+ // messages come out at the last stage of compilation, you currently only
+ // get sourcecontext for advice not matching messages that point to places in
+ // the last file being processed. You do get source locations in all cases -
+ // you just don't always get context, we could revisit this sometime...
+ // (see bug 62073 reference in WeaverMessageHandler.handleMessage())
+ public void testSuppression2() {
+ runTest("suppressing non-matching advice warnings when multiple source files involved");
+ }
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 9c787d7b4..5cf5084fa 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -925,6 +925,23 @@
<message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:27) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings">
+ <compile files="Suppression1.aj" options="-1.5,-showWeaveInfo">
+ <message kind="warning" line="13"/>
+ <message kind="warning" line="21"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings when multiple source files involved">
+ <compile files="A.java,A1.aj,A2.aj,A3.aj" options="-1.5,-showWeaveInfo">
+ <message kind="warning" line="4" file="A1.aj"/>
+ <message kind="warning" line="4" file="A2.aj"/>
+ <message kind="warning" line="11" file="A2.aj"/>
+ <message kind="warning" line="4" file="A3.aj"/>
+ <message kind="warning" line="11" file="A3.aj"/>
+ </compile>
+ </ajc-test>
<!-- ======================================================================================= -->
<!-- annotated aspect members -->