Search in sources :

Example 1 with ProcessorWithLogger

use of org.apache.nifi.documentation.example.ProcessorWithLogger in project nifi by apache.

the class ProcessorDocumentationWriterTest method testProcessorWithLoggerInitialization.

@Test
public void testProcessorWithLoggerInitialization() throws IOException {
    ProcessorWithLogger processor = new ProcessorWithLogger();
    ProcessorInitializer initializer = new ProcessorInitializer();
    initializer.initialize(processor);
    DocumentationWriter writer = new HtmlProcessorDocumentationWriter();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    writer.write(processor, baos, false);
    initializer.teardown(processor);
    String results = new String(baos.toByteArray());
    XmlValidator.assertXmlValid(results);
}
Also used : ProcessorInitializer(org.apache.nifi.init.ProcessorInitializer) DocumentationWriter(org.apache.nifi.documentation.DocumentationWriter) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ProcessorWithLogger(org.apache.nifi.documentation.example.ProcessorWithLogger) Test(org.junit.Test)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DocumentationWriter (org.apache.nifi.documentation.DocumentationWriter)1 ProcessorWithLogger (org.apache.nifi.documentation.example.ProcessorWithLogger)1 ProcessorInitializer (org.apache.nifi.init.ProcessorInitializer)1 Test (org.junit.Test)1