use of org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler in project kie-wb-common by kiegroup.
the class ClasspathDepsAfterDecoratorTest method failCompileTest.
@Test
public void failCompileTest() throws IOException {
CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, createdNewPrjInRepo("dummy-fail", ResourcesConstants.DUMMY_FAIL_DEPS_SIMPLE), new String[] { MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE);
ClasspathDepsAfterDecorator decorator = new ClasspathDepsAfterDecorator(new BaseMavenCompiler(false, false));
CompilationResponse res = decorator.compile(req);
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(res.isSuccessful()).isFalse();
softly.assertThat(res.getDependencies()).hasSize(0);
});
}
use of org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler in project kie-wb-common by kiegroup.
the class KieAfterDecoratorTest method compileWithFailedResponse.
@Test
public void compileWithFailedResponse() throws Exception {
CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, createdNewPrjInRepo("kjar-2-fail", ResourcesConstants.KJAR_2_SINGLE_FAIL_RESOURCES), new String[] { MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE);
KieAfterDecorator decorator = new KieAfterDecorator(new BaseMavenCompiler(true, false));
KieCompilationResponse kieRes = (KieCompilationResponse) decorator.compile(req);
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(kieRes.isSuccessful()).isFalse();
softly.assertThat(kieRes.getMavenOutput()).isNotEmpty();
softly.assertThat(kieRes.getKieModule()).isEmpty();
softly.assertThat(kieRes.getKieModuleMetaInfo()).isEmpty();
});
}
use of org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler in project kie-wb-common by kiegroup.
the class JGITCompilerBeforeDecoratorTest method compileWithEmptyOverrideTest.
@Test
public void compileWithEmptyOverrideTest() throws Exception {
final FileSystem fileSystem = createFileSystem("myrepo");
// Compile the repo
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(fileSystem.getPath("/"));
CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[] { MavenCLIArgs.COMPILE }, Boolean.TRUE);
Map<Path, InputStream> override = new HashMap<>();
JGITCompilerBeforeDecorator compiler = new JGITCompilerBeforeDecorator(new BaseMavenCompiler(true, false));
CompilationResponse res = compiler.compile(req, override);
final java.nio.file.Path tempPath = ((Git) compiler.getGitMap().get(fileSystem)).getRepository().getDirectory().toPath().getParent();
TestUtil.saveMavenLogIfCompilationResponseNotSuccessfull(tempPath, res, this.getClass(), testName);
assertThat(res.isSuccessful()).isTrue();
Path incrementalConfiguration = Paths.get(tempPath.toUri() + TARGET_TAKARI_PLUGIN);
assertThat(incrementalConfiguration.toFile()).exists();
TestUtil.rm(tempPath.toFile());
}
use of org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler in project kie-wb-common by kiegroup.
the class OutputLogAfterDecoratorTest method compileTest.
@Test
public void compileTest() {
CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[] { MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE);
OutputLogAfterDecorator decorator = new OutputLogAfterDecorator(new BaseMavenCompiler(true, true));
CompilationResponse res = decorator.compile(req);
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(res.isSuccessful()).isTrue();
softly.assertThat(res.getMavenOutput().size()).isGreaterThan(0);
});
}
use of org.kie.workbench.common.services.backend.compiler.impl.BaseMavenCompiler in project kie-wb-common by kiegroup.
the class DefaultRemoteExecutor method setupCompileInfo.
private CompilerAggregateEntryCache setupCompileInfo(String workingDir) {
AFCompiler compiler = new KieAfterDecorator(new OutputLogAfterDecorator(new ClasspathDepsAfterDecorator(new BaseMavenCompiler(true, true))));
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(Paths.get(workingDir));
return new CompilerAggregateEntryCache(compiler, info);
}
Aggregations