use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.
the class ResourceChangeIncrementalBuilderWithoutFullBuildTest method testNonPackageResourceUpdated.
@Test
public void testNonPackageResourceUpdated() throws Exception {
// This tests changes to a resource that is neither pom.xml nor kmodule.xml nor within a Package
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/project.imports");
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.updateResource(resourcePath);
final BuildResults buildResults = buildResultsObserver.getBuildResults();
assertNull(buildResults);
final IncrementalBuildResults incrementalBuildResults = buildResultsObserver.getIncrementalBuildResults();
assertNull(incrementalBuildResults);
}
use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.
the class ResourceChangeIncrementalBuilderWithoutFullBuildTest method testResourceUpdated.
@Test
public void testResourceUpdated() 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/update.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.updateResource(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.BuildResults in project kie-wb-common by kiegroup.
the class ResourceChangeIncrementalBuilderWithoutFullBuildTest method testPomResourceUpdated.
@Test
public void testPomResourceUpdated() throws Exception {
// This tests changes pom.xml
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/pom.xml");
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.updateResource(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.BuildResults in project kie-wb-common by kiegroup.
the class BuildServiceHelperTest method testLocalBuildAndDeployValidated.
@Test
public void testLocalBuildAndDeployValidated() {
prepareBuildAndDeploy(module, LocalBuildConfig.DeploymentType.VALIDATED, false);
BuildResults result = serviceHelper.localBuildAndDeploy(module, DeploymentMode.VALIDATED, false);
verifyBuildAndDeploy(result);
}
use of org.guvnor.common.services.project.builder.model.BuildResults in project kie-wb-common by kiegroup.
the class BuildServiceImplTest method testBuildAndDeployWithDeploymentMode.
@Test
public void testBuildAndDeployWithDeploymentMode() {
prepareBuildAndDeploy(module, DeploymentMode.VALIDATED, false);
BuildResults result = buildService.buildAndDeploy(module, DeploymentMode.VALIDATED);
assertEquals(buildResults, result);
verifyBuildAndDeploy(module, DeploymentMode.VALIDATED, false);
}
Aggregations