use of org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo in project kie-wb-common by kiegroup.
the class CompilerChronicleCoordinatorTest method offProcessOneBuildTest.
@Test
@Ignore("https://issues.redhat.com/browse/AF-2892")
public void offProcessOneBuildTest() {
CompilerIPCCoordinator compiler = new CompilerIPCCoordinatorImpl(queueProvider);
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(prjPath);
String uuid = UUID.randomUUID().toString();
CompilationRequest req = new DefaultCompilationRequest(mavenRepo, info, new String[] { MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE, uuid);
CompilationResponse res = compiler.compile(req);
logger.info("offProcessOneBuildTest first build completed");
assertThat(res).isNotNull();
assertThat(res.isSuccessful()).isTrue();
assertThat(res.getMavenOutput()).isNotEmpty();
DefaultKieCompilationResponse kres = (DefaultKieCompilationResponse) res;
assertThat(uuid).isEqualToIgnoringCase(kres.getRequestUUID());
}
use of org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo in project kie-wb-common by kiegroup.
the class CompilerChronicleCoordinatorTest method offProcessTwoBuildTest.
@Test
@Ignore("https://issues.redhat.com/browse/AF-2892")
public void offProcessTwoBuildTest() {
CompilerIPCCoordinator compiler = new CompilerIPCCoordinatorImpl(queueProvider);
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(prjPath);
// First Build
String uuid = UUID.randomUUID().toString();
CompilationRequest req = new DefaultCompilationRequest(mavenRepo, info, new String[] { MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE, uuid);
CompilationResponse res = compiler.compile(req);
logger.info("offProcessTwoBuildTest first build completed");
assertThat(res).isNotNull();
assertThat(res.isSuccessful()).isTrue();
assertThat(res.getMavenOutput()).isNotEmpty();
DefaultKieCompilationResponse kres = (DefaultKieCompilationResponse) res;
assertThat(uuid).isEqualToIgnoringCase(kres.getRequestUUID());
// Second Build
String secondUuid = UUID.randomUUID().toString();
DefaultCompilationRequest secondRequest = new DefaultCompilationRequest(mavenRepo, info, new String[] { MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE, secondUuid);
CompilationResponse secondRes = compiler.compile(secondRequest);
logger.info("offProcessTwoBuildTest second build completed");
assertThat(secondRes).isNotNull();
assertThat(secondRes.isSuccessful()).isTrue();
DefaultKieCompilationResponse secondKres = (DefaultKieCompilationResponse) secondRes;
assertThat(secondUuid).isEqualToIgnoringCase(secondKres.getRequestUUID());
}
use of org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo in project kie-wb-common by kiegroup.
the class CompilerOffProcessServiceTest method offProcessServiceCompileAsyncTest.
@Test
@Ignore("https://issues.redhat.com/browse/AF-2892")
public void offProcessServiceCompileAsyncTest() throws Exception {
CompilerOffprocessService service = new CompilerOffprocessServiceImpl(executor, queueProvider);
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(prjPath);
String uuid = UUID.randomUUID().toString();
CompilationRequest req = new DefaultCompilationRequest(mavenRepo, info, new String[] { MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE, uuid);
CompletableFuture<KieCompilationResponse> futureRes = service.compile(req);
logger.info("offProcessOneBuildAsyncTest build completed");
KieCompilationResponse res = futureRes.get();
assertThat(res).isNotNull();
assertThat(res.isSuccessful()).isTrue();
assertThat(res.getMavenOutput()).isNotEmpty();
DefaultKieCompilationResponse kres = (DefaultKieCompilationResponse) res;
assertThat(uuid).isEqualToIgnoringCase(kres.getRequestUUID());
}
use of org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo in project kie-wb-common by kiegroup.
the class DefaultLocalExecutor method internalBuild.
private CompletableFuture<KieCompilationResponse> internalBuild(Path projectPath, String mavenRepoPath, boolean skipProjectDepCreation, String[] args) {
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(projectPath);
AFCompiler compiler = getCompiler(projectPath);
CompilationRequest req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, args);
return CompletableFuture.supplyAsync(() -> ((KieCompilationResponse) compiler.compile(req)), executor);
}
use of org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo in project kie-wb-common by kiegroup.
the class DefaultLocalExecutor method internalBuild.
private CompletableFuture<KieCompilationResponse> internalBuild(Path projectPath, String mavenRepoPath, String settingXML, boolean skipProjectDepCreation, String goal, Map<Path, InputStream> override) {
WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(projectPath);
AFCompiler compiler = getCompiler(projectPath);
CompilationRequest req;
if (settingXML != null) {
req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, new String[] { MavenCLIArgs.ALTERNATE_USER_SETTINGS + settingXML, goal });
} else {
req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, new String[] { goal });
}
return CompletableFuture.supplyAsync(() -> ((KieCompilationResponse) compiler.compile(req, override)), executor);
}
Aggregations