package org.izforge.izpack;

import com.izforge.izpack.compiler.CompilerConfig;
import com.izforge.izpack.compiler.CompilerException;
import org.apache.commons.io.FileUtils;
import org.hamcrest.CoreMatchers;
import org.hamcrest.MatcherAssert;
import org.hamcrest.core.Is;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.File;

import static org.hamcrest.MatcherAssert.*;

/**
 * Test for an Izpack compilation
 */
public class CompilationTest {
    @Rule
    public TemporaryFolder temporaryFolder = new TemporaryFolder();

    @Test
    public void testCompile() throws Exception {
        File baseDir = new File(getClass().getClassLoader().getResource("samples1").getFile());

        File installerFile = new File(getClass().getClassLoader().getResource("samples1/install.xml").getFile());

        System.out.println(installerFile.getAbsolutePath());
        System.out.println(baseDir.getAbsolutePath());
        CompilerConfig c = new CompilerConfig(installerFile.getAbsolutePath(), baseDir.getAbsolutePath(), "default", "out.jar");
        CompilerConfig.setIzpackHome(".");
        c.executeCompiler();
        assertThat(c.wasSuccessful(), Is.is(true));

    }

}

@@ -601,23 +601,26 @@
 oid test
-Compile
+Successful
 () throw
@@ -721,33 +721,32 @@
 1%22).getFile());%0A
-%0A
         File ins
@@ -843,25 +843,24 @@
 ile());%0A
-%0A
         
 System.o
@@ -855,116 +855,66 @@
     
-System.out.println(installerFile.getAbsolutePath());%0A        System.out.println(baseDir.getAbsolutePath()
+File out = new File(baseDir.getParentFile(), %22out.jar%22
 );%0A
+%0A
     
@@ -1026,25 +1026,37 @@
 fault%22, 
-%22
 out.
-jar%22
+getAbsolutePath()
 );%0A     
@@ -1174,17 +1174,16 @@
 true));%0A
-%0A
     %7D%0A%0A%7D

Change output destination