use of org.guvnor.common.services.project.builder.model.IncrementalBuildResults 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);
}
use of org.guvnor.common.services.project.builder.model.IncrementalBuildResults in project kie-wb-common by kiegroup.
the class BuildServiceHelperTest method testLocalBuildWithResourceChanges.
@Test
public void testLocalBuildWithResourceChanges() {
BuildPipelineInvoker.LocalBuildRequest buildRequest = BuildPipelineInvoker.LocalBuildRequest.newIncrementalBuildRequest(module, resourceChanges);
preparePipelineInvocation(buildRequest);
when(localBinaryConfig.getIncrementalBuildResults()).thenReturn(incrementalBuildResults);
IncrementalBuildResults result = serviceHelper.localBuild(module, resourceChanges);
assertEquals(incrementalBuildResults, result);
verify(pipelineInvoker, times(1)).invokeLocalBuildPipeLine(eq(buildRequest), any(Consumer.class));
}
use of org.guvnor.common.services.project.builder.model.IncrementalBuildResults in project kie-wb-common by kiegroup.
the class BuildServiceImplTest method testAddPackageResource.
@Test
public void testAddPackageResource() {
prepareIncrementalBuild(path, LocalBuildConfig.BuildType.INCREMENTAL_ADD_RESOURCE);
IncrementalBuildResults result = buildService.addPackageResource(path);
assertEquals(incrementalBuildResults, result);
verifyIncrementalBuild(path, LocalBuildConfig.BuildType.INCREMENTAL_ADD_RESOURCE);
}
use of org.guvnor.common.services.project.builder.model.IncrementalBuildResults in project kie-wb-common by kiegroup.
the class BuildServiceImplTest method testUpdatePackageResource.
@Test
public void testUpdatePackageResource() {
prepareIncrementalBuild(path, LocalBuildConfig.BuildType.INCREMENTAL_UPDATE_RESOURCE);
IncrementalBuildResults result = buildService.updatePackageResource(path);
assertEquals(incrementalBuildResults, result);
verifyIncrementalBuild(path, LocalBuildConfig.BuildType.INCREMENTAL_UPDATE_RESOURCE);
}
use of org.guvnor.common.services.project.builder.model.IncrementalBuildResults in project kie-wb-common by kiegroup.
the class BuildServiceImplTest method testDeletePackageResource.
@Test
public void testDeletePackageResource() {
prepareIncrementalBuild(path, LocalBuildConfig.BuildType.INCREMENTAL_DELETE_RESOURCE);
IncrementalBuildResults result = buildService.deletePackageResource(path);
assertEquals(incrementalBuildResults, result);
verifyIncrementalBuild(path, LocalBuildConfig.BuildType.INCREMENTAL_DELETE_RESOURCE);
}
Aggregations