@Test public void canReadTestExecutionReport() throws Exception { TestExecutionReport original = new TestExecutionReport(); original.version = "version"; original.rootPath = "rootPath"; StringWriter writer = new StringWriter(); original.toXml(writer, VelocityFactory.getVelocityEngine()); ExecutionReport report = ExecutionReport.makeReport(writer.toString()); assertTrue(report instanceof TestExecutionReport); }
@Test public void canReadTestExecutionReport() throws Exception { TestExecutionReport original = new TestExecutionReport(); original.version = "version"; original.rootPath = "rootPath"; original.setTotalRunTimeInMillis(totalTimeMeasurementWithElapsedMillis(42)); StringWriter writer = new StringWriter(); original.toXml(writer, VelocityFactory.getVelocityEngine()); ExecutionReport report = ExecutionReport.makeReport(writer.toString()); assertTrue(report instanceof TestExecutionReport); assertEquals(original, report); assertEquals(42, report.getTotalRunTimeInMillis()); }
@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); }