diff options
author | aclement <aclement> | 2004-08-03 12:31:29 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-03 12:31:29 +0000 |
commit | 2982b4cc622a2a95429b16f0aa3c55b7e20d798a (patch) | |
tree | a1453e59e3356d36b7bacaf272298f91f6fa1407 /tests | |
parent | fe049bdf23ae91b938e64fc2106aebf72be34e3b (diff) | |
download | aspectj-2982b4cc622a2a95429b16f0aa3c55b7e20d798a.tar.gz aspectj-2982b4cc622a2a95429b16f0aa3c55b7e20d798a.zip |
The BIG commit.
- Enhanced structure model support.
- *Incremental* structure model support written and tested (currently switched off, see incModelTests.xml)
- -showWeaveInfo compiler option
- existence of a 'runtimetest' surfaced through relationships
- UI can determine if errors/warnings came from DEOWs.
- Code to enable type mungers to remember source locations written (currently switched off)
Diffstat (limited to 'tests')
38 files changed, 779 insertions, 0 deletions
diff --git a/tests/ajcTestSuite.dtd b/tests/ajcTestSuite.dtd index 45c00f0c0..c324963d7 100644 --- a/tests/ajcTestSuite.dtd +++ b/tests/ajcTestSuite.dtd @@ -30,6 +30,7 @@ <!ELEMENT inc-compile (dir-changes*,message*)>
<!ATTLIST inc-compile tag CDATA #REQUIRED >
<!ATTLIST inc-compile fresh CDATA #IMPLIED >
+ <!ATTLIST inc-compile checkModel CDATA #IMPLIED >
<!ELEMENT run (dir-changes*,message*)>
<!ATTLIST run class CDATA #REQUIRED >
diff --git a/tests/incModelTests.xml b/tests/incModelTests.xml new file mode 100644 index 000000000..e8104794e --- /dev/null +++ b/tests/incModelTests.xml @@ -0,0 +1,102 @@ + +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"> + +<suite> +<!-- + In order for these tests to pass you have to flip this flag to true: + AsmManager.attemptIncrementalModelRepairs + + If you want to debug the output from the tests, you might want uncomment + the static initializer in AsmManager which will enable you to collect + detailed information on model processing. +--> + +<!-- + These tests utilise the inc-compile test harness option but I've extended it + with a checkModel option which enables me to check information about the model + after a incremental compilation step. +--> + +<!-- + asm relationships for inter type declarations are tricky things. + Today, because type mungers don't remember where they came from in attribute form, + the relationships for ITDs are created during source compilation. When building incrementally, + we are really doing a binary weave of 'everything else' with the source for the file that + has changed. In this case the relationships for ITDs are not added. This makes managing + them incrementally in the model rather tough! + + The solution is to make them remember where they came from. This would mean we can create + the relationships during weave time and so they will be created when either doing a + source compilation or a binary weave. The support is in ResolvedTypeMunger to remember + where they came from (you just have to flick a switch) but I haven't switched it on + because we need to version *all* aspectj attributes properly so that we don't end up with + a migration nightmare. If ITD attributes remembered their location in a particular version + of AspectJ then everyone would need to recompile their code from source with that version. + If we keep changing the attributes, we keep having this problem. If we include a *version* + number in every attribute we can make the compiler more robust to coping with 'old' attributes + that might be missing certain options or values. + + Hence the first test here is not complete... + +--> + <ajc-test dir="incremental/model/introduction" + title="Testing incremental structure model: Intertype declarations (and a declare parents)" + keywords="incremental-test,model-test" > + <compile staging="true" options="-incremental,-emacssym" sourceroots="."/> + <inc-compile tag="20"/> <!-- Just 'touched' one file --> + <inc-compile tag="30"/> <!-- Just 'touched another aspect --> + </ajc-test> + + <ajc-test dir="incremental/model/intertype" + title="Testing incremental structure model: Intertype field declarations" + keywords="incremental-test,model-test" > + <compile staging="true" options="-incremental,-emacssym" sourceroots="."/> + <inc-compile tag="20" checkModel="inter-type field=2,RelationshipMapSize=3"/> <!-- BetaA intertypes int i and String s --> + <inc-compile tag="30" checkModel="inter-type field=1,RelationshipMapSize=2"/> <!-- BetaA takes the String intertype away --> + </ajc-test> + + <ajc-test dir="incremental/model/weaving2" + title="Testing incremental structure model: Weaving handlers" + keywords="incremental-test,model-test" > + <compile staging="true" options="-incremental,-emacssym" sourceroots="."/> + <inc-compile tag="20" checkModel="code=1,advice=1,RelationshipMapSize=2"/> <!-- BetaA has a new piece of handler advice added --> + <inc-compile tag="30" checkModel="code=1,advice=2,RelationshipMapSize=3"/> <!-- secondary.GammaA added, also advises the same handler --> + <inc-compile tag="40" checkModel="code=1,advice=1,RelationshipMapSize=2"/> <!-- primary.BetaA deleted --> + </ajc-test> + + <ajc-test dir="incremental/model/weaving" + title="Testing incremental structure model: Weaving" + keywords="incremental-test,model-test" > + <compile staging="true" options="-incremental,-emacssym" sourceroots="."/> + <inc-compile tag="20" checkModel="code=2,advice=2,java source file=3,RelationshipMapSize=4"/> <!-- BetaA has a new piece of advice added --> + <inc-compile tag="30" checkModel="code=1,advice=1,RelationshipMapSize=2"/> <!-- BetaA has a piece of advice removed --> + <inc-compile tag="40" checkModel="code=0,RelationshipMapSize=0,advice=0"/> <!-- BetaA other piece of advice removed (now empty) --> + </ajc-test> + + + <ajc-test dir="incremental/model/sourcefiles_updating" + title="Testing incremental structure model: Updating files" + keywords="incremental-test,model-test" > + <compile staging="true" options="-incremental,-emacssym" sourceroots="."/> + <!-- On first compile, 5 source files in model, 'root','Alpha','Beta','Gamma','Delta' --> + <inc-compile tag="20" checkModel="java source file=5,method=4,class=3,FileMapSize=4"/> <!-- Beta changed, method added --> + <inc-compile tag="30" checkModel="java source file=5,method=4,class=4,advice=1"/> <!-- Delta changed, class added --> + <inc-compile tag="40" checkModel="advice=2"/> <!-- Gamma changed, advice added --> + <inc-compile tag="50" checkModel="advice=2,pointcut=1"/> <!-- Gamma changed, pointcut added --> + <inc-compile tag="60" checkModel="advice=0,pointcut=1"/> <!-- Gamma changed, both advice removed --> + </ajc-test> + + <ajc-test dir="incremental/model/sourcefiles_addremove" + title="Testing incremental structure model: Adding and removing files" + keywords="incremental-test,model-test" > + <compile staging="true" options="-incremental,-emacssym" sourceroots="."/> + <!-- On first compile, two source files in model, 'root' and 'Alpha' --> + <inc-compile tag="20" checkModel="java source file=3,FileMapSize=2"/> <!-- Adds primary.Beta class --> + <inc-compile tag="30" checkModel="java source file=4"/> <!-- Adds secondary.Gamma aspect --> + <inc-compile tag="40" checkModel="java source file=5,package=2,FileMapSize=4"/> <!-- Adds seconday.Delta class --> + <inc-compile tag="50" checkModel="java source file=4,package=2"/> <!-- Deletes Gamma aspect --> + <inc-compile tag="60" checkModel="java source file=2,FileMapSize=1"/> <!-- Deletes Beta and Delta classes --> + </ajc-test> + + +</suite>
\ No newline at end of file diff --git a/tests/incremental/model/intertype/primary/Alpha.java b/tests/incremental/model/intertype/primary/Alpha.java new file mode 100644 index 000000000..4f77e13d2 --- /dev/null +++ b/tests/incremental/model/intertype/primary/Alpha.java @@ -0,0 +1,7 @@ +package primary; + +public class Alpha { + public static void main(String [] argv) { + } +} + diff --git a/tests/incremental/model/intertype/secondary/BetaA.20.java b/tests/incremental/model/intertype/secondary/BetaA.20.java new file mode 100644 index 000000000..abe370ecd --- /dev/null +++ b/tests/incremental/model/intertype/secondary/BetaA.20.java @@ -0,0 +1,8 @@ +package secondary; + +import primary.Alpha; + +public aspect BetaA { + int Alpha.i; + String Alpha.s; +} diff --git a/tests/incremental/model/intertype/secondary/BetaA.30.java b/tests/incremental/model/intertype/secondary/BetaA.30.java new file mode 100644 index 000000000..394c7a925 --- /dev/null +++ b/tests/incremental/model/intertype/secondary/BetaA.30.java @@ -0,0 +1,7 @@ +package secondary; + +import primary.Alpha; + +public aspect BetaA { + String Alpha.s; +} diff --git a/tests/incremental/model/introduction/introduction/CloneablePoint.20.java b/tests/incremental/model/introduction/introduction/CloneablePoint.20.java new file mode 100644 index 000000000..c34509850 --- /dev/null +++ b/tests/incremental/model/introduction/introduction/CloneablePoint.20.java @@ -0,0 +1,42 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +*/ +package introduction; + +public aspect CloneablePoint { + + declare parents: Point implements Cloneable; + + public Object Point.clone() throws CloneNotSupportedException { + // we choose to bring all fields up to date before cloning. + makeRectangular(); + makePolar(); + return super.clone(); + } + + public static void main(String[] args){ + Point p1 = new Point(); + Point p2 = null; + + p1.setPolar(Math.PI, 1.0); + try { + p2 = (Point)p1.clone(); + } catch (CloneNotSupportedException e) {} + System.out.println("p1 =" + p1 ); + System.out.println("p2 =" + p2 ); + + p1.rotate(Math.PI / -2); + System.out.println("p1 =" + p1 ); + System.out.println("p2 =" + p2 ); + } +} diff --git a/tests/incremental/model/introduction/introduction/CloneablePoint.java b/tests/incremental/model/introduction/introduction/CloneablePoint.java new file mode 100644 index 000000000..c34509850 --- /dev/null +++ b/tests/incremental/model/introduction/introduction/CloneablePoint.java @@ -0,0 +1,42 @@ +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +*/ +package introduction; + +public aspect CloneablePoint { + + declare parents: Point implements Cloneable; + + public Object Point.clone() throws CloneNotSupportedException { + // we choose to bring all fields up to date before cloning. + makeRectangular(); + makePolar(); + return super.clone(); + } + + public static void main(String[] args){ + Point p1 = new Point(); + Point p2 = null; + + p1.setPolar(Math.PI, 1.0); + try { + p2 = (Point)p1.clone(); + } catch (CloneNotSupportedException e) {} + System.out.println("p1 =" + p1 ); + System.out.println("p2 =" + p2 ); + + p1.rotate(Math.PI / -2); + System.out.println("p1 =" + p1 ); + System.out.println("p2 =" + p2 ); + } +} diff --git a/tests/incremental/model/introduction/introduction/ComparablePoint.java b/tests/incremental/model/introduction/introduction/ComparablePoint.java new file mode 100644 index 000000000..a2893dba0 --- /dev/null +++ b/tests/incremental/model/introduction/introduction/ComparablePoint.java @@ -0,0 +1,46 @@ +/* +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. +*/ + +package introduction; + +public aspect ComparablePoint { + + declare parents: Point implements Comparable; + + public int Point.compareTo(Object o) { + return (int) (this.getRho() - ((Point)o).getRho()); + } + + public static void main(String[] args){ + Point p1 = new Point(); + Point p2 = new Point(); + + System.out.println("p1 =?= p2 :" + p1.compareTo(p2)); + + p1.setRectangular(2,5); + p2.setRectangular(2,5); + System.out.println("p1 =?= p2 :" + p1.compareTo(p2)); + + p2.setRectangular(3,6); + System.out.println("p1 =?= p2 :" + p1.compareTo(p2)); + + p1.setPolar(Math.PI, 4); + p2.setPolar(Math.PI, 4); + System.out.println("p1 =?= p2 :" + p1.compareTo(p2)); + + p1.rotate(Math.PI / 4.0); + System.out.println("p1 =?= p2 :" + p1.compareTo(p2)); + + p1.offset(1,1); + System.out.println("p1 =?= p2 :" + p1.compareTo(p2)); + } +} diff --git a/tests/incremental/model/introduction/introduction/HashablePoint.30.java b/tests/incremental/model/introduction/introduction/HashablePoint.30.java new file mode 100644 index 000000000..39eb33ba4 --- /dev/null +++ b/tests/incremental/model/introduction/introduction/HashablePoint.30.java @@ -0,0 +1,47 @@ +/* +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. +*/ + +package introduction; + +import java.util.Hashtable; + +public aspect HashablePoint { + + public int Point.hashCode() { + return (int) (getX() + getY() % Integer.MAX_VALUE); + } + + public boolean Point.equals(Object o) { + if (o == this) { return true; } + if (!(o instanceof Point)) { return false; } + Point other = (Point)o; + return (getX() == other.getX()) && (getY() == other.getY()); + } + + public static void main(String[] args) { + Hashtable h = new Hashtable(); + Point p1 = new Point(); + + p1.setRectangular(10, 10); + Point p2 = new Point(); + + p2.setRectangular(10, 10); + + System.out.println("p1 = " + p1); + System.out.println("p2 = " + p2); + System.out.println("p1.hashCode() = " + p1.hashCode()); + System.out.println("p2.hashCode() = " + p2.hashCode()); + + h.put(p1, "P1"); + System.out.println("Got: " + h.get(p2)); + } +} diff --git a/tests/incremental/model/introduction/introduction/HashablePoint.java b/tests/incremental/model/introduction/introduction/HashablePoint.java new file mode 100644 index 000000000..39eb33ba4 --- /dev/null +++ b/tests/incremental/model/introduction/introduction/HashablePoint.java @@ -0,0 +1,47 @@ +/* +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. +*/ + +package introduction; + +import java.util.Hashtable; + +public aspect HashablePoint { + + public int Point.hashCode() { + return (int) (getX() + getY() % Integer.MAX_VALUE); + } + + public boolean Point.equals(Object o) { + if (o == this) { return true; } + if (!(o instanceof Point)) { return false; } + Point other = (Point)o; + return (getX() == other.getX()) && (getY() == other.getY()); + } + + public static void main(String[] args) { + Hashtable h = new Hashtable(); + Point p1 = new Point(); + + p1.setRectangular(10, 10); + Point p2 = new Point(); + + p2.setRectangular(10, 10); + + System.out.println("p1 = " + p1); + System.out.println("p2 = " + p2); + System.out.println("p1.hashCode() = " + p1.hashCode()); + System.out.println("p2.hashCode() = " + p2.hashCode()); + + h.put(p1, "P1"); + System.out.println("Got: " + h.get(p2)); + } +} diff --git a/tests/incremental/model/introduction/introduction/Point.30.java b/tests/incremental/model/introduction/introduction/Point.30.java new file mode 100644 index 000000000..609a0488c --- /dev/null +++ b/tests/incremental/model/introduction/introduction/Point.30.java @@ -0,0 +1,98 @@ +/* + Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + + Use and copying of this software and preparation of derivative works based + upon this software are permitted. Any distribution of this software or + derivative works must comply with all applicable United States export control + laws. + + This software is made available AS IS, and Xerox Corporation makes no warranty + about the software, its performance or its conformity to any specification. +*/ + +package introduction; + +public class Point { + + protected double x = 0; + protected double y = 0; + protected double theta = 0; + protected double rho = 0; + + protected boolean polar = true; + protected boolean rectangular = true; + + public double getX(){ + makeRectangular(); + return x; + } + + public double getY(){ + makeRectangular(); + return y; + } + + public double getTheta(){ + makePolar(); + return theta; + } + + public double getRho(){ + makePolar(); + return rho; + } + + public void setRectangular(double newX, double newY){ + x = newX; + y = newY; + rectangular = true; + polar = false; + } + + public void setPolar(double newTheta, double newRho){ + theta = newTheta; + rho = newRho; + rectangular = false; + polar = true; + } + + public void rotate(double angle){ + setPolar(theta + angle, rho); + } + + public void offset(double deltaX, double deltaY){ + setRectangular(x + deltaX, y + deltaY); + } + + protected void makePolar(){ + if (!polar){ + theta = Math.atan2(y,x); + rho = y / Math.sin(theta); + polar = true; + } + } + + protected void makeRectangular(){ + if (!rectangular) { + x = rho * Math.sin(theta); + y = rho * Math.cos(theta); + rectangular = true; + } + } + + public String toString(){ + return "(" + getX() + ", " + getY() + ")[" + + getTheta() + " : " + getRho() + "]"; + } + + public static void main(String[] args){ + Point p1 = new Point(); + System.out.println("p1 =" + p1); + p1.setRectangular(5,2); + System.out.println("p1 =" + p1); + p1.setPolar( Math.PI / 4.0 , 1.0); + System.out.println("p1 =" + p1); + p1.setPolar( 0.3805 , 5.385); + System.out.println("p1 =" + p1); + } +} diff --git a/tests/incremental/model/introduction/introduction/Point.java b/tests/incremental/model/introduction/introduction/Point.java new file mode 100644 index 000000000..609a0488c --- /dev/null +++ b/tests/incremental/model/introduction/introduction/Point.java @@ -0,0 +1,98 @@ +/* + Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + + Use and copying of this software and preparation of derivative works based + upon this software are permitted. Any distribution of this software or + derivative works must comply with all applicable United States export control + laws. + + This software is made available AS IS, and Xerox Corporation makes no warranty + about the software, its performance or its conformity to any specification. +*/ + +package introduction; + +public class Point { + + protected double x = 0; + protected double y = 0; + protected double theta = 0; + protected double rho = 0; + + protected boolean polar = true; + protected boolean rectangular = true; + + public double getX(){ + makeRectangular(); + return x; + } + + public double getY(){ + makeRectangular(); + return y; + } + + public double getTheta(){ + makePolar(); + return theta; + } + + public double getRho(){ + makePolar(); + return rho; + } + + public void setRectangular(double newX, double newY){ + x = newX; + y = newY; + rectangular = true; + polar = false; + } + + public void setPolar(double newTheta, double newRho){ + theta = newTheta; + rho = newRho; + rectangular = false; + polar = true; + } + + public void rotate(double angle){ + setPolar(theta + angle, rho); + } + + public void offset(double deltaX, double deltaY){ + setRectangular(x + deltaX, y + deltaY); + } + + protected void makePolar(){ + if (!polar){ + theta = Math.atan2(y,x); + rho = y / Math.sin(theta); + polar = true; + } + } + + protected void makeRectangular(){ + if (!rectangular) { + x = rho * Math.sin(theta); + y = rho * Math.cos(theta); + rectangular = true; + } + } + + public String toString(){ + return "(" + getX() + ", " + getY() + ")[" + + getTheta() + " : " + getRho() + "]"; + } + + public static void main(String[] args){ + Point p1 = new Point(); + System.out.println("p1 =" + p1); + p1.setRectangular(5,2); + System.out.println("p1 =" + p1); + p1.setPolar( Math.PI / 4.0 , 1.0); + System.out.println("p1 =" + p1); + p1.setPolar( 0.3805 , 5.385); + System.out.println("p1 =" + p1); + } +} diff --git a/tests/incremental/model/sourcefiles_addremove/primary/Alpha.java b/tests/incremental/model/sourcefiles_addremove/primary/Alpha.java new file mode 100644 index 000000000..5e60f4f34 --- /dev/null +++ b/tests/incremental/model/sourcefiles_addremove/primary/Alpha.java @@ -0,0 +1,7 @@ + +package primary; + +public class Alpha { + public static void main (String[] args) { + } +} diff --git a/tests/incremental/model/sourcefiles_addremove/primary/Beta.20.java b/tests/incremental/model/sourcefiles_addremove/primary/Beta.20.java new file mode 100644 index 000000000..1ef401ca8 --- /dev/null +++ b/tests/incremental/model/sourcefiles_addremove/primary/Beta.20.java @@ -0,0 +1,11 @@ +package primary; + +public class Beta { + public static void main(String[] argv) { + sayhi(); + } + + public static void sayhi() { + System.err.println("Hi"); + } +} diff --git a/tests/incremental/model/sourcefiles_addremove/primary/Beta.delete.60.java b/tests/incremental/model/sourcefiles_addremove/primary/Beta.delete.60.java new file mode 100644 index 000000000..1ef401ca8 --- /dev/null +++ b/tests/incremental/model/sourcefiles_addremove/primary/Beta.delete.60.java @@ -0,0 +1,11 @@ +package primary; + +public class Beta { + public static void main(String[] argv) { + sayhi(); + } + + public static void sayhi() { + System.err.println("Hi"); + } +} diff --git a/tests/incremental/model/sourcefiles_addremove/secondary/Delta.40.java b/tests/incremental/model/sourcefiles_addremove/secondary/Delta.40.java new file mode 100644 index 000000000..ed410eda9 --- /dev/null +++ b/tests/incremental/model/sourcefiles_addremove/secondary/Delta.40.java @@ -0,0 +1,5 @@ +package secondary; + +public class Delta { + public static void foo() { } +} diff --git a/tests/incremental/model/sourcefiles_addremove/secondary/Delta.delete.60.java b/tests/incremental/model/sourcefiles_addremove/secondary/Delta.delete.60.java new file mode 100644 index 000000000..ed410eda9 --- /dev/null +++ b/tests/incremental/model/sourcefiles_addremove/secondary/Delta.delete.60.java @@ -0,0 +1,5 @@ +package secondary; + +public class Delta { + public static void foo() { } +} diff --git a/tests/incremental/model/sourcefiles_addremove/secondary/Gamma.30.java b/tests/incremental/model/sourcefiles_addremove/secondary/Gamma.30.java new file mode 100644 index 000000000..edbe7169f --- /dev/null +++ b/tests/incremental/model/sourcefiles_addremove/secondary/Gamma.30.java @@ -0,0 +1,7 @@ +package secondary; + +aspect Gamma { + before(): call(* *(..)) { + } +} + diff --git a/tests/incremental/model/sourcefiles_addremove/secondary/Gamma.delete.50.java b/tests/incremental/model/sourcefiles_addremove/secondary/Gamma.delete.50.java new file mode 100644 index 000000000..edbe7169f --- /dev/null +++ b/tests/incremental/model/sourcefiles_addremove/secondary/Gamma.delete.50.java @@ -0,0 +1,7 @@ +package secondary; + +aspect Gamma { + before(): call(* *(..)) { + } +} + diff --git a/tests/incremental/model/sourcefiles_updating/primary/Alpha.java b/tests/incremental/model/sourcefiles_updating/primary/Alpha.java new file mode 100644 index 000000000..5e60f4f34 --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/primary/Alpha.java @@ -0,0 +1,7 @@ + +package primary; + +public class Alpha { + public static void main (String[] args) { + } +} diff --git a/tests/incremental/model/sourcefiles_updating/primary/Beta.20.java b/tests/incremental/model/sourcefiles_updating/primary/Beta.20.java new file mode 100644 index 000000000..4efd977e8 --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/primary/Beta.20.java @@ -0,0 +1,13 @@ +package primary; + +// Method added beyond what was in Beta.java + +public class Beta { + public static void main(String[] argv) { + sayhi(); + } + + public static void sayhi() { + System.err.println("Hi"); + } +} diff --git a/tests/incremental/model/sourcefiles_updating/primary/Beta.java b/tests/incremental/model/sourcefiles_updating/primary/Beta.java new file mode 100644 index 000000000..86dc7dfd8 --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/primary/Beta.java @@ -0,0 +1,7 @@ +package primary; + +public class Beta { + public static void main(String[] argv) { + } + +} diff --git a/tests/incremental/model/sourcefiles_updating/secondary/Delta.30.java b/tests/incremental/model/sourcefiles_updating/secondary/Delta.30.java new file mode 100644 index 000000000..f54b3f7f0 --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/secondary/Delta.30.java @@ -0,0 +1,10 @@ +package secondary; + +// Extra class added over Delta.java + +public class Delta { + public static void foo() { } +} + +class DeltaExtra { +} diff --git a/tests/incremental/model/sourcefiles_updating/secondary/Delta.java b/tests/incremental/model/sourcefiles_updating/secondary/Delta.java new file mode 100644 index 000000000..ed410eda9 --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/secondary/Delta.java @@ -0,0 +1,5 @@ +package secondary; + +public class Delta { + public static void foo() { } +} diff --git a/tests/incremental/model/sourcefiles_updating/secondary/Gamma.40.java b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.40.java new file mode 100644 index 000000000..7e508af0e --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.40.java @@ -0,0 +1,10 @@ +package secondary; + +aspect Gamma { + before(): call(* *(..)) { + } + + after(): call(* *(..)) { + } +} + diff --git a/tests/incremental/model/sourcefiles_updating/secondary/Gamma.50.java b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.50.java new file mode 100644 index 000000000..a380f8651 --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.50.java @@ -0,0 +1,13 @@ +package secondary; + +aspect Gamma { + + pointcut calls(): call(* *(..)); + + before(): calls() { + } + + after(): calls() { + } +} + diff --git a/tests/incremental/model/sourcefiles_updating/secondary/Gamma.60.java b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.60.java new file mode 100644 index 000000000..de4cf6d81 --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.60.java @@ -0,0 +1,8 @@ +package secondary; + +aspect Gamma { + + pointcut calls(): call(* *(..)); + +} + diff --git a/tests/incremental/model/sourcefiles_updating/secondary/Gamma.java b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.java new file mode 100644 index 000000000..edbe7169f --- /dev/null +++ b/tests/incremental/model/sourcefiles_updating/secondary/Gamma.java @@ -0,0 +1,7 @@ +package secondary; + +aspect Gamma { + before(): call(* *(..)) { + } +} + diff --git a/tests/incremental/model/weaving/primary/Alpha.java b/tests/incremental/model/weaving/primary/Alpha.java new file mode 100644 index 000000000..e51f9f972 --- /dev/null +++ b/tests/incremental/model/weaving/primary/Alpha.java @@ -0,0 +1,21 @@ +package primary; + +public class Alpha { + public static void main(String[] argv) { + Alpha instance = new Alpha(); + instance.m1(); + instance.m2(); + instance.m3(); + } + + public void m1() { + } + + public boolean m2() { + return false; + } + + public String m3() { + return ""; + } +} diff --git a/tests/incremental/model/weaving/primary/BetaA.20.java b/tests/incremental/model/weaving/primary/BetaA.20.java new file mode 100644 index 000000000..74ff7481f --- /dev/null +++ b/tests/incremental/model/weaving/primary/BetaA.20.java @@ -0,0 +1,16 @@ +package primary; + +public aspect BetaA { + + pointcut m1call(): call(* m1(..)); + + before(): m1call() { + System.err.println("m1 got called"); + } + + pointcut m2call(): call(* m2(..)); + + before(): m2call() { + System.err.println("m2 got called"); + } +} diff --git a/tests/incremental/model/weaving/primary/BetaA.30.java b/tests/incremental/model/weaving/primary/BetaA.30.java new file mode 100644 index 000000000..eeba653b7 --- /dev/null +++ b/tests/incremental/model/weaving/primary/BetaA.30.java @@ -0,0 +1,10 @@ +package primary; + +public aspect BetaA { + + pointcut m2call(): call(* m2(..)); + + before(): m2call() { + System.err.println("m2 got called"); + } +} diff --git a/tests/incremental/model/weaving/primary/BetaA.40.java b/tests/incremental/model/weaving/primary/BetaA.40.java new file mode 100644 index 000000000..706cebb17 --- /dev/null +++ b/tests/incremental/model/weaving/primary/BetaA.40.java @@ -0,0 +1,5 @@ +package primary; + +public aspect BetaA { + +} diff --git a/tests/incremental/model/weaving/primary/BetaA.java b/tests/incremental/model/weaving/primary/BetaA.java new file mode 100644 index 000000000..333c5f187 --- /dev/null +++ b/tests/incremental/model/weaving/primary/BetaA.java @@ -0,0 +1,10 @@ +package primary; + +public aspect BetaA { + + pointcut m1call(): call(* m1(..)); + + before(): m1call() { + System.err.println("m1 got called"); + } +} diff --git a/tests/incremental/model/weaving2/primary/Alpha.java b/tests/incremental/model/weaving2/primary/Alpha.java new file mode 100644 index 000000000..ab7e82c16 --- /dev/null +++ b/tests/incremental/model/weaving2/primary/Alpha.java @@ -0,0 +1,11 @@ +package primary; + +public class Alpha { + public static void main(String[]argv) { + try { + System.err.println("aaa"); + } catch (Throwable t) { + System.err.println("Caught:"+t); + } + } +} diff --git a/tests/incremental/model/weaving2/primary/BetaA.20.java b/tests/incremental/model/weaving2/primary/BetaA.20.java new file mode 100644 index 000000000..1c73c6b9d --- /dev/null +++ b/tests/incremental/model/weaving2/primary/BetaA.20.java @@ -0,0 +1,8 @@ +package primary; + +public aspect BetaA { + pointcut handlers(): handler(Throwable); + before(): handlers() { + System.err.println("xxx"); + } +} diff --git a/tests/incremental/model/weaving2/primary/BetaA.delete.40.java b/tests/incremental/model/weaving2/primary/BetaA.delete.40.java new file mode 100644 index 000000000..1c73c6b9d --- /dev/null +++ b/tests/incremental/model/weaving2/primary/BetaA.delete.40.java @@ -0,0 +1,8 @@ +package primary; + +public aspect BetaA { + pointcut handlers(): handler(Throwable); + before(): handlers() { + System.err.println("xxx"); + } +} diff --git a/tests/incremental/model/weaving2/primary/BetaA.java b/tests/incremental/model/weaving2/primary/BetaA.java new file mode 100644 index 000000000..1b8b1d7c8 --- /dev/null +++ b/tests/incremental/model/weaving2/primary/BetaA.java @@ -0,0 +1,4 @@ +package primary; + +public aspect BetaA { +} diff --git a/tests/incremental/model/weaving2/secondary/GammaA.30.java b/tests/incremental/model/weaving2/secondary/GammaA.30.java new file mode 100644 index 000000000..be2bec758 --- /dev/null +++ b/tests/incremental/model/weaving2/secondary/GammaA.30.java @@ -0,0 +1,8 @@ +package primary; + +public aspect GammaA { + pointcut handlers(): handler(Throwable); + before(): handlers() { + System.err.println("xxx"); + } +} |