Search in sources :

Example 1 with CompilerIPCCoordinatorImpl

use of org.kie.workbench.common.services.backend.compiler.offprocess.impl.CompilerIPCCoordinatorImpl 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());
}
Also used : DefaultKieCompilationResponse(org.kie.workbench.common.services.backend.compiler.impl.DefaultKieCompilationResponse) WorkspaceCompilationInfo(org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo) DefaultCompilationRequest(org.kie.workbench.common.services.backend.compiler.impl.DefaultCompilationRequest) CompilationResponse(org.kie.workbench.common.services.backend.compiler.CompilationResponse) DefaultKieCompilationResponse(org.kie.workbench.common.services.backend.compiler.impl.DefaultKieCompilationResponse) CompilationRequest(org.kie.workbench.common.services.backend.compiler.CompilationRequest) DefaultCompilationRequest(org.kie.workbench.common.services.backend.compiler.impl.DefaultCompilationRequest) CompilerIPCCoordinatorImpl(org.kie.workbench.common.services.backend.compiler.offprocess.impl.CompilerIPCCoordinatorImpl) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with CompilerIPCCoordinatorImpl

use of org.kie.workbench.common.services.backend.compiler.offprocess.impl.CompilerIPCCoordinatorImpl 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());
}
Also used : DefaultKieCompilationResponse(org.kie.workbench.common.services.backend.compiler.impl.DefaultKieCompilationResponse) WorkspaceCompilationInfo(org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo) DefaultCompilationRequest(org.kie.workbench.common.services.backend.compiler.impl.DefaultCompilationRequest) CompilationResponse(org.kie.workbench.common.services.backend.compiler.CompilationResponse) DefaultKieCompilationResponse(org.kie.workbench.common.services.backend.compiler.impl.DefaultKieCompilationResponse) CompilationRequest(org.kie.workbench.common.services.backend.compiler.CompilationRequest) DefaultCompilationRequest(org.kie.workbench.common.services.backend.compiler.impl.DefaultCompilationRequest) CompilerIPCCoordinatorImpl(org.kie.workbench.common.services.backend.compiler.offprocess.impl.CompilerIPCCoordinatorImpl) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Ignore (org.junit.Ignore)2 Test (org.junit.Test)2 CompilationRequest (org.kie.workbench.common.services.backend.compiler.CompilationRequest)2 CompilationResponse (org.kie.workbench.common.services.backend.compiler.CompilationResponse)2 DefaultCompilationRequest (org.kie.workbench.common.services.backend.compiler.impl.DefaultCompilationRequest)2 DefaultKieCompilationResponse (org.kie.workbench.common.services.backend.compiler.impl.DefaultKieCompilationResponse)2 WorkspaceCompilationInfo (org.kie.workbench.common.services.backend.compiler.impl.WorkspaceCompilationInfo)2 CompilerIPCCoordinatorImpl (org.kie.workbench.common.services.backend.compiler.offprocess.impl.CompilerIPCCoordinatorImpl)2