Esempio n. 1
0
 @Test
 public void canMakeSuiteExecutionReport() throws Exception {
   SuiteExecutionReport original = new SuiteExecutionReport();
   original.version = "version";
   original.rootPath = "rootPath";
   original.date = DateTimeUtil.getDateFromString("12/31/1969 18:00:00");
   original.finalCounts = new TestSummary(1, 2, 3, 4);
   long time = DateTimeUtil.getTimeFromString("12/31/1969 18:00:00");
   SuiteExecutionReport.PageHistoryReference reference =
       new SuiteExecutionReport.PageHistoryReference("dah", time);
   reference.getTestSummary().wrong = 99;
   original.addPageHistoryReference(reference);
   StringWriter writer = new StringWriter();
   original.toXml(writer, VelocityFactory.getVelocityEngine());
   ExecutionReport report = ExecutionReport.makeReport(writer.toString());
   assertTrue(report instanceof SuiteExecutionReport);
   assertEquals(original, report);
 }
 @Test
 public void canMakeSuiteExecutionReport() throws Exception {
   SuiteExecutionReport original =
       new SuiteExecutionReport(new FitNesseVersion("version"), "rootPath");
   original.date = DateTimeUtil.getDateFromString("12/31/1969 18:00:00");
   original.getFinalCounts().add(new TestSummary(1, 2, 3, 4));
   original.setTotalRunTimeInMillis(totalTimeMeasurementWithElapsedMillis(41));
   long time = DateTimeUtil.getTimeFromString("12/31/1969 18:00:00");
   SuiteExecutionReport.PageHistoryReference reference =
       new SuiteExecutionReport.PageHistoryReference("dah", time, 3L);
   reference.setTestSummary(new TestSummary(0, 99, 0, 0));
   original.addPageHistoryReference(reference);
   StringWriter writer = new StringWriter();
   original.toXml(writer, context.pageFactory.getVelocityEngine());
   ExecutionReport report = ExecutionReport.makeReport(writer.toString());
   assertTrue(report instanceof SuiteExecutionReport);
   assertEquals(original, report);
   assertEquals(41, report.getTotalRunTimeInMillis());
 }
Esempio n. 3
0
 @Before
 public void setUp() throws ParseException {
   clock = new DateAlteringClock(DateTimeUtil.getDateFromString(TEST_TIME)).freeze();
 }
 public String getFirstGameDisplay() {
   return DateTimeUtil.getDisplayDateShort(firstGame);
 }