@BeforeClass
public static void generateModel() throws Exception {
final JCodeModel jCodeModel = new JCodeModel();
final JPackage jp = jCodeModel.rootPackage();
final JDefinedClass jClass = jp._class(JMod.PUBLIC, "ClassUnderTest");
JAnnotationUse jAnnotationUse = jClass.annotate(InitialDataSets.class);
jAnnotationUse.param("value", "Script.file");
jClass.annotate(Cleanup.class);
final JFieldVar jField = jClass.field(JMod.PRIVATE, String.class, "testField");
jField.annotate(PersistenceContext.class);
final JMethod jMethod = jClass.method(JMod.PUBLIC, jCodeModel.VOID, "testMethod");
jAnnotationUse = jMethod.annotate(InitialDataSets.class);
jAnnotationUse.param("value", "InitialDataSets.file");
jAnnotationUse = jMethod.annotate(ApplyScriptsAfter.class);
jAnnotationUse.param("value", "ApplyScriptsAfter.file");
buildModel(testFolder.getRoot(), jCodeModel);
compileModel(testFolder.getRoot());
cut = loadClass(testFolder.getRoot(), jClass.name());
}
AnnotationInspectorTest.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:jpa-unit
作者:
评论列表
文章目录