diff --git a/src/test/java/com/mysema/codegen/SimpleCompilerTest.java b/src/test/java/com/mysema/codegen/SimpleCompilerTest.java new file mode 100644 index 000000000..6fd3a3e22 --- /dev/null +++ b/src/test/java/com/mysema/codegen/SimpleCompilerTest.java @@ -0,0 +1,30 @@ +package com.mysema.codegen; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import javax.tools.JavaCompiler; + +import junit.framework.Assert; + +import org.junit.Test; + +public class SimpleCompilerTest { + + @Test + public void testRun() { + new File("target/out").mkdir(); + JavaCompiler compiler = new SimpleCompiler(); + System.out.println(compiler.getClass().getName()); + List options = new ArrayList(3); + options.add("-s"); + options.add("target/out"); + options.add("src/test/java/com/mysema/codegen/SimpleCompilerTest.java"); + int compilationResult = compiler.run(null, null, null, options.toArray(new String[options.size()])); + if(compilationResult != 0){ + Assert.fail("Compilation Failed"); + } + } + +}