--- /dev/null
+package annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+@Target(ElementType.TYPE)
+public @interface A { }
" but found " + ipe.getSourceSignature(),
expected, ipe.getSourceSignature());
}
+ public void testAspected_Annotation(){
+ runTest("ensure Annotations are added to import list");
+ IHierarchy top = AsmManager.getDefault().getHierarchy();
+
+ IProgramElement ipe = top.findElementForLabel(top.getRoot(),
+ IProgramElement.Kind.IMPORT_REFERENCE,"annotation.A");
+ String expected = "import annotation.A;";
+ assertEquals("expected source signature to be " + expected +
+ " but found " + ipe.getSourceSignature(),
+ expected, ipe.getSourceSignature());
+
+ }
public void testGetSourceSignature_GenericMethods(){
runTest("ensure getSourceSignature correct with generic method");
<ajc-test dir="bugs153/GenericMethod" title="ensure getSourceSignature correct with generic method">
<compile files="C.java" options="-1.5 -emacssym"/>
</ajc-test>
+
+ <ajc-test dir="bugs153/Annotation" title="ensure Annotations are added to import list">
+ <compile files="C.java, Anno.aj, A.java" options="-1.5 -emacssym"/>
+ </ajc-test>
</suite>
\ No newline at end of file