mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
This commit is contained in:
parent
f715b9eae1
commit
f68da31101
@ -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
|
||||
|
||||
16
src/test/java/com/mysema/codegen/TestAnnotation3.java
Normal file
16
src/test/java/com/mysema/codegen/TestAnnotation3.java
Normal 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();
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user