/** * Creates the helper that essentially encapsulates the index of test * documentation. * * @param config the configuration to be used by the helper. * @return the created helper instance. */ public TestDocHelper createHelper(final ReportConfig config) { final UnitTestDocIndex index = readIndex(); return new TestDocHelper(index, config); }
/** * {@inheritDoc} */ @Override protected void executeReport(final Locale locale) throws MavenReportException { if (canGenerateReport()) { super.executeReport(locale); final IndexProvider indexChecker = new IndexProvider(serOutputDirectory); final ReportConfig reportConfig = createReportConfig(); testDocHelper = indexChecker.createHelper(reportConfig); if (testDocHelper.isIndexProvided()) { exportIndex(locale); } else { getLog().info( "No test doc information found, no report will be generated."); } } else { getLog().debug("Skipping testdoc report."); } }
private UnitTestDocIndex readIndex() { final UnitTestDocIndex index = new UnitTestDocIndex(); // GlobalUnitTestDocIndex.getIndex(); if (isJmxBeanRegistered()) { return getIndexIndexFromJmxBean(); } else if (isSerializedIndexProvided()) { final Collection<File> serFiles = fetchSerFiles(serializedRootDir); final PersistenceUtils persist = new PersistenceUtils(); for (final File serFile : serFiles) { final UnitTestDoc testDoc = (UnitTestDoc) persist.deserialize(serFile); index.register(testDoc); } } if (index.isEmpty()) { if (log.isInfoEnabled()) { log.info("No index found. Nothing to render to the testdoc report."); } return null; } return index; }
/** * {@inheritDoc} */ @Override protected void executeReport(final Locale locale) throws MavenReportException { if (canGenerateReport()) { super.executeReport(locale); final IndexProvider indexChecker = new IndexProvider(serOutputDirectory); final ReportConfig reportConfig = createReportConfig(); testDocHelper = indexChecker.createHelper(reportConfig); if (testDocHelper.isIndexProvided()) { exportIndex(locale); } else { getLog().info( "No test doc information found, no report will be generated."); } } else { getLog().debug("Skipping testdoc report."); } }
private UnitTestDocIndex getIndexIndexFromJmxBean() { final MBeanServer server = ManagementFactory.getPlatformMBeanServer(); final JmxExportAdapterMBean exportAdapter = JMX.newMBeanProxy(server, jmxObjectName, JmxExportAdapterMBean.class); final UnitTestDocIndex index = readIndex(exportAdapter); return index; }