diff options
author | mkersten <mkersten> | 2004-04-07 15:32:00 +0000 |
---|---|---|
committer | mkersten <mkersten> | 2004-04-07 15:32:00 +0000 |
commit | c79fff2d91096ce21215f4617675f1a693f682f8 (patch) | |
tree | db236d7758fbd9e6f189f183a0e116de0c4722ba /ajdoc/testdata | |
parent | da1a040db61d31617ba14f39d6a3f24774ba694d (diff) | |
download | aspectj-c79fff2d91096ce21215f4617675f1a693f682f8.tar.gz aspectj-c79fff2d91096ce21215f4617675f1a693f682f8.zip |
- Added support for 1.4 sources (use "-source 1.4" option)
- Made output class files go to documentation directory (-d) rather than source directory.
- Added "-XajdocDebug" option that will keep the source files generated from the ASM around in order to help people send better bug reports.
- Any declare forms that ajdoc doesn't know how to generate docs for get printed to the console and indicated as a limitation.
I also extended test coverage to declare forms and added proper clearing of state for multiple invocations from test cases.
Diffstat (limited to 'ajdoc/testdata')
-rw-r--r-- | ajdoc/testdata/simple/foo/ModelCoverage.java | 150 | ||||
-rw-r--r-- | ajdoc/testdata/simple/foo/PlainJava.java | 1 |
2 files changed, 151 insertions, 0 deletions
diff --git a/ajdoc/testdata/simple/foo/ModelCoverage.java b/ajdoc/testdata/simple/foo/ModelCoverage.java new file mode 100644 index 000000000..5c14055c6 --- /dev/null +++ b/ajdoc/testdata/simple/foo/ModelCoverage.java @@ -0,0 +1,150 @@ + +package foo; + +import java.io.*; +import java.util.List; + +interface I { } + +class Point { + int x; + static int sx; + + { + System.out.println(""); + } + + { x = 0; } + static { sx = 1; } + + public Point() { } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int changeX(int x) { + this.x = x; + return x; + } + + void doIt() { + try { + File f = new File("."); + f.getCanonicalPath(); + } catch (IOException ioe) { + System.err.println("!"); + } +// setX(10); + new Point(); + } +} + +class SubPoint extends Point { } + +class Line { } + +aspect AdvisesRelationshipCoverage { + pointcut methodExecutionP(): execution(void Point.setX(int)); + before(): methodExecutionP() { } + + pointcut constructorExecutionP(): execution(Point.new()); + before(): constructorExecutionP() { } + + pointcut callMethodP(): call(* Point.setX(int)); + before(): callMethodP() { } + + pointcut callConstructorP(): call(Point.new()); + before(): callConstructorP() { } + + pointcut getP(): get(int *.*); + before(): getP() { } + + pointcut setP(): set(int *.*) && !set(int *.xxx); + before(): setP() { } + + pointcut initializationP(): initialization(Point.new(..)); + before(): initializationP() { } + + pointcut staticinitializationP(): staticinitialization(Point); + before(): staticinitializationP() { } + + pointcut handlerP(): handler(IOException); + before(): handlerP() { } + +// before(): within(*) && execution(* Point.setX(..)) { } +// before(): within(*) && execution(Point.new()) { } +} + +aspect AdviceNamingCoverage { + pointcut named(): call(* *.mumble()); + pointcut namedWithOneArg(int i): call(int Point.changeX(int)) && args(i); + pointcut namedWithArgs(int i, int j): set(int Point.x) && args(i, j); + + after(): named() { } + after(int i, int j) returning: namedWithArgs(i, j) { } + after() throwing: named() { } + after(): named() { } + + before(): named() { } + + int around(int i): namedWithOneArg(i) { return i;} + int around(int i) throws SizeException: namedWithOneArg(i) { return proceed(i); } + + before(): named() { } + before(int i): call(* *.mumble()) && named() && namedWithOneArg(i) { } + before(int i): named() && call(* *.mumble()) && namedWithOneArg(i) { } + + before(): call(* *.mumble()) { } +} + +abstract aspect AbstractAspect { + abstract pointcut abPtct(); +} + +aspect InterTypeDecCoverage { + public int Point.xxx = 0; + public int Point.check(int i, Line l) { return 1 + i; } +} + +aspect DeclareCoverage { + + pointcut illegalNewFigElt(): call(Point.new(..)) && !withincode(* *.doIt(..)); + + declare error: illegalNewFigElt(): "Illegal constructor call."; + declare warning: call(* Point.setX(..)): "Illegal call."; + + declare parents: Point extends java.io.Serializable; + declare parents: Point+ implements java.util.Observable; + declare parents: Point && Line implements java.util.Observable; + declare soft: SizeException : call(* Point.getX()); + declare precedence: AdviceCoverage, InterTypeDecCoverage, *; +// public Line.new(String s) { } +} + +class SizeException extends Exception { } + +aspect AdviceCoverage { + +} + +abstract class ModifiersCoverage { + private int a; + protected int b; + public int c; + int d; + + static int staticA; + final int finalA = 0; + + abstract void abstractM(); +} + + + + + diff --git a/ajdoc/testdata/simple/foo/PlainJava.java b/ajdoc/testdata/simple/foo/PlainJava.java index a7300b07e..ed1408b01 100644 --- a/ajdoc/testdata/simple/foo/PlainJava.java +++ b/ajdoc/testdata/simple/foo/PlainJava.java @@ -7,6 +7,7 @@ public class PlainJava { public int i; public int getI() { + assert true; new FileFilter() { public boolean accept(File f) { |