This commit is contained in:
Timo Westkämper 2010-08-02 20:46:32 +00:00
parent f715b9eae1
commit f68da31101
2 changed files with 24 additions and 0 deletions

View File

@ -4,11 +4,13 @@ import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.annotation.ElementType;
import org.junit.Test;
@TestAnnotation(prop2 = false, clazz = AnnotationTest.class)
@TestAnnotation2("Hello")
@TestAnnotation3(type = ElementType.ANNOTATION_TYPE)
public class AnnotationTest {
@ -26,6 +28,12 @@ public class AnnotationTest {
writer.annotation(getClass().getAnnotation(TestAnnotation2.class));
assertEquals("@com.mysema.codegen.TestAnnotation2(\"Hello\")", w.toString().trim());
}
@Test
public void testClassAnnotation3() throws IOException{
writer.annotation(getClass().getAnnotation(TestAnnotation3.class));
assertEquals("@com.mysema.codegen.TestAnnotation3(type=java.lang.annotation.ElementType.ANNOTATION_TYPE)", w.toString().trim());
}
@Test

View File

@ -0,0 +1,16 @@
package com.mysema.codegen;
import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target( { TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface TestAnnotation3 {
ElementType type();
}