Lines 704-707
Link Here
|
704 |
expectingNoMarkers(); |
704 |
expectingNoMarkers(); |
705 |
} |
705 |
} |
706 |
|
706 |
|
|
|
707 |
/** |
708 |
* This test makes sure that changing an annotation on type A causes type B |
709 |
* to be recompiled, if B references A. See http://bugs.eclipse.org/149768 |
710 |
*/ |
711 |
|
712 |
public void testAnnotationDependency() throws Exception |
713 |
{ |
714 |
IProject project = env.getProject( getProjectName() ); |
715 |
IPath srcRoot = getSourcePath( getProjectName() ); |
716 |
|
717 |
String a1Code = "package p1; " + "\n" |
718 |
+ "import org.eclipse.jdt.apt.tests.annotations.noop.NoOpAnnotation;" + "\n" |
719 |
+ "@NoOpAnnotation(\"A1\")" + "\n" |
720 |
+ "public class A {}"; |
721 |
String a2Code = "package p1; " + "\n" |
722 |
+ "import org.eclipse.jdt.apt.tests.annotations.noop.NoOpAnnotation;" + "\n" |
723 |
+ "@NoOpAnnotation(\"A2\")" + "\n" |
724 |
+ "public class A {}"; |
725 |
String bCode = "package p1; " + "\n" |
726 |
+ "public class B {" + "\n" |
727 |
+ " public A a;" + "\n" |
728 |
+ "}"; |
729 |
|
730 |
env.addClass( srcRoot, "p1", "A", a1Code ); |
731 |
env.addClass( srcRoot, "p1", "B", bCode ); |
732 |
|
733 |
fullBuild( project.getFullPath() ); |
734 |
expectingNoProblems(); |
735 |
|
736 |
// edit annotation in A |
737 |
env.addClass( srcRoot, "p1", "A", a2Code ); |
738 |
incrementalBuild( project.getFullPath() ); |
739 |
expectingNoProblems(); |
740 |
|
741 |
// verify that B was recompiled |
742 |
expectingUniqueCompiledClasses(new String[] { "p1.A", "p1.B" }); |
743 |
} |
744 |
|
707 |
} |
745 |
} |