From e4e9efad4428cf3dd57ee52658f93d75c1a55be5 Mon Sep 17 00:00:00 2001 From: danbress Date: Sat, 30 May 2015 12:04:54 -0400 Subject: [PATCH] NIFI-632 cleaning up tests --- .../nifi/documentation/DocGeneratorTest.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) 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 320c7c8c1e..83db4147f5 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 @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.nifi.documentation; import java.io.BufferedInputStream; @@ -8,15 +24,12 @@ 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; import org.junit.Assert; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import org.mockito.internal.util.io.IOUtil; public class DocGeneratorTest { @@ -25,18 +38,16 @@ public class DocGeneratorTest { TemporaryFolder temporaryFolder = new TemporaryFolder(); temporaryFolder.create(); - System.out.println("temp folder: " + temporaryFolder.getRoot()); - NiFiProperties properties = loadSpecifiedProperties("/conf/nifi.properties"); properties.setProperty(NiFiProperties.COMPONENT_DOCS_DIRECTORY, temporaryFolder.getRoot().getAbsolutePath()); - final ExtensionMapping extensionMapping = NarUnpacker.unpackNars(properties); + NarUnpacker.unpackNars(properties); NarClassLoaders.load(properties); ExtensionManager.discoverExtensions(); - DocGenerator.generate(properties); + DocGenerator.generate(properties); File processorDirectory = new File(temporaryFolder.getRoot(), "org.apache.nifi.processors.WriteResourceToStream"); File indexHtml = new File(processorDirectory, "index.html"); @@ -44,11 +55,7 @@ public class DocGeneratorTest { String generatedHtml = FileUtils.readFileToString(indexHtml); Assert.assertNotNull(generatedHtml); } - - private static String toString(String fileName) { - return fileName; - } - + private NiFiProperties loadSpecifiedProperties(String propertiesFile) { String file = DocGeneratorTest.class.getResource(propertiesFile).getFile();