diff options
author | wisberg <wisberg> | 2003-12-15 12:13:47 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-12-15 12:13:47 +0000 |
commit | 18bc9e7ebbe011bcfa3ab942c766bd2fa13081b4 (patch) | |
tree | 283c74e3dcf174ab69ff80c71688676079e38af9 /tests/harness | |
parent | 38aa20202ee04c6fa31dcf827c310a65dc4b96ed (diff) | |
download | aspectj-18bc9e7ebbe011bcfa3ab942c766bd2fa13081b4.tar.gz aspectj-18bc9e7ebbe011bcfa3ab942c766bd2fa13081b4.zip |
inpath support
Diffstat (limited to 'tests/harness')
-rw-r--r-- | tests/harness/inpath/aspectsrc/A.java | 20 | ||||
-rw-r--r-- | tests/harness/inpath/build.xml | 11 | ||||
-rw-r--r-- | tests/harness/inpath/input-path-classes/Main.class | bin | 0 -> 1307 bytes | |||
-rw-r--r-- | tests/harness/inpath/input-path-classes/pack/Util.class | bin | 0 -> 182 bytes | |||
-rw-r--r-- | tests/harness/inpath/input-path-classes/pack/resource.txt | 1 | ||||
-rw-r--r-- | tests/harness/inpath/input-path-src/Main.java | 22 | ||||
-rw-r--r-- | tests/harness/inpath/input-path-src/pack/Util.java | 8 |
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 Binary files differnew file mode 100644 index 000000000..51ecc1163 --- /dev/null +++ b/tests/harness/inpath/input-path-classes/Main.class diff --git a/tests/harness/inpath/input-path-classes/pack/Util.class b/tests/harness/inpath/input-path-classes/pack/Util.class Binary files differnew file mode 100644 index 000000000..eae0da606 --- /dev/null +++ b/tests/harness/inpath/input-path-classes/pack/Util.class 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 + } +} |