aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-05-09 11:08:28 +0000
committeraclement <aclement>2005-05-09 11:08:28 +0000
commitf6034581d8540124494806a7c6b3ad37ead2b6c3 (patch)
tree158298c44f78ba53dfb1cd95ccde8c1f01cafa87 /tests
parent51c018d9bbf0ecfb312cb2b56112c71cfc516c53 (diff)
downloadaspectj-f6034581d8540124494806a7c6b3ad37ead2b6c3.tar.gz
aspectj-f6034581d8540124494806a7c6b3ad37ead2b6c3.zip
tests and fixes for 93345 and static imports. From Andrew Huff.
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/PR93345.aj12
-rw-r--r--tests/java5/staticImports/StaticImport.aj9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/StaticImports.java33
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java5
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml10
6 files changed, 69 insertions, 1 deletions
diff --git a/tests/bugs150/PR93345.aj b/tests/bugs150/PR93345.aj
new file mode 100644
index 000000000..4950aa6e9
--- /dev/null
+++ b/tests/bugs150/PR93345.aj
@@ -0,0 +1,12 @@
+// "XLint warning for advice not applied with cflow(execution)"
+
+class AClass {
+}
+
+aspect AnAspect {
+ pointcut a() : cflow( execution(* *(..)) );
+
+ before() : a() {
+ System.out.println("before a");
+ }
+} \ No newline at end of file
diff --git a/tests/java5/staticImports/StaticImport.aj b/tests/java5/staticImports/StaticImport.aj
new file mode 100644
index 000000000..3d82bcbeb
--- /dev/null
+++ b/tests/java5/staticImports/StaticImport.aj
@@ -0,0 +1,9 @@
+// "import static java.lang.System.out"
+
+import static java.lang.System.out;
+
+public class StaticImport{
+ public static void main(String [] args){
+ out.println("hello world");
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
index c71386e41..004eb0a0d 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
@@ -34,6 +34,7 @@ public class AllTestsAspectJ150 {
suite.addTest(AnnotationsBinaryWeaving.suite());
suite.addTest(AnnotationPointcutsTests.suite());
suite.addTestSuite(VarargsTests.class);
+ suite.addTestSuite(StaticImports.class);
suite.addTest(AnnotationRuntimeTests.suite());
suite.addTestSuite(PerTypeWithinTests.class);
diff --git a/tests/src/org/aspectj/systemtest/ajc150/StaticImports.java b/tests/src/org/aspectj/systemtest/ajc150/StaticImports.java
new file mode 100644
index 000000000..a6de381fe
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc150/StaticImports.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2005 Contributors
+ * 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:
+ * Andrew Huff - initial implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc150;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class StaticImports extends XMLBasedAjcTestCase {
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(StaticImports.class);
+ }
+
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
+ }
+
+ public void testImportStaticSystemDotOut() {
+ runTest("import static java.lang.System.out");
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java b/tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java
index 8f1e7d295..db407560c 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/SuppressedWarnings.java
@@ -42,5 +42,8 @@ public class SuppressedWarnings extends XMLBasedAjcTestCase {
public void testSuppression2() {
runTest("suppressing non-matching advice warnings when multiple source files involved");
}
-
+
+ public void testSuppressionWithCflow_pr93345() {
+ runTest("XLint warning for advice not applied with cflow(execution)");
+ }
} \ 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 15afabbfe..283217815 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -5,6 +5,10 @@
<suite>
+ <ajc-test dir="java5/staticImports" title="import static java.lang.System.out">
+ <compile files="StaticImport.aj" options="-1.5"/>
+ </ajc-test>
+
<ajc-test dir="java5/bridgeMethods" pr="72766" title="Ignore bridge methods">
<compile files="AspectX.aj" inpath="testcode.jar" options="-showWeaveInfo">
<message kind="warning" line="7" text="pointcut did not match on the method call to a bridge method."/>
@@ -1054,6 +1058,12 @@
<message kind="warning" line="11" file="A3.aj"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs150" title="XLint warning for advice not applied with cflow(execution)" pr="93345">
+ <compile options="-Xlint,-1.5" files="PR93345.aj" >
+ <message kind="warning" line="7" text="advice defined in AnAspect has not been applied [Xlint:adviceDidNotMatch]"/>
+ </compile>
+ </ajc-test>
<!-- ======================================================================================= -->
<!-- annotated aspect members -->