@Test(expected = IllegalArgumentException.class) public void stopBuildByProjectNameNegativeBuildNumber() { getInst().stopBuild(project, -1); }
public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber){ AbstractBuild<?, ?> build = getBuild(project, buildNumber); log.debug("Stopping build: {} #{}", project.getName(), buildNumber); try { build.doStop(DummyStaplerRequest.INSTANCE, DummyStaplerResponse.INSTANCE); } catch (IOException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } catch (ServletException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } }
BuildServiceImpl extends ServiceSupport implements BuildService { public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber){ AbstractBuild<?, ?> build = getBuild(project, buildNumber); log.debug("Stopping build: {} #{}", project.getName(), buildNumber); try { build.doStop(DummyStaplerRequest.INSTANCE, DummyStaplerResponse.INSTANCE); } catch (IOException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } catch (ServletException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } } }
BuildServiceImpl extends ServiceSupport implements BuildService { public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber){ AbstractBuild<?, ?> build = getBuild(project, buildNumber); log.debug("Stopping build: {} #{}", project.getName(), buildNumber); try { build.doStop(DummyStaplerRequest.INSTANCE, DummyStaplerResponse.INSTANCE); } catch (IOException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } catch (ServletException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } } @Inject  BuildServiceImpl(final ProjectService projects, SecurityService security); }
BuildServiceImpl extends ServiceSupport implements BuildService { public void stopBuild(final AbstractProject<?, ?> project, final int buildNumber){ AbstractBuild<?, ?> build = getBuild(project, buildNumber); log.debug("Stopping build: {} #{}", project.getName(), buildNumber); try { build.doStop(DummyStaplerRequest.INSTANCE, DummyStaplerResponse.INSTANCE); } catch (IOException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } catch (ServletException e) { throw new ServiceRuntimeException("Stop failed for " + 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 stopBuild(final AbstractProject<?, ?> project, final int buildNumber){ AbstractBuild<?, ?> build = getBuild(project, buildNumber); log.debug("Stopping build: {} #{}", project.getName(), buildNumber); try { build.doStop(DummyStaplerRequest.INSTANCE, DummyStaplerResponse.INSTANCE); } catch (IOException e) { throw new ServiceRuntimeException("Stop failed for " + project.getName() + " #" + buildNumber, e); } catch (ServletException e) { throw new ServiceRuntimeException("Stop failed for " + 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);  }