@Test(expected = IllegalArgumentException.class) public void keepBuildNegativeBuildNumber() { getInst().keepBuild(project, -1, true); }
public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.UPDATE); log.debug("{} build: {} #{}", $(release ? "Releasing" : "Keeping", project.getName(), buildNumber)); try { build.keepLog(!release); } catch (IOException e) { throw new ServiceRuntimeException((release ? "Releasing failed for build #" : "Keeping failed for build ") + project.getName() + " #" + buildNumber); } }
BuildServiceImpl extends ServiceSupport implements BuildService { public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.UPDATE); log.debug("{} build: {} #{}", $(release ? "Releasing" : "Keeping", project.getName(), buildNumber)); try { build.keepLog(!release); } catch (IOException e) { throw new ServiceRuntimeException((release ? "Releasing failed for build #" : "Keeping failed for build ") + project.getName() + " #" + buildNumber); } } }
BuildServiceImpl extends ServiceSupport implements BuildService { public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.UPDATE); log.debug("{} build: {} #{}", $(release ? "Releasing" : "Keeping", project.getName(), buildNumber)); try { build.keepLog(!release); } catch (IOException e) { throw new ServiceRuntimeException((release ? "Releasing failed for build #" : "Keeping failed for build ") + project.getName() + " #" + buildNumber); } } @Inject  BuildServiceImpl(final ProjectService projects, SecurityService security); }
BuildServiceImpl extends ServiceSupport implements BuildService { public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.UPDATE); log.debug("{} build: {} #{}", $(release ? "Releasing" : "Keeping", project.getName(), buildNumber)); try { build.keepLog(!release); } catch (IOException e) { throw new ServiceRuntimeException((release ? "Releasing failed for build #" : "Keeping failed for build ") + project.getName() + " #" + buildNumber); } } @Inject  BuildServiceImpl(final ProjectService projects, SecurityService security); void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber); void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release); AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber); AbstractBuild<?, ?> getBuild(final AbstractProject<?,?> project, final int buildNumber); AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber); AbstractBuild<?,?> findBuild(final AbstractProject<?, ?> project, final int buildNumber); void stopBuild(final AbstractProject<?, ?> project, final int buildNumber); }
BuildServiceImpl extends ServiceSupport implements BuildService { public void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.UPDATE); log.debug("{} build: {} #{}", $(release ? "Releasing" : "Keeping", project.getName(), buildNumber)); try { build.keepLog(!release); } catch (IOException e) { throw new ServiceRuntimeException((release ? "Releasing failed for build #" : "Keeping failed for build ") + project.getName() + " #" + buildNumber); } } @Inject  BuildServiceImpl(final ProjectService projects, SecurityService security); void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber); void keepBuild(final AbstractProject<?, ?> project, final int buildNumber, final boolean release); AbstractBuild<?, ?> getBuild(final String projectName, final int buildNumber); AbstractBuild<?, ?> getBuild(final AbstractProject<?,?> project, final int buildNumber); AbstractBuild<?, ?> findBuild(final String projectName, final int buildNumber); AbstractBuild<?,?> findBuild(final AbstractProject<?, ?> project, final int buildNumber); void stopBuild(final AbstractProject<?, ?> project, final int buildNumber);  }