diff options
Diffstat (limited to 'container-compiler-plugin/src/test/java/io/trygvis/container')
-rw-r--r-- | container-compiler-plugin/src/test/java/io/trygvis/container/compiler/ProcessorTest.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/container-compiler-plugin/src/test/java/io/trygvis/container/compiler/ProcessorTest.java b/container-compiler-plugin/src/test/java/io/trygvis/container/compiler/ProcessorTest.java index c661f8b..c7891fc 100644 --- a/container-compiler-plugin/src/test/java/io/trygvis/container/compiler/ProcessorTest.java +++ b/container-compiler-plugin/src/test/java/io/trygvis/container/compiler/ProcessorTest.java @@ -12,6 +12,7 @@ import javax.tools.ToolProvider; import java.io.IOException; import java.net.URL; import java.nio.charset.Charset; +import java.util.List; import java.util.Locale; import java.util.Map; @@ -30,11 +31,13 @@ public class ProcessorTest { InMemoryJavaFileManager fileManager = new InMemoryJavaFileManager(standardFileManager); - JavaSourceFromString person = loadCode("io.trygvis.persistence.test.Person"); - JavaSourceFromString packageInfo = loadCode("io.trygvis.persistence.test.package-info"); + List<JavaSourceFromString> sources = asList( + loadJava("io.trygvis.persistence.test.package-info"), + loadJava("io.trygvis.persistence.test.Person"), + loadJava("io.trygvis.persistence.test.ParentEntity"), + loadJava("io.trygvis.persistence.test.ChildEntity")); - JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, collector, null, - null, asList(person, packageInfo)); + JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, collector, null, null, sources); task.setProcessors(asList(new MyProcessor())); @@ -66,7 +69,7 @@ public class ProcessorTest { fileManager.close(); } - private JavaSourceFromString loadCode(String className) throws IOException { + private JavaSourceFromString loadJava(String className) throws IOException { String path = "/" + className.replace('.', '/') + ".java"; URL resource = getClass().getResource(path); if (resource == null) { |