private File createFile(final Type testCaseType) { final String fileName = createFileName(testCaseType); return new File(rootDirectory, fileName); }
public void addTestMethod(final JUnitTestMethodDoc testMethod) { final String methodName = testMethod.getTestMethodName(); assert !testMethods.containsKey(methodName) : "Test method information must not be added twice"; testMethods.put(methodName, testMethod); }
/** * Reads the XML information from the stream. * * @param input the stream to read the JUnit XML report from. * @return the parsed instance of the report. * @throws JDOMException on any parsing problem. * @throws IOException if the stream cannot be read. */ public JUnitTestCaseDoc read(final InputStream input) throws JDOMException, IOException { final JUnitTestCaseDoc testCaseDoc = new JUnitTestCaseDoc(); final Document document = builder.build(input); @SuppressWarnings("unchecked") final List<Element> testCaseElements = XPath.selectNodes(document, "/testsuite/testcase"); for (final Element testCaseElement : testCaseElements) { final JUnitTestMethodDoc testMethodDoc = createTestCase(testCaseElement); testCaseDoc.addTestMethod(testMethodDoc); } return testCaseDoc; }
junitManager.readTestCase(testCaseType); final JUnitTestMethodDoc method = testCase.getTestMethod(testMethodName); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType); renderJUnitStatusLink(resultType, link); log.warn("Cannot read JUnit information: " + e.getMessage());
junitManager.readTestCase(testCaseType); final JUnitTestMethodDoc method = testCase.getTestMethod(testMethodName); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType);
final File testCaseFile = createFile(testCaseType); InputStream input = null; final JUnitTestCaseDoc testCase = parser.read(input); cache.put(testCaseType, testCase); return testCase; throw new TestCaseReportException( "Cannot read JUnit XML report for test case '" + testCaseType + "'.", e); throw new TestCaseReportException( "Cannot parse JUnit XML report for test case '" + testCaseType + "'.", e);
protected void renderTableEnd(final ScenarioTestDoc scenarioRepresentant) throws IOException { final Type testCaseType = scenarioRepresentant.getTestCaseType(); final JUnitTestCaseManager junitManager = testDocHelper.getJunitManager(); junitManager.evict(testCaseType); }
/** * {@inheritDoc} * <p> * Configures the plugin logger. * </p> * * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale) */ @Override protected void executeReport(final Locale locale) throws MavenReportException { super.executeReport(locale); final ExternalReportFactory factory = new MavenExternalReportFactory(project, ""); reports = new ExternalReportReferences(factory); addJxrReports(); addJavadocReports(); addSurefireReport(); addCoberturaReport(); if (presentJUnitReport) { junitManager = new DirectoryJUnitTestCaseManager(junitReportLocation); } }
private static JUnitTestMethodDoc createTestCase(final Element testCaseElement) { final String time = testCaseElement.getAttribute("time").getValue(); final String testCaseType = testCaseElement.getAttribute("classname").getValue(); final String testMethodName = testCaseElement.getAttribute("name").getValue(); final ResultType resultType = getResultType(testCaseElement); final JUnitTestMethodDoc testCaseDoc = new JUnitTestMethodDoc(resultType, time, testCaseType, testMethodName); return testCaseDoc; }
junitManager.readTestCase(testCaseType); final JUnitTestMethodDoc method = testCase.getTestMethod(testMethodName); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType); renderJUnitStatusLink(resultType, link); log.warn("Cannot read JUnit information: " + e.getMessage());
junitManager.readTestCase(testCaseType); final JUnitTestMethodDoc method = testCase.getTestMethod(testMethodName); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType);
protected void renderTableEnd(final ScenarioTestDoc scenarioRepresentant) throws IOException { final Type testCaseType = scenarioRepresentant.getTestCaseType(); final JUnitTestCaseManager junitManager = testDocHelper.getJunitManager(); junitManager.evict(testCaseType); }
/** * {@inheritDoc} * <p> * Configures the plugin logger. * </p> * * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale) */ @Override protected void executeReport(final Locale locale) throws MavenReportException { super.executeReport(locale); final ExternalReportFactory factory = new MavenExternalReportFactory(project, ""); reports = new ExternalReportReferences(factory); addJxrReports(); addJavadocReports(); addSurefireReport(); addCoberturaReport(); if (presentJUnitReport) { junitManager = new DirectoryJUnitTestCaseManager(junitReportLocation); } }