package com.izforge.izpack.compiler.container;

import com.izforge.izpack.compiler.data.CompilerData;
import com.izforge.izpack.core.container.AbstractContainer;
import com.izforge.izpack.test.InstallFile;
import org.junit.rules.TemporaryFolder;

import java.io.File;

/**
 * Container for compilation test
 *
 * @author Anthonin Bonnefoy
 */
public class TestCompilerContainer extends AbstractContainer
{
    private Class klass;

    public TestCompilerContainer(Class klass)
    {
        this.klass = klass;
    }

    public void initBindings() throws Exception
    {
        CompilerContainer compilerContainer = new CompilerContainer();
        compilerContainer.initBindings();
        pico = compilerContainer.getContainer();

        String installFileName = ((InstallFile) klass.getAnnotation(InstallFile.class)).value();

        File baseDir = new TemporaryFolder().newFolder("baseDirTemp");
        File installerFile = new File(getClass().getClassLoader().getResource(installFileName).getFile());

        File out = new File(baseDir, "out.jar");
        out.delete();
        CompilerData data = new CompilerData(installerFile.getAbsolutePath(), baseDir.getAbsolutePath(), out.getAbsolutePath());
        pico.addConfig("installFile", installerFile.getAbsolutePath());
        pico.addComponent(CompilerData.class, data);
        pico.addComponent(File.class, out);
    }
}

@@ -99,68 +99,8 @@
 ta;%0A
-import com.izforge.izpack.core.container.AbstractContainer;%0A
 impo
@@ -323,16 +323,16 @@
 nds 
-Abstract
+Compiler
 Cont
@@ -486,194 +486,44 @@
 gs()
- throws Exception%0A    %7B%0A        CompilerContainer compilerContainer = new CompilerContainer();%0A        compilerContainer.initBindings();%0A        pico = compilerContainer.getContainer();%0A
+%0A    %7B%0A        super.initBindings();
 %0A   

Use inheritance in TestCompilerContainer