Package org.springframework.batch.admin.web

Examples of org.springframework.batch.admin.web.JobExecutionInfo


  public void testViewWithPagination() throws Exception {
    JobExecution jobExecution1 = MetaDataInstanceFactory.createJobExecution();
    JobExecution jobExecution2 = MetaDataInstanceFactory.createJobExecution(13L);
    jobExecution2.setEndTime(new Date());
    model.put("baseUrl", "http://localhost:8080/springsource");
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(jobExecution1, TimeZone.getTimeZone("GMT")),
        new JobExecutionInfo(jobExecution2, TimeZone.getTimeZone("GMT"))));
    model.put("currentTime", new Date());
    model.put("startJobExecution", 11);
    model.put("endJobExecution", 30);
    model.put("totalJobExecutions", 100);
    model.put("nextJobExecution", 31);
View Full Code Here


  public void testViewWithNoPagination() throws Exception {
    JobExecution jobExecution1 = MetaDataInstanceFactory.createJobExecution();
    JobExecution jobExecution2 = MetaDataInstanceFactory.createJobExecution(13L);
    jobExecution2.setEndTime(new Date());
    model.put("baseUrl", "http://localhost:8080/springsource");
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(jobExecution1, TimeZone.getTimeZone("GMT")),
        new JobExecutionInfo(jobExecution2, TimeZone.getTimeZone("GMT"))));
    model.put("currentTime", new Date());
    model.put("startJobExecution", 1);
    model.put("endJobExecution", 30);
    model.put("totalJobExecutions", 30);
    view.render(model, request, response);
View Full Code Here

  @Test
  public void testLaunchViewWithJobExecution() throws Exception {
    JobExecution jobExecution = MetaDataInstanceFactory.createJobExecutionWithStepExecutions(123L, Arrays.asList(
        "foo", "bar"));
    model.put("jobExecutionInfo", new JobExecutionInfo(jobExecution, TimeZone.getTimeZone("GMT")));
    model.put("stepExecutionInfos", Arrays.asList(new StepExecutionInfo(jobExecution.getStepExecutions().iterator()
        .next(), TimeZone.getTimeZone("GMT")), new StepExecutionInfo("job", 123L, "bar", TimeZone.getTimeZone("GMT"))));
    model.put(BindingResult.MODEL_KEY_PREFIX + "stopRequest", new MapBindingResult(model, "stopRequest"));
    view.render(model, request, response);
    String content = response.getContentAsString();
View Full Code Here

  @Test
  public void testLaunchViewWithNotRestartable() throws Exception {
    JobExecution execution = MetaDataInstanceFactory.createJobExecution("job", 12L, 123L, "foo=bar");
    execution.setStatus(BatchStatus.STARTED);
    model.put("jobExecutionInfo", new JobExecutionInfo(execution, TimeZone.getTimeZone("GMT")));
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertFalse(content.contains("restartForm"));
    assertTrue(content.contains("<input id=\"stop\" type=\"submit\" value=\"Stop\" name=\"stop\" />"));
View Full Code Here

  @Test
  public void testLaunchViewWithStopped() throws Exception {
    JobExecution execution = MetaDataInstanceFactory.createJobExecution("job", 12345L, 1233456L, "foo=bar");
    execution.setStatus(BatchStatus.STOPPED);
    model.put("jobExecutionInfo", new JobExecutionInfo(execution, TimeZone.getTimeZone("GMT")));
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("restartForm"));
    assertTrue(content.contains("/jobs/job/12345/executions"));
View Full Code Here

  @Test
  public void testLaunchViewWithAbandonable() throws Exception {
    JobExecution execution = MetaDataInstanceFactory.createJobExecution("job", 12L, 123L, "foo=bar");
    execution.setStatus(BatchStatus.STOPPING);
    model.put("jobExecutionInfo", new JobExecutionInfo(execution, TimeZone.getTimeZone("GMT")));
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertFalse(content.contains("restartForm"));
    assertTrue(content.contains("<input id=\"stop\" type=\"submit\" value=\"Abandon\" name=\"abandon\" />"));
View Full Code Here

  @Test
  public void testLaunchViewWithStepExecutions() throws Exception {
    StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution();
    model.put("stepExecutions", Arrays.asList(new StepExecutionInfo(stepExecution, TimeZone.getTimeZone("GMT"))));
    model.put("jobExecutionInfo",
        new JobExecutionInfo(stepExecution.getJobExecution(), TimeZone.getTimeZone("GMT")));
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("Step Executions"));
    assertTrue(content.contains("for Job = job"));
View Full Code Here

  public IResult executionStop(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    long jobExecutionId = Long.parseLong(request.get("jobExeId"));
    try {
      JobExecution jobExecution = jobService.stop(jobExecutionId);
      new JobExecutionInfo(jobExecution, TimeZone.getDefault());
    } catch (NoSuchJobExecutionException e) {
      throw new CapMessageException("msg.job.noSuchJob", getClass());
    } catch (JobExecutionNotRunningException e) {
      JobExecution jobExecution;
      try {
        jobExecution = jobService.getJobExecution(jobExecutionId);
        new JobExecutionInfo(jobExecution, TimeZone.getDefault());
      } catch (NoSuchJobExecutionException e1) {
        e1.getMessage();
      }
      throw new CapMessageException("msg.job.noRunnigJob", getClass())
          .setExtraInformation(new Object[] { jobExecutionId });
View Full Code Here

      long jobInstanceId = Long.parseLong(request.get("jobInsId"));
      Collection<JobExecution> jobExecutions = jobService
          .getJobExecutionsForJobInstance(jobName, jobInstanceId);
      new JobInfo(jobName, jobExecutions.size() + 1);
      JobExecution jobExecution = jobExecutions.iterator().next();
      new JobExecutionInfo(jobExecution, TimeZone.getDefault());

      Long jobExecutionId = jobExecution.getId();

      try {

        jobExecution = jobService.restart(jobExecutionId);
        new JobExecutionInfo(jobExecution, TimeZone.getDefault());

      } catch (NoSuchJobExecutionException e) {
        throw new CapMessageException("msg.job.noSuchJob", getClass());
      } catch (JobExecutionAlreadyRunningException e) {
        throw new CapMessageException("msg.job.alreadyRunning",
View Full Code Here

TOP

Related Classes of org.springframework.batch.admin.web.JobExecutionInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.