diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/DocGenerator.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/DocGenerator.java index ea033c5ebb..0e9ed37414 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/DocGenerator.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/DocGenerator.java @@ -76,7 +76,7 @@ public class DocGenerator { logger.debug("Documenting: " + componentClass); document(explodedNiFiDocsDir, componentClass); } catch (Exception e) { - logger.warn("Unable to document: " + componentClass); + logger.warn("Unable to document: " + componentClass, e); } } } diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/DocGeneratorTest.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/DocGeneratorTest.java index c077540b6f..320c7c8c1e 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/DocGeneratorTest.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/java/org/apache/nifi/documentation/DocGeneratorTest.java @@ -7,7 +7,9 @@ import java.io.IOException; import java.io.InputStream; import org.apache.commons.io.FileUtils; +import org.apache.nifi.nar.ExtensionManager; import org.apache.nifi.nar.ExtensionMapping; +import org.apache.nifi.nar.NarClassLoaders; import org.apache.nifi.nar.NarUnpacker; import org.apache.nifi.stream.io.StreamUtils; import org.apache.nifi.util.NiFiProperties; @@ -19,7 +21,7 @@ import org.mockito.internal.util.io.IOUtil; public class DocGeneratorTest { @Test - public void testProcessorLoadsNarResources() throws IOException { + public void testProcessorLoadsNarResources() throws IOException, ClassNotFoundException { TemporaryFolder temporaryFolder = new TemporaryFolder(); temporaryFolder.create(); @@ -30,11 +32,15 @@ public class DocGeneratorTest { final ExtensionMapping extensionMapping = NarUnpacker.unpackNars(properties); + NarClassLoaders.load(properties); + + ExtensionManager.discoverExtensions(); + DocGenerator.generate(properties); - File processorDirectory = new File(temporaryFolder.getRoot(), "org.apache.nifi.TestProcessor"); + File processorDirectory = new File(temporaryFolder.getRoot(), "org.apache.nifi.processors.WriteResourceToStream"); File indexHtml = new File(processorDirectory, "index.html"); - + Assert.assertTrue(indexHtml + " should have been generated", indexHtml.exists()); String generatedHtml = FileUtils.readFileToString(indexHtml); Assert.assertNotNull(generatedHtml); } diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/conf/nifi.properties b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/conf/nifi.properties index 92e4a92670..a0e13895eb 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/conf/nifi.properties +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/conf/nifi.properties @@ -27,8 +27,8 @@ nifi.controller.service.configuration.file=./target/controller-services.xml nifi.templates.directory=./target/templates nifi.ui.banner.text=UI Banner Text nifi.ui.autorefresh.interval=30 sec -nifi.nar.library.directory=./target/NarUnpacker/lib/ -nifi.nar.library.directory.alt=./target/NarUnpacker/lib2/ +nifi.nar.library.directory=./target/test-classes/lib/ +nifi.nar.library.directory.alt=./target/test-classes/lib2/ nifi.nar.working.directory=./target/work/nar/ diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/example.nar b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/example.nar new file mode 100644 index 0000000000..5c0182b715 Binary files /dev/null and b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/example.nar differ diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/jetty.nar b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/jetty.nar new file mode 100644 index 0000000000..f92d6154d1 Binary files /dev/null and b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/jetty.nar differ diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/nifi-framework-nar.nar b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/nifi-framework-nar.nar new file mode 100644 index 0000000000..d2a8b9667e Binary files /dev/null and b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/test/resources/lib/nifi-framework-nar.nar differ