Search in sources :

Example 1 with JGITCompilerBeforeDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator in project kie-wb-common by kiegroup.

the class KieMavenCompilerFactoryTest method jgitBeforeAndKieAndLogAfterDecoratorTest.

@Test
public void jgitBeforeAndKieAndLogAfterDecoratorTest() {
    final AFCompiler jgitBeforeAndLogAfter = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.UPDATE_JGIT_BEFORE_BUILD, KieDecorator.STORE_KIE_OBJECTS, KieDecorator.ENABLE_LOGGING));
    assertThat(jgitBeforeAndLogAfter).isInstanceOf(JGITCompilerBeforeDecorator.class);
    AFCompiler kieAfterDecorator = ((JGITCompilerBeforeDecorator) jgitBeforeAndLogAfter).getCompiler();
    assertThat(kieAfterDecorator).isInstanceOf(KieAfterDecorator.class);
    AFCompiler outputLofAfterDecorator = ((KieAfterDecorator) kieAfterDecorator).getCompiler();
    assertThat(outputLofAfterDecorator).isInstanceOf(OutputLogAfterDecorator.class);
    AFCompiler baseMavenCompiler = ((OutputLogAfterDecorator) outputLofAfterDecorator).getCompiler();
    assertThat(baseMavenCompiler).isInstanceOf(BaseMavenCompiler.class);
}
Also used : KieAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator) JGITCompilerBeforeDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator) OutputLogAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler) Test(org.junit.Test)

Example 2 with JGITCompilerBeforeDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator in project kie-wb-common by kiegroup.

the class KieMavenCompilerFactoryTest method jgitBeforeAndKieAndLogAndClasspathAfterTest.

@Test
public void jgitBeforeAndKieAndLogAndClasspathAfterTest() {
    AFCompiler jgitBeforeAndLogAfter = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.UPDATE_JGIT_BEFORE_BUILD, KieDecorator.STORE_KIE_OBJECTS, KieDecorator.ENABLE_LOGGING, KieDecorator.STORE_BUILD_CLASSPATH));
    assertThat(jgitBeforeAndLogAfter).isInstanceOf(JGITCompilerBeforeDecorator.class);
    AFCompiler kieAfterDecorator = ((JGITCompilerBeforeDecorator) jgitBeforeAndLogAfter).getCompiler();
    assertThat(kieAfterDecorator).isInstanceOf(KieAfterDecorator.class);
    AFCompiler outputLofAfterDecorator = ((KieAfterDecorator) kieAfterDecorator).getCompiler();
    assertThat(outputLofAfterDecorator).isInstanceOf(OutputLogAfterDecorator.class);
    AFCompiler classpathAfter = ((OutputLogAfterDecorator) outputLofAfterDecorator).getCompiler();
    assertThat(classpathAfter).isInstanceOf(ClasspathDepsAfterDecorator.class);
    AFCompiler baseMavenCompiler = ((ClasspathDepsAfterDecorator) classpathAfter).getCompiler();
    assertThat(baseMavenCompiler).isInstanceOf(BaseMavenCompiler.class);
}
Also used : KieAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator) JGITCompilerBeforeDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator) ClasspathDepsAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.ClasspathDepsAfterDecorator) OutputLogAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler) Test(org.junit.Test)

Example 3 with JGITCompilerBeforeDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator in project kie-wb-common by kiegroup.

the class KieMavenCompilerFactoryTest method jgitBeforeAndKieAfterDecoratorTest.

@Test
public void jgitBeforeAndKieAfterDecoratorTest() {
    final AFCompiler jgitBeforeAndLogAfter = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.UPDATE_JGIT_BEFORE_BUILD, KieDecorator.STORE_KIE_OBJECTS));
    assertThat(jgitBeforeAndLogAfter).isInstanceOf(JGITCompilerBeforeDecorator.class);
    AFCompiler kieAfterDecorator = ((JGITCompilerBeforeDecorator) jgitBeforeAndLogAfter).getCompiler();
    assertThat(kieAfterDecorator).isInstanceOf(KieAfterDecorator.class);
    AFCompiler baseMavenCompiler = ((KieAfterDecorator) kieAfterDecorator).getCompiler();
    assertThat(baseMavenCompiler).isInstanceOf(BaseMavenCompiler.class);
}
Also used : KieAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator) JGITCompilerBeforeDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler) Test(org.junit.Test)

Example 4 with JGITCompilerBeforeDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator in project kie-wb-common by kiegroup.

the class KieMavenCompilerFactoryTest method jgitBeforeAndLogAfterDecoratorTest.

@Test
public void jgitBeforeAndLogAfterDecoratorTest() {
    final AFCompiler jgitBeforeAndLogAfter = KieMavenCompilerFactory.getCompiler(EnumSet.of(KieDecorator.UPDATE_JGIT_BEFORE_BUILD, KieDecorator.ENABLE_LOGGING));
    assertThat(jgitBeforeAndLogAfter).isInstanceOf(JGITCompilerBeforeDecorator.class);
    AFCompiler outputLofAfterDecorator = ((JGITCompilerBeforeDecorator) jgitBeforeAndLogAfter).getCompiler();
    assertThat(outputLofAfterDecorator).isInstanceOf(OutputLogAfterDecorator.class);
    AFCompiler baseMavenCompiler = ((OutputLogAfterDecorator) outputLofAfterDecorator).getCompiler();
    assertThat(baseMavenCompiler).isInstanceOf(BaseMavenCompiler.class);
}
Also used : JGITCompilerBeforeDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator) OutputLogAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler) Test(org.junit.Test)

Example 5 with JGITCompilerBeforeDecorator

use of org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator in project kie-wb-common by kiegroup.

the class KieMavenCompilerFactory method createAndAddNewCompiler.

private static <T extends CompilationResponse> AFCompiler<T> createAndAddNewCompiler(Set<KieDecorator> decorators) {
    boolean enableIncremental = decorators.contains(KieDecorator.ENABLE_INCREMENTAL_BUILD);
    boolean enableLogging = decorators.contains(KieDecorator.ENABLE_LOGGING);
    // Order of the construction of the decorators matters, DO not change the order.
    AFCompiler compiler = new BaseMavenCompiler(enableIncremental, enableLogging);
    if (decorators.contains(KieDecorator.STORE_BUILD_CLASSPATH)) {
        compiler = new ClasspathDepsAfterDecorator(compiler);
    }
    if (decorators.contains(KieDecorator.ENABLE_LOGGING)) {
        compiler = new OutputLogAfterDecorator(compiler);
    }
    if (decorators.contains(KieDecorator.STORE_KIE_OBJECTS)) {
        compiler = new KieAfterDecorator(compiler);
    }
    if (decorators.contains(KieDecorator.UPDATE_JGIT_BEFORE_BUILD)) {
        compiler = new JGITCompilerBeforeDecorator(compiler);
    }
    return compiler;
}
Also used : KieAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator) ClasspathDepsAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.ClasspathDepsAfterDecorator) JGITCompilerBeforeDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator) OutputLogAfterDecorator(org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator) BaseMavenCompiler(org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler) AFCompiler(org.kie.workbench.common.services.backend.compiler.AFCompiler)

Aggregations

AFCompiler (org.kie.workbench.common.services.backend.compiler.AFCompiler)5 JGITCompilerBeforeDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.JGITCompilerBeforeDecorator)5 Test (org.junit.Test)4 KieAfterDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.KieAfterDecorator)4 OutputLogAfterDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.OutputLogAfterDecorator)4 ClasspathDepsAfterDecorator (org.kie.workbench.common.services.backend.compiler.impl.decorators.ClasspathDepsAfterDecorator)2 BaseMavenCompiler (org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler)1