assertEquals("http://localhost:8080/springsource/jobs/executions/123.json", wrapper.get("jobExecution.resource"));
}
@Test
public void testLaunchViewWithStackTrace() throws Exception {
StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution();
StringWriter description = new StringWriter();
new RuntimeException("planned").printStackTrace(new PrintWriter(description));
stepExecution.setExitStatus(ExitStatus.FAILED.addExitDescription(description.toString()));
model.put("stepExecutionInfo", new StepExecutionInfo(stepExecution, TimeZone
.getTimeZone("GMT")));
model.put("baseUrl", "http://localhost:8080/springsource");
view.render(model, request, response);
String content = response.getContentAsString();
// System.err.println(content);
assertTrue(content.contains("\"duration\" : \""));
JsonWrapper wrapper = new JsonWrapper(content);
assertEquals(0, wrapper.get("stepExecution.commitCount"));
assertEquals("http://localhost:8080/springsource/jobs/executions/123.json", wrapper.get("jobExecution.resource"));
assertEquals(stepExecution.getId(), wrapper.get("stepExecution.id", Long.class));
assertEquals(stepExecution.getJobExecution().getStatus().toString(), wrapper.get("jobExecution.status"));
assertEquals(stepExecution.getJobExecutionId(), wrapper.get("jobExecution.id", Long.class));
}