Package org.springframework.batch.admin.web

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


  @Test
  public void testLaunchedJobExecutions() throws Exception {
    JobExecution jobExecution = MetaDataInstanceFactory.createJobExecution();
    jobExecution.setEndTime(new Date());
    model.put("baseUrl", "http://localhost:8080/springsource");
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(jobExecution, TimeZone.getTimeZone("GMT"))));
    model.put("currentTime", new Date());
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("Recent and Current Job Executions"));
View Full Code Here


  public void testUnfinishedJobExecutions() 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());
    view.render(model, request, response);
    String content = response.getContentAsString();
    System.err.println(content);
View Full Code Here

  @Qualifier("jobs/executions")
  private View view;

  @Test
  public void testLaunchedJobExecutions() throws Exception {
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(MetaDataInstanceFactory.createJobExecution(),
        TimeZone.getTimeZone("GMT"))));
    model.put(BindingResult.MODEL_KEY_PREFIX + "stopRequest", new MapBindingResult(model, "stopRequest"));
    model.put("startJobExecution", 3);
    model.put("endJobExecution", 4);
    model.put("nextJobExecution", 4);
View Full Code Here

    assertTrue(content.contains("title=\"RSS Feed\" href=\"/jobs/executions.rss\">"));
  }

  @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);
View Full Code Here

    assertTrue(content.contains("<a href=\"/jobs/executions/123\">"));
  }

  @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();
View Full Code Here

  }

  @Test
  public void testStoppedJobExecutions() throws Exception {
    model.put("stoppedCount", 2);
    model.put("jobExecutions", Arrays.asList(new JobExecutionInfo(MetaDataInstanceFactory.createJobExecution(),
        TimeZone.getTimeZone("GMT"))));
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("You may need to wait"));
View Full Code Here

  @Test
  public void testLaunchViewWithJobExecutionInfo() throws Exception {
    JobExecution jobExecution = MetaDataInstanceFactory.createJobExecutionWithStepExecutions(123L, Arrays.asList(
        "foo", "bar"));
    model.put("jobExecutionInfo", new JobExecutionInfo(jobExecution, TimeZone.getDefault()));
    model.put("baseUrl", "http://localhost:8080/springsource");
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("\"duration\" : \"\""));
View Full Code Here

  @Test
  public void testLaunchViewWithJobAndStepExecutionInfo() throws Exception {
    JobExecution jobExecution = MetaDataInstanceFactory.createJobExecutionWithStepExecutions(123L, Arrays.asList(
        "foo", "bar"));
    model.put("jobExecutionInfo", new JobExecutionInfo(jobExecution, TimeZone.getDefault()));
    model.put("stepExecutionInfos", Arrays.asList(new StepExecutionInfo(jobExecution.getStepExecutions().iterator()
        .next(), TimeZone.getTimeZone("GMT")), new StepExecutionInfo("job", 123L, "bar", TimeZone.getTimeZone("GMT"))));
    model.put("baseUrl", "http://localhost:8080/springsource");
    view.render(model, request, response);
    String content = response.getContentAsString();
View Full Code Here

  private View view;

  @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);
View Full Code Here

  public void testViewWithJobExecutionInfo() 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());
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    JsonWrapper wrapper = new JsonWrapper(content);
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.