summaryrefslogtreecommitdiffstats
path: root/tests/harness/inpath
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-12-15 12:13:47 +0000
committerwisberg <wisberg>2003-12-15 12:13:47 +0000
commit18bc9e7ebbe011bcfa3ab942c766bd2fa13081b4 (patch)
tree283c74e3dcf174ab69ff80c71688676079e38af9 /tests/harness/inpath
parent38aa20202ee04c6fa31dcf827c310a65dc4b96ed (diff)
downloadaspectj-18bc9e7ebbe011bcfa3ab942c766bd2fa13081b4.tar.gz
aspectj-18bc9e7ebbe011bcfa3ab942c766bd2fa13081b4.zip
inpath support
Diffstat (limited to 'tests/harness/inpath')
-rw-r--r--tests/harness/inpath/aspectsrc/A.java20
-rw-r--r--tests/harness/inpath/build.xml11
-rw-r--r--tests/harness/inpath/input-path-classes/Main.classbin0 -> 1307 bytes
-rw-r--r--tests/harness/inpath/input-path-classes/pack/Util.classbin0 -> 182 bytes
-rw-r--r--tests/harness/inpath/input-path-classes/pack/resource.txt1
-rw-r--r--tests/harness/inpath/input-path-src/Main.java22
-rw-r--r--tests/harness/inpath/input-path-src/pack/Util.java8
7 files changed, 62 insertions, 0 deletions
diff --git a/tests/harness/inpath/aspectsrc/A.java b/tests/harness/inpath/aspectsrc/A.java
new file mode 100644
index 000000000..8d0f487a5
--- /dev/null
+++ b/tests/harness/inpath/aspectsrc/A.java
@@ -0,0 +1,20 @@
+
+import org.aspectj.testing.Tester;
+
+public aspect A {
+ static {
+ Tester.expectEvents(
+ new String[] {
+ "execution(void Main.main(String[]))",
+ "execution(void pack.Util.log(String[]))"
+ }
+ );
+ }
+ before() : execution(public static * *(..)) {
+ Tester.event("" + thisJoinPointStaticPart);
+ //System.out.println("\"" + thisJoinPointStaticPart);
+ }
+ after() returning : execution(public static void main(String[])) {
+ Tester.checkAllEvents();
+ }
+}
diff --git a/tests/harness/inpath/build.xml b/tests/harness/inpath/build.xml
new file mode 100644
index 000000000..21e378070
--- /dev/null
+++ b/tests/harness/inpath/build.xml
@@ -0,0 +1,11 @@
+
+<project name="inpath-test" default="all" basedir=".">
+
+
+ <target name="all" description="build classes">
+ <property name="dest.dir" location="${basedir}/input-path-classes"/>
+ <property name="src.dir" location="${basedir}/input-path-src"/>
+ <javac destdir="${dest.dir}" srcdir="${src.dir}"/>
+ </target>
+
+</project>
diff --git a/tests/harness/inpath/input-path-classes/Main.class b/tests/harness/inpath/input-path-classes/Main.class
new file mode 100644
index 000000000..51ecc1163
--- /dev/null
+++ b/tests/harness/inpath/input-path-classes/Main.class
Binary files differ
diff --git a/tests/harness/inpath/input-path-classes/pack/Util.class b/tests/harness/inpath/input-path-classes/pack/Util.class
new file mode 100644
index 000000000..eae0da606
--- /dev/null
+++ b/tests/harness/inpath/input-path-classes/pack/Util.class
Binary files differ
diff --git a/tests/harness/inpath/input-path-classes/pack/resource.txt b/tests/harness/inpath/input-path-classes/pack/resource.txt
new file mode 100644
index 000000000..9a2c7732f
--- /dev/null
+++ b/tests/harness/inpath/input-path-classes/pack/resource.txt
@@ -0,0 +1 @@
+testing \ No newline at end of file
diff --git a/tests/harness/inpath/input-path-src/Main.java b/tests/harness/inpath/input-path-src/Main.java
new file mode 100644
index 000000000..83b7dfb56
--- /dev/null
+++ b/tests/harness/inpath/input-path-src/Main.java
@@ -0,0 +1,22 @@
+
+import pack.Util;
+
+public class Main {
+ public static void main(String[] args) throws java.io.IOException {
+ Util.log(args);
+ boolean expectResourceCopy = false; // XXXX check
+ if (expectResourceCopy) {
+ java.io.InputStream in =
+ Main.class.getClassLoader().getResourceAsStream("pack/resource.txt");
+ if (null == in) {
+ throw new Error("unable to read pack/resource.txt");
+ }
+ byte[] buf = new byte[7];
+ int read = in.read(buf);
+ String val = new String(buf);
+ if (!"testing".equals(val)) {
+ throw new Error("expected \"testing\", got: " + val);
+ }
+ }
+ }
+}
diff --git a/tests/harness/inpath/input-path-src/pack/Util.java b/tests/harness/inpath/input-path-src/pack/Util.java
new file mode 100644
index 000000000..939f6a81d
--- /dev/null
+++ b/tests/harness/inpath/input-path-src/pack/Util.java
@@ -0,0 +1,8 @@
+
+package pack;
+
+public class Util {
+ public static void log(String[] args) {
+ // do nothing
+ }
+}