@Test(expected = IllegalArgumentException.class) public void deleteBuildZeroBuildNumber() { getInst().deleteBuild(project, 0); }
public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.DELETE); log.debug("Deleting build: {} #{}", project.getName(), buildNumber); try { build.delete(); } catch (IOException e) { throw new ServiceRuntimeException("Delete failed for build " + project.getName() + " #" + buildNumber, e); } }
BuildServiceImpl extends ServiceSupport implements BuildService { public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.DELETE); log.debug("Deleting build: {} #{}", project.getName(), buildNumber); try { build.delete(); } catch (IOException e) { throw new ServiceRuntimeException("Delete failed for build " + project.getName() + " #" + buildNumber, e); } } }
BuildServiceImpl extends ServiceSupport implements BuildService { public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.DELETE); log.debug("Deleting build: {} #{}", project.getName(), buildNumber); try { build.delete(); } catch (IOException e) { throw new ServiceRuntimeException("Delete failed for build " + project.getName() + " #" + buildNumber, e); } } @Inject  BuildServiceImpl(final ProjectService projects, SecurityService security); }
BuildServiceImpl extends ServiceSupport implements BuildService { public void deleteBuild(final AbstractProject<?, ?> project, final int buildNumber) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.DELETE); log.debug("Deleting build: {} #{}", project.getName(), buildNumber); try { build.delete(); } catch (IOException e) { throw new ServiceRuntimeException("Delete failed for build " + project.getName() + " #" + buildNumber, e); } } @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 deleteBuild(final AbstractProject<?, ?> project, final int buildNumber) { AbstractBuild<?, ?> build = getBuild(project, buildNumber); this.security.checkPermission(build, Run.DELETE); log.debug("Deleting build: {} #{}", project.getName(), buildNumber); try { build.delete(); } catch (IOException e) { throw new ServiceRuntimeException("Delete failed for build " + project.getName() + " #" + buildNumber, e); } } @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);  }