Search in sources :

Example 11 with BuildResults

use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.

the class ResourceChangeIncrementalBuilderWithoutFullBuildTest method testResourceDeleted.

@Test
public void testResourceDeleted() throws Exception {
    final Bean buildChangeListenerBean = (Bean) beanManager.getBeans(org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder.class).iterator().next();
    final CreationalContext cc = beanManager.createCreationalContext(buildChangeListenerBean);
    final org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder buildChangeListener = (org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder) beanManager.getReference(buildChangeListenerBean, org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder.class, cc);
    final URL resourceUrl = this.getClass().getResource("/BuildChangeListenerRepo/src/main/resources/delete.drl");
    final org.uberfire.java.nio.file.Path nioResourcePath = fs.getPath(resourceUrl.toURI());
    final Path resourcePath = paths.convert(nioResourcePath);
    // Perform incremental build (Without a full Build first)
    buildChangeListener.deleteResource(resourcePath);
    waitForBuildResults(buildResultsObserver);
    final BuildResults buildResults = buildResultsObserver.getBuildResults();
    assertNotNull(buildResults);
    assertEquals(0, buildResults.getErrorMessages().size());
    assertEquals(1, buildResults.getInformationMessages().size());
    final IncrementalBuildResults incrementalBuildResults = buildResultsObserver.getIncrementalBuildResults();
    assertNull(incrementalBuildResults);
}
Also used : Path(org.uberfire.backend.vfs.Path) IncrementalBuildResults(org.guvnor.common.services.project.builder.model.IncrementalBuildResults) BuildResults(org.guvnor.common.services.project.builder.model.BuildResults) IncrementalBuildResults(org.guvnor.common.services.project.builder.model.IncrementalBuildResults) URL(java.net.URL) Bean(javax.enterprise.inject.spi.Bean) CreationalContext(javax.enterprise.context.spi.CreationalContext) Test(org.junit.Test)

Example 12 with BuildResults

use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.

the class BuildServiceHelperTest method testLocalBuildAndDeployForced.

@Test
public void testLocalBuildAndDeployForced() {
    prepareBuildAndDeploy(module, LocalBuildConfig.DeploymentType.FORCED, false);
    BuildResults result = serviceHelper.localBuildAndDeploy(module, DeploymentMode.FORCED, false);
    verifyBuildAndDeploy(result);
}
Also used : BuildResults(org.guvnor.common.services.project.builder.model.BuildResults) IncrementalBuildResults(org.guvnor.common.services.project.builder.model.IncrementalBuildResults) Test(org.junit.Test)

Example 13 with BuildResults

use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.

the class BuildServiceHelperTest method testLocalBuild.

@Test
public void testLocalBuild() {
    prepareLocalFullBuild();
    when(localBinaryConfig.getBuildResults()).thenReturn(buildResults);
    BuildResults result = serviceHelper.localBuild(module);
    assertEquals(buildResults, result);
    verify(pipelineInvoker, times(1)).invokeLocalBuildPipeLine(eq(expectedRequest), any(Consumer.class));
}
Also used : BuildResults(org.guvnor.common.services.project.builder.model.BuildResults) IncrementalBuildResults(org.guvnor.common.services.project.builder.model.IncrementalBuildResults) Consumer(java.util.function.Consumer) Test(org.junit.Test)

Example 14 with BuildResults

use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.

the class BuildServiceImplTest method testBuildAndDeployWithSuppressHandlers.

@Test
public void testBuildAndDeployWithSuppressHandlers() {
    prepareBuildAndDeploy(module, DeploymentMode.VALIDATED, false);
    BuildResults result = buildService.buildAndDeploy(module, false);
    assertEquals(buildResults, result);
    verifyBuildAndDeploy(module, DeploymentMode.VALIDATED, false);
}
Also used : BuildResults(org.guvnor.common.services.project.builder.model.BuildResults) IncrementalBuildResults(org.guvnor.common.services.project.builder.model.IncrementalBuildResults) Test(org.junit.Test)

Example 15 with BuildResults

use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.

the class BuildServiceImplTest method testBuildAndDeployWithDeploymentModeAndSuppressHandlers.

@Test
public void testBuildAndDeployWithDeploymentModeAndSuppressHandlers() {
    prepareBuildAndDeploy(module, DeploymentMode.VALIDATED, false);
    BuildResults result = buildService.buildAndDeploy(module, false, DeploymentMode.VALIDATED);
    assertEquals(buildResults, result);
    verifyBuildAndDeploy(module, DeploymentMode.VALIDATED, false);
}
Also used : BuildResults(org.guvnor.common.services.project.builder.model.BuildResults) IncrementalBuildResults(org.guvnor.common.services.project.builder.model.IncrementalBuildResults) Test(org.junit.Test)

Aggregations

BuildResults (org.guvnor.common.services.project.builder.model.BuildResults)36 Test (org.junit.Test)29 IncrementalBuildResults (org.guvnor.common.services.project.builder.model.IncrementalBuildResults)25 URL (java.net.URL)19 Path (org.uberfire.backend.vfs.Path)15 KieModule (org.kie.workbench.common.services.shared.project.KieModule)13 BuildMessage (org.guvnor.common.services.project.builder.model.BuildMessage)8 CreationalContext (javax.enterprise.context.spi.CreationalContext)6 Bean (javax.enterprise.inject.spi.Bean)6 Module (org.guvnor.common.services.project.model.Module)4 SimpleFileSystemProvider (org.uberfire.java.nio.fs.file.SimpleFileSystemProvider)4 HashMap (java.util.HashMap)3 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 ExecutorService (java.util.concurrent.ExecutorService)2 ContextNotActiveException (javax.enterprise.context.ContextNotActiveException)2 DeploymentMode (org.guvnor.common.services.project.service.DeploymentMode)2 KieModuleMetaData (org.kie.scanner.KieModuleMetaData)2 ResourceAdded (org.uberfire.workbench.events.ResourceAdded)2 ResourceChange (org.uberfire.workbench.events.ResourceChange)2