Package org.springframework.batch.admin.web

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


      catch (NoSuchJobException e) {
        // shouldn't happen
      }
      boolean launchable = jobService.isLaunchable(name);
      boolean incrementable = jobService.isIncrementable(name);
      result.add(new JobInfo(name, count, null, launchable, incrementable));
    }

    return result;

  }
View Full Code Here


  @Test
  public void testJobExecutionsForInstance() throws Exception {
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(MetaDataInstanceFactory.createJobExecution(),
        TimeZone.getTimeZone("GMT"))));
    model.put("jobInfo", new JobInfo("foo", 1));
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("Recent and Current Job Executions"));
    assertTrue(content.contains("<a href=\"/jobs/executions/123\">"));
View Full Code Here

  @Test
  public void testJobExecutionsForLaunchableInstance() throws Exception {
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(MetaDataInstanceFactory.createJobExecution(),
        TimeZone.getTimeZone("GMT"))));
    model.put("jobInfo", new JobInfo("foo", 1, true));
    model.put("jobParameters", "foo=bar");
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("<form id=\"launchForm\""));
View Full Code Here

  @Test
  public void testJobExecutionsForInstance() throws Exception {
    JobExecution jobExecution = MetaDataInstanceFactory.createJobExecution();
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(jobExecution, TimeZone.getTimeZone("GMT"))));
    model.put("baseUrl", "http://localhost:8080/springsource");
    model.put("jobInfo", new JobInfo("foo", 1, 123L, false, false));
    model.put("jobInstanceInfo", new JobInstanceInfo(MetaDataInstanceFactory.createJobInstance("job", 112L), Arrays.asList(jobExecution),
        TimeZone.getTimeZone("GMT")));
    view.render(model, request, response);
    String content = response.getContentAsString();
    //    System.err.println(content);
View Full Code Here

    assertTrue("foo=bar\nbar=spam".matches(pattern));
  }

  @Test
  public void testListViewWithJobs() throws Exception {
    model.put("jobs", Arrays.asList(new JobInfo("foo", 1, true), new JobInfo("bar", 2)));
    model.put("startJob", 3);
    model.put("endJob", 4);
    model.put("nextJob", 4);
    model.put("previousJob", 0);
    model.put("totalJobs", 100);
View Full Code Here

    assertTrue(content.contains("<td>1</td>"));
  }

  @Test
  public void testJobView() throws Exception {
    model.put("jobInfo", new JobInfo("foo", 1, true));
    model.put("jobInstances", Arrays.asList(new JobInstanceInfo(MetaDataInstanceFactory.createJobInstance("foo",
        1L), new ArrayList<JobExecution>(), TimeZone.getTimeZone("GMT"))));
    model.put("jobParameters", "foo=bar");
    model.put("startJobInstance", 3);
    model.put("endJobInstance", 4);
View Full Code Here

    assertTrue(content.contains("<th>ID</th>"));
  }

  @Test
  public void testJobViewNotLaunchable() throws Exception {
    model.put("job", new JobInfo("foo", 1));
    model.put("jobInstances", Arrays.asList(new JobInstanceInfo(MetaDataInstanceFactory.createJobInstance("foo",
        1L), new ArrayList<JobExecution>(), TimeZone.getTimeZone("GMT"))));
    model.put("launchable", false);
    model.put("startJobInstance", 3);
    model.put("endJobInstance", 4);
View Full Code Here

  private Errors errors = new BindException(new Object(), "launchRequest");

  @Test
  public void testViewWithJob() throws Exception {
    model.put(BindingResult.MODEL_KEY_PREFIX + "launchRequest", errors);
    model.put("jobInfo", new JobInfo("foo", 1));
    model.put("jobInstances", Arrays.asList(new JobInstanceInfo(MetaDataInstanceFactory.createJobInstance("foo",
        1L), new ArrayList<JobExecution>(), TimeZone.getTimeZone("GMT"))));
    model.put("baseUrl", "http://localhost:8080/springsource");
    model.put("startJobInstance", 11);
    model.put("endJobInstance", 30);
View Full Code Here

  }

  @Test
  public void testViewWithJobAndNoPagination() throws Exception {
    model.put(BindingResult.MODEL_KEY_PREFIX + "launchRequest", errors);
    model.put("jobInfo", new JobInfo("foo", 1));
    model.put("jobInstances", Arrays.asList(new JobInstanceInfo(MetaDataInstanceFactory.createJobInstance("foo",
        1L), new ArrayList<JobExecution>(), TimeZone.getTimeZone("GMT"))));
    model.put("baseUrl", "http://localhost:8080/springsource");
    model.put("startJobInstance", 11);
    model.put("endJobInstance", 30);
View Full Code Here

    assertEquals("No such Job", wrapper.get("errors['no.such.job']"));
  }

  @Test
  public void testViewWithLaunchErrors() throws Exception {
    model.put("job", new JobInfo("foo", 1));
    BindException errors = new BindException(new Object(), "launchRequest");
    model.put("errors", errors);
    errors.reject("job.already.complete", "Already complete");
    model.put("baseUrl", "http://localhost:8080/springsource");
    job.render(model, request, response);
View Full Code Here

TOP

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

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.