From 72ebde8fb387377e167bde8fa5e81f51198047ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Westk=C3=A4mper?= Date: Mon, 26 Apr 2010 11:08:30 +0000 Subject: [PATCH] added test for SimpleCompiler --- .../mysema/codegen/SimpleCompilerTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/test/java/com/mysema/codegen/SimpleCompilerTest.java 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"); + } + } + +}