@@ -0,0 +1,5 @@ | |||
public aspect A { | |||
declare @type: T: @Foo; | |||
} |
@@ -0,0 +1,6 @@ | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
public @interface Foo { | |||
} |
@@ -0,0 +1,4 @@ | |||
public class T { | |||
} |
@@ -0,0 +1,4 @@ | |||
public aspect A { | |||
declare @type: T: @a.b.c.Foo; | |||
} |
@@ -0,0 +1,7 @@ | |||
package a.b.c; | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
public @interface Foo { | |||
} |
@@ -0,0 +1,4 @@ | |||
public class T { | |||
} |
@@ -0,0 +1,4 @@ | |||
public class T { | |||
} |
@@ -0,0 +1,4 @@ | |||
public aspect A { | |||
declare @type: T: @Foo; | |||
} |
@@ -0,0 +1,6 @@ | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
public @interface Foo { | |||
} |
@@ -0,0 +1,4 @@ | |||
public class T { | |||
} |
@@ -0,0 +1,4 @@ | |||
public class T { | |||
} |
@@ -626,12 +626,14 @@ public class AjdeInteractionTestbed extends TestCase { | |||
private boolean receivedBatchBuildMessage = false; | |||
private List errorMessages = new ArrayList(); | |||
private List warningMessages = new ArrayList(); | |||
private List weavingMessages = new ArrayList(); | |||
public static void reset() { | |||
_instance.receivedNonIncrementalBuildMessage=false; | |||
_instance.receivedBatchBuildMessage=false; | |||
_instance.errorMessages.clear(); | |||
_instance.warningMessages.clear(); | |||
_instance.weavingMessages.clear(); | |||
} | |||
// public static boolean defaultedToBatch() { | |||
@@ -654,6 +656,10 @@ public class AjdeInteractionTestbed extends TestCase { | |||
return _instance.warningMessages; | |||
} | |||
public static List/*IMessage*/ getWeavingMessages() { | |||
return _instance.weavingMessages; | |||
} | |||
public static TaskListManager getInstance() { | |||
return _instance; | |||
} | |||
@@ -668,12 +674,9 @@ public class AjdeInteractionTestbed extends TestCase { | |||
// if (message.getMessage().startsWith(CANT_BUILD_INCREMENTAL_INDICATION)) _instance.receivedNonIncrementalBuildMessage=true; | |||
// if (message.getMessage().startsWith(DOING_BATCH_BUILD_INDICATION)) _instance.receivedBatchBuildMessage=true; | |||
// } | |||
if (message.getKind()==IMessage.ERROR) { | |||
errorMessages.add(message); | |||
} | |||
if (message.getKind()==IMessage.WARNING) { | |||
warningMessages.add(message); | |||
} | |||
if (message.getKind()==IMessage.ERROR) errorMessages.add(message); | |||
if (message.getKind()==IMessage.WARNING) warningMessages.add(message); | |||
if (message.getKind()==IMessage.WEAVEINFO) weavingMessages.add(message); | |||
log("TaskListManager.addSourcelineTask("+message+")"); | |||
} | |||
@@ -515,7 +515,7 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed { | |||
} | |||
public void testPr112736() { | |||
AjdeInteractionTestbed.VERBOSE = true; | |||
// AjdeInteractionTestbed.VERBOSE = true; | |||
initialiseProject("PR112736"); | |||
build("PR112736"); | |||
checkWasFullBuild(); | |||
@@ -547,6 +547,52 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed { | |||
checkWasFullBuild(); // back to the source | |||
} | |||
public void testPr128655() { | |||
configureNonStandardCompileOptions("-showWeaveInfo"); | |||
initialiseProject("pr128655"); | |||
build("pr128655"); | |||
List firstBuildMessages = MyTaskListManager.getWeavingMessages(); | |||
assertTrue("Should be at least one message about the dec @type, but there were none",firstBuildMessages.size()>0); | |||
alter("pr128655","inc1"); | |||
build("pr128655"); | |||
checkWasntFullBuild(); // back to the source | |||
List secondBuildMessages = MyTaskListManager.getWeavingMessages(); | |||
// check they are the same | |||
for (int i = 0; i < firstBuildMessages.size(); i++) { | |||
IMessage m1 = (IMessage)firstBuildMessages.get(i); | |||
IMessage m2 = (IMessage)secondBuildMessages.get(i); | |||
if (!m1.toString().equals(m2.toString())) { | |||
System.err.println("Message during first build was: "+m1); | |||
System.err.println("Message during second build was: "+m1); | |||
fail("The two messages should be the same, but are not: \n"+m1+"!="+m2); | |||
} | |||
} | |||
} | |||
// Similar to above, but now the annotation is in the default package | |||
public void testPr128655_2() { | |||
configureNonStandardCompileOptions("-showWeaveInfo"); | |||
initialiseProject("pr128655_2"); | |||
build("pr128655_2"); | |||
List firstBuildMessages = MyTaskListManager.getWeavingMessages(); | |||
assertTrue("Should be at least one message about the dec @type, but there were none",firstBuildMessages.size()>0); | |||
alter("pr128655_2","inc1"); | |||
build("pr128655_2"); | |||
checkWasntFullBuild(); // back to the source | |||
List secondBuildMessages = MyTaskListManager.getWeavingMessages(); | |||
// check they are the same | |||
for (int i = 0; i < firstBuildMessages.size(); i++) { | |||
IMessage m1 = (IMessage)firstBuildMessages.get(i); | |||
IMessage m2 = (IMessage)secondBuildMessages.get(i); | |||
if (!m1.toString().equals(m2.toString())) { | |||
System.err.println("Message during first build was: "+m1); | |||
System.err.println("Message during second build was: "+m1); | |||
fail("The two messages should be the same, but are not: \n"+m1+"!="+m2); | |||
} | |||
} | |||
} | |||
// other possible tests: | |||
// - memory usage (freemem calls?) | |||
// - relationship map |