try { final BuildResults results = build(module).getBuildResults(); StringBuffer message = new StringBuffer(); message.append("Build of module '" + module.getModuleName() + "' (requested by " + getIdentifier() + ") completed.\n");
@Test public void testApplyForModuleFullBuild() { when(internalBuildConfig.getBuildType()).thenReturn(LocalBuildConfig.BuildType.FULL_BUILD); when(internalBuildConfig.getModule()).thenReturn(module); when(buildHelper.build(module)).thenReturn(buildResult); Optional<LocalBinaryConfig> result = executor.apply(internalBuildConfig, buildExecConfig); assertTrue(result.isPresent()); assertEquals(builder, result.get().getBuilder()); assertEquals(buildResults, result.get().getBuildResults()); verify(buildHelper, times(1)).build(module); }
buildResult = buildHelper.build(localBuildConfigInternal.getModule()); result = Optional.of(new LocalBuildBinaryImpl(buildResult.getBuilder(), buildResult.getBuildResults())); break;
@Test public void testBuildThatDoesNotUpdateTheCache() throws Exception { final Path path = path(); buildHelper.build(moduleService.resolveModule(path)); assertTrue(cachedFileSystemDoesNotChange()); }
@Test public void testUpdatePackageResourceThatDoesNotUpdateTheCache() throws Exception { final Path path = path(); buildHelper.build(moduleService.resolveModule(path)); buildHelper.updatePackageResource(path); assertTrue(cachedFileSystemDoesNotChange()); }
@Test public void testFullBuildExecution() { when(buildHelper.build(module)).thenReturn(buildResult); // prepare the pipeline input. input = createFullBuildInput(ROOT_PATH_URI); // execute the pipeline and verify the result. pipelineInitializer.getExecutor().execute(input, pipe, (Consumer<LocalBinaryConfig>) localBinaryConfig -> { assertEquals(buildResults, localBinaryConfig.getBuildResults()); assertEquals(builder, localBinaryConfig.getBuilder()); }, pipelineEventListener); // verify that all stages were properly invoked. verifyLocalSourceConfigWasInvoked(); verifyLocalProjectConfigWasInvoked(); verifyLocalBuildConfigExecutorWasInvoked(module, LocalBuildConfig.BuildType.FULL_BUILD.name()); verifyLocalBuildExecConfigExecutorWasInvoked(module, LocalBuildConfig.BuildType.FULL_BUILD); verifyPipelineEvents(); }