Repository: incubator-nifi Updated Branches: refs/heads/develop 87e829682 -> 548188939
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitText.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitText.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitText.java index 893ed29..aeb887a 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitText.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitText.java @@ -81,17 +81,22 @@ public class TestSplitText { runner.assertTransferCount(SplitText.REL_ORIGINAL, 1); runner.assertTransferCount(SplitText.REL_SPLITS, 4); - final List<MockFlowFile> splits = runner.getFlowFilesForRelationship(SplitText.REL_SPLITS); + final List<MockFlowFile> splits = runner. + getFlowFilesForRelationship(SplitText.REL_SPLITS); final String expected0 = "Header Line #1\nHeader Line #2\nLine #1"; final String expected1 = "Line #2\nLine #3\nLine #4"; final String expected2 = "Line #5\nLine #6\nLine #7"; final String expected3 = "Line #8\nLine #9\nLine #10"; - splits.get(0).assertContentEquals(expected0); - splits.get(1).assertContentEquals(expected1); - splits.get(2).assertContentEquals(expected2); - splits.get(3).assertContentEquals(expected3); + splits.get(0). + assertContentEquals(expected0); + splits.get(1). + assertContentEquals(expected1); + splits.get(2). + assertContentEquals(expected2); + splits.get(3). + assertContentEquals(expected3); } @Test @@ -107,11 +112,14 @@ public class TestSplitText { runner.assertTransferCount(SplitText.REL_ORIGINAL, 1); runner.assertTransferCount(SplitText.REL_SPLITS, 4); - final List<MockFlowFile> splits = runner.getFlowFilesForRelationship(SplitText.REL_SPLITS); + final List<MockFlowFile> splits = runner. + getFlowFilesForRelationship(SplitText.REL_SPLITS); for (int i = 0; i < splits.size(); i++) { final MockFlowFile split = splits.get(i); - split.assertContentEquals(file.getParent().resolve((i + 1) + ".txt")); - split.assertAttributeEquals(SplitText.FRAGMENT_INDEX, String.valueOf(i + 1)); + split.assertContentEquals(file.getParent(). + resolve((i + 1) + ".txt")); + split.assertAttributeEquals(SplitText.FRAGMENT_INDEX, String. + valueOf(i + 1)); } } @@ -128,16 +136,26 @@ public class TestSplitText { runner.assertTransferCount(SplitText.REL_ORIGINAL, 1); runner.assertTransferCount(SplitText.REL_SPLITS, 2); - final List<MockFlowFile> splits = runner.getFlowFilesForRelationship(SplitText.REL_SPLITS); - splits.get(0).assertContentEquals(file.getParent().resolve("5.txt")); - splits.get(0).assertAttributeEquals(SplitText.FRAGMENT_INDEX, String.valueOf(1)); - splits.get(1).assertContentEquals(file.getParent().resolve("6.txt")); - splits.get(1).assertAttributeEquals(SplitText.FRAGMENT_INDEX, String.valueOf(2)); + final List<MockFlowFile> splits = runner. + getFlowFilesForRelationship(SplitText.REL_SPLITS); + splits.get(0). + assertContentEquals(file.getParent(). + resolve("5.txt")); + splits.get(0). + assertAttributeEquals(SplitText.FRAGMENT_INDEX, String. + valueOf(1)); + splits.get(1). + assertContentEquals(file.getParent(). + resolve("6.txt")); + splits.get(1). + assertAttributeEquals(SplitText.FRAGMENT_INDEX, String. + valueOf(2)); } @Test public void testSplitThenMerge() throws IOException { - final TestRunner splitRunner = TestRunners.newTestRunner(new SplitText()); + final TestRunner splitRunner = TestRunners. + newTestRunner(new SplitText()); splitRunner.setProperty(SplitText.LINE_SPLIT_COUNT, "3"); splitRunner.setProperty(SplitText.REMOVE_TRAILING_NEWLINES, "false"); @@ -148,15 +166,20 @@ public class TestSplitText { splitRunner.assertTransferCount(SplitText.REL_ORIGINAL, 1); splitRunner.assertTransferCount(SplitText.REL_FAILURE, 0); - final List<MockFlowFile> splits = splitRunner.getFlowFilesForRelationship(SplitText.REL_SPLITS); + final List<MockFlowFile> splits = splitRunner. + getFlowFilesForRelationship(SplitText.REL_SPLITS); for (final MockFlowFile flowFile : splits) { - flowFile.assertAttributeEquals(SplitText.SEGMENT_ORIGINAL_FILENAME, originalFilename); + flowFile. + assertAttributeEquals(SplitText.SEGMENT_ORIGINAL_FILENAME, originalFilename); flowFile.assertAttributeEquals(SplitText.FRAGMENT_COUNT, "4"); } - final TestRunner mergeRunner = TestRunners.newTestRunner(new MergeContent()); - mergeRunner.setProperty(MergeContent.MERGE_FORMAT, MergeContent.MERGE_FORMAT_CONCAT); - mergeRunner.setProperty(MergeContent.MERGE_STRATEGY, MergeContent.MERGE_STRATEGY_DEFRAGMENT); + final TestRunner mergeRunner = TestRunners. + newTestRunner(new MergeContent()); + mergeRunner. + setProperty(MergeContent.MERGE_FORMAT, MergeContent.MERGE_FORMAT_CONCAT); + mergeRunner. + setProperty(MergeContent.MERGE_STRATEGY, MergeContent.MERGE_STRATEGY_DEFRAGMENT); mergeRunner.enqueue(splits.toArray(new MockFlowFile[0])); mergeRunner.run(); @@ -164,10 +187,13 @@ public class TestSplitText { mergeRunner.assertTransferCount(MergeContent.REL_ORIGINAL, 4); mergeRunner.assertTransferCount(MergeContent.REL_FAILURE, 0); - final List<MockFlowFile> packed = mergeRunner.getFlowFilesForRelationship(MergeContent.REL_MERGED); + final List<MockFlowFile> packed = mergeRunner. + getFlowFilesForRelationship(MergeContent.REL_MERGED); MockFlowFile flowFile = packed.get(0); - flowFile.assertAttributeEquals(CoreAttributes.FILENAME.key(), originalFilename); - assertEquals(Files.size(dataPath.resolve(originalFilename)), flowFile.getSize()); + flowFile. + assertAttributeEquals(CoreAttributes.FILENAME.key(), originalFilename); + assertEquals(Files.size(dataPath.resolve(originalFilename)), flowFile. + getSize()); flowFile.assertContentEquals(file); } } http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitXml.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitXml.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitXml.java index 8078f26..3f9e426 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitXml.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestSplitXml.java @@ -97,7 +97,8 @@ public class TestSplitXml { for (MockFlowFile out : flowfiles) { final byte[] outData = out.toByteArray(); final String outXml = new String(outData, "UTF-8"); - saxParser.parse(new InputSource(new StringReader(outXml)), new DefaultHandler()); + saxParser. + parse(new InputSource(new StringReader(outXml)), new DefaultHandler()); } } } http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java index 17a3cd5..620cb77 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTransformXml.java @@ -39,15 +39,18 @@ public class TestTransformXml { @Test public void testStylesheetNotFound() throws IOException { - final TestRunner controller = TestRunners.newTestRunner(TransformXml.class); - controller.setProperty(TransformXml.XSLT_FILE_NAME, "/no/path/to/math.xsl"); + final TestRunner controller = TestRunners. + newTestRunner(TransformXml.class); + controller. + setProperty(TransformXml.XSLT_FILE_NAME, "/no/path/to/math.xsl"); controller.assertNotValid(); } @Test public void testNonXmlContent() throws IOException { final TestRunner runner = TestRunners.newTestRunner(new TransformXml()); - runner.setProperty(TransformXml.XSLT_FILE_NAME, "src/test/resources/TestTransformXml/math.xsl"); + runner. + setProperty(TransformXml.XSLT_FILE_NAME, "src/test/resources/TestTransformXml/math.xsl"); final Map<String, String> attributes = new HashMap<>(); runner.enqueue("not xml".getBytes(), attributes); @@ -55,7 +58,9 @@ public class TestTransformXml { runner.run(); runner.assertAllFlowFilesTransferred(TransformXml.REL_FAILURE); - final MockFlowFile original = runner.getFlowFilesForRelationship(TransformXml.REL_FAILURE).get(0); + final MockFlowFile original = runner. + getFlowFilesForRelationship(TransformXml.REL_FAILURE). + get(0); final String originalContent = new String(original.toByteArray(), StandardCharsets.UTF_8); System.out.println("originalContent:\n" + originalContent); @@ -67,25 +72,32 @@ public class TestTransformXml { public void testTransformMath() throws IOException { final TestRunner runner = TestRunners.newTestRunner(new TransformXml()); runner.setProperty("header", "Test for mod"); - runner.setProperty(TransformXml.XSLT_FILE_NAME, "src/test/resources/TestTransformXml/math.xsl"); + runner. + setProperty(TransformXml.XSLT_FILE_NAME, "src/test/resources/TestTransformXml/math.xsl"); final Map<String, String> attributes = new HashMap<>(); - runner.enqueue(Paths.get("src/test/resources/TestTransformXml/math.xml"), attributes); + runner. + enqueue(Paths. + get("src/test/resources/TestTransformXml/math.xml"), attributes); runner.run(); runner.assertAllFlowFilesTransferred(TransformXml.REL_SUCCESS); - final MockFlowFile transformed = runner.getFlowFilesForRelationship(TransformXml.REL_SUCCESS).get(0); + final MockFlowFile transformed = runner. + getFlowFilesForRelationship(TransformXml.REL_SUCCESS). + get(0); final String transformedContent = new String(transformed.toByteArray(), StandardCharsets.UTF_8); System.out.println("transformedContent:\n" + transformedContent); - transformed.assertContentEquals(Paths.get("src/test/resources/TestTransformXml/math.html")); + transformed.assertContentEquals(Paths. + get("src/test/resources/TestTransformXml/math.html")); } @Ignore("this test fails") @Test public void testTransformCsv() throws IOException { final TestRunner runner = TestRunners.newTestRunner(new TransformXml()); - runner.setProperty(TransformXml.XSLT_FILE_NAME, "src/test/resources/TestTransformXml/tokens.xsl"); + runner. + setProperty(TransformXml.XSLT_FILE_NAME, "src/test/resources/TestTransformXml/tokens.xsl"); runner.setProperty("uuid_0", "${uuid_0}"); runner.setProperty("uuid_1", "${uuid_1}"); @@ -101,7 +113,8 @@ public class TestTransformXml { String line = null; while ((line = reader.readLine()) != null) { - builder.append(line).append("\n"); + builder.append(line). + append("\n"); } builder.append("</data>"); String data = builder.toString(); @@ -110,11 +123,14 @@ public class TestTransformXml { runner.run(); runner.assertAllFlowFilesTransferred(TransformXml.REL_SUCCESS); - final MockFlowFile transformed = runner.getFlowFilesForRelationship(TransformXml.REL_SUCCESS).get(0); + final MockFlowFile transformed = runner. + getFlowFilesForRelationship(TransformXml.REL_SUCCESS). + get(0); final String transformedContent = new String(transformed.toByteArray(), StandardCharsets.ISO_8859_1); System.out.println("transformedContent:\n" + transformedContent); - transformed.assertContentEquals(Paths.get("src/test/resources/TestTransformXml/tokens.xml")); + transformed.assertContentEquals(Paths. + get("src/test/resources/TestTransformXml/tokens.xml")); } } http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestUnpackContent.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestUnpackContent.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestUnpackContent.java index e2d7cdb..6035e08 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestUnpackContent.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestUnpackContent.java @@ -36,12 +36,14 @@ import org.junit.Test; public class TestUnpackContent { - private static final Path dataPath = Paths.get("src/test/resources/TestUnpackContent"); + private static final Path dataPath = Paths. + get("src/test/resources/TestUnpackContent"); @Test public void testTar() throws IOException { final TestRunner runner = TestRunners.newTestRunner(new UnpackContent()); - runner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.TAR_FORMAT); + runner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.TAR_FORMAT); runner.enqueue(dataPath.resolve("data.tar")); runner.run(); @@ -50,11 +52,15 @@ public class TestUnpackContent { runner.assertTransferCount(UnpackContent.REL_ORIGINAL, 1); runner.assertTransferCount(UnpackContent.REL_FAILURE, 0); - final List<MockFlowFile> unpacked = runner.getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); + final List<MockFlowFile> unpacked = runner. + getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); for (final MockFlowFile flowFile : unpacked) { - final String filename = flowFile.getAttribute(CoreAttributes.FILENAME.key()); - final String folder = flowFile.getAttribute(CoreAttributes.PATH.key()); - final Path path = dataPath.resolve(folder).resolve(filename); + final String filename = flowFile. + getAttribute(CoreAttributes.FILENAME.key()); + final String folder = flowFile.getAttribute(CoreAttributes.PATH. + key()); + final Path path = dataPath.resolve(folder). + resolve(filename); assertTrue(Files.exists(path)); flowFile.assertContentEquals(path.toFile()); @@ -64,7 +70,8 @@ public class TestUnpackContent { @Test public void testZip() throws IOException { final TestRunner runner = TestRunners.newTestRunner(new UnpackContent()); - runner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.ZIP_FORMAT); + runner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.ZIP_FORMAT); runner.enqueue(dataPath.resolve("data.zip")); runner.run(); @@ -73,11 +80,15 @@ public class TestUnpackContent { runner.assertTransferCount(UnpackContent.REL_ORIGINAL, 1); runner.assertTransferCount(UnpackContent.REL_FAILURE, 0); - final List<MockFlowFile> unpacked = runner.getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); + final List<MockFlowFile> unpacked = runner. + getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); for (final MockFlowFile flowFile : unpacked) { - final String filename = flowFile.getAttribute(CoreAttributes.FILENAME.key()); - final String folder = flowFile.getAttribute(CoreAttributes.PATH.key()); - final Path path = dataPath.resolve(folder).resolve(filename); + final String filename = flowFile. + getAttribute(CoreAttributes.FILENAME.key()); + final String folder = flowFile.getAttribute(CoreAttributes.PATH. + key()); + final Path path = dataPath.resolve(folder). + resolve(filename); assertTrue(Files.exists(path)); flowFile.assertContentEquals(path.toFile()); @@ -87,7 +98,8 @@ public class TestUnpackContent { @Test public void testFlowFileStreamV3() throws IOException { final TestRunner runner = TestRunners.newTestRunner(new UnpackContent()); - runner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.FLOWFILE_STREAM_FORMAT_V3); + runner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.FLOWFILE_STREAM_FORMAT_V3); runner.enqueue(dataPath.resolve("data.flowfilev3")); runner.run(); @@ -96,11 +108,15 @@ public class TestUnpackContent { runner.assertTransferCount(UnpackContent.REL_ORIGINAL, 1); runner.assertTransferCount(UnpackContent.REL_FAILURE, 0); - final List<MockFlowFile> unpacked = runner.getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); + final List<MockFlowFile> unpacked = runner. + getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); for (final MockFlowFile flowFile : unpacked) { - final String filename = flowFile.getAttribute(CoreAttributes.FILENAME.key()); - final String folder = flowFile.getAttribute(CoreAttributes.PATH.key()); - final Path path = dataPath.resolve(folder).resolve(filename); + final String filename = flowFile. + getAttribute(CoreAttributes.FILENAME.key()); + final String folder = flowFile.getAttribute(CoreAttributes.PATH. + key()); + final Path path = dataPath.resolve(folder). + resolve(filename); assertTrue(Files.exists(path)); flowFile.assertContentEquals(path.toFile()); @@ -110,7 +126,8 @@ public class TestUnpackContent { @Test public void testFlowFileStreamV2() throws IOException { final TestRunner runner = TestRunners.newTestRunner(new UnpackContent()); - runner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.FLOWFILE_STREAM_FORMAT_V2); + runner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.FLOWFILE_STREAM_FORMAT_V2); runner.enqueue(dataPath.resolve("data.flowfilev2")); runner.run(); @@ -119,11 +136,15 @@ public class TestUnpackContent { runner.assertTransferCount(UnpackContent.REL_ORIGINAL, 1); runner.assertTransferCount(UnpackContent.REL_FAILURE, 0); - final List<MockFlowFile> unpacked = runner.getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); + final List<MockFlowFile> unpacked = runner. + getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); for (final MockFlowFile flowFile : unpacked) { - final String filename = flowFile.getAttribute(CoreAttributes.FILENAME.key()); - final String folder = flowFile.getAttribute(CoreAttributes.PATH.key()); - final Path path = dataPath.resolve(folder).resolve(filename); + final String filename = flowFile. + getAttribute(CoreAttributes.FILENAME.key()); + final String folder = flowFile.getAttribute(CoreAttributes.PATH. + key()); + final Path path = dataPath.resolve(folder). + resolve(filename); assertTrue(Files.exists(path)); flowFile.assertContentEquals(path.toFile()); @@ -132,8 +153,10 @@ public class TestUnpackContent { @Test public void testTarThenMerge() throws IOException { - final TestRunner unpackRunner = TestRunners.newTestRunner(new UnpackContent()); - unpackRunner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.TAR_FORMAT); + final TestRunner unpackRunner = TestRunners. + newTestRunner(new UnpackContent()); + unpackRunner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.TAR_FORMAT); unpackRunner.enqueue(dataPath.resolve("data.tar")); unpackRunner.run(); @@ -142,14 +165,19 @@ public class TestUnpackContent { unpackRunner.assertTransferCount(UnpackContent.REL_ORIGINAL, 1); unpackRunner.assertTransferCount(UnpackContent.REL_FAILURE, 0); - final List<MockFlowFile> unpacked = unpackRunner.getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); + final List<MockFlowFile> unpacked = unpackRunner. + getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); for (final MockFlowFile flowFile : unpacked) { - assertEquals(flowFile.getAttribute(UnpackContent.SEGMENT_ORIGINAL_FILENAME), "data"); + assertEquals(flowFile. + getAttribute(UnpackContent.SEGMENT_ORIGINAL_FILENAME), "data"); } - final TestRunner mergeRunner = TestRunners.newTestRunner(new MergeContent()); - mergeRunner.setProperty(MergeContent.MERGE_FORMAT, MergeContent.MERGE_FORMAT_TAR); - mergeRunner.setProperty(MergeContent.MERGE_STRATEGY, MergeContent.MERGE_STRATEGY_DEFRAGMENT); + final TestRunner mergeRunner = TestRunners. + newTestRunner(new MergeContent()); + mergeRunner. + setProperty(MergeContent.MERGE_FORMAT, MergeContent.MERGE_FORMAT_TAR); + mergeRunner. + setProperty(MergeContent.MERGE_STRATEGY, MergeContent.MERGE_STRATEGY_DEFRAGMENT); mergeRunner.setProperty(MergeContent.KEEP_PATH, "true"); mergeRunner.enqueue(unpacked.toArray(new MockFlowFile[0])); mergeRunner.run(); @@ -158,16 +186,20 @@ public class TestUnpackContent { mergeRunner.assertTransferCount(MergeContent.REL_ORIGINAL, 2); mergeRunner.assertTransferCount(MergeContent.REL_FAILURE, 0); - final List<MockFlowFile> packed = mergeRunner.getFlowFilesForRelationship(MergeContent.REL_MERGED); + final List<MockFlowFile> packed = mergeRunner. + getFlowFilesForRelationship(MergeContent.REL_MERGED); for (final MockFlowFile flowFile : packed) { - flowFile.assertAttributeEquals(CoreAttributes.FILENAME.key(), "data.tar"); + flowFile. + assertAttributeEquals(CoreAttributes.FILENAME.key(), "data.tar"); } } @Test public void testZipThenMerge() throws IOException { - final TestRunner unpackRunner = TestRunners.newTestRunner(new UnpackContent()); - unpackRunner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.ZIP_FORMAT); + final TestRunner unpackRunner = TestRunners. + newTestRunner(new UnpackContent()); + unpackRunner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.ZIP_FORMAT); unpackRunner.enqueue(dataPath.resolve("data.zip")); unpackRunner.run(); @@ -176,14 +208,19 @@ public class TestUnpackContent { unpackRunner.assertTransferCount(UnpackContent.REL_ORIGINAL, 1); unpackRunner.assertTransferCount(UnpackContent.REL_FAILURE, 0); - final List<MockFlowFile> unpacked = unpackRunner.getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); + final List<MockFlowFile> unpacked = unpackRunner. + getFlowFilesForRelationship(UnpackContent.REL_SUCCESS); for (final MockFlowFile flowFile : unpacked) { - assertEquals(flowFile.getAttribute(UnpackContent.SEGMENT_ORIGINAL_FILENAME), "data"); + assertEquals(flowFile. + getAttribute(UnpackContent.SEGMENT_ORIGINAL_FILENAME), "data"); } - final TestRunner mergeRunner = TestRunners.newTestRunner(new MergeContent()); - mergeRunner.setProperty(MergeContent.MERGE_FORMAT, MergeContent.MERGE_FORMAT_ZIP); - mergeRunner.setProperty(MergeContent.MERGE_STRATEGY, MergeContent.MERGE_STRATEGY_DEFRAGMENT); + final TestRunner mergeRunner = TestRunners. + newTestRunner(new MergeContent()); + mergeRunner. + setProperty(MergeContent.MERGE_FORMAT, MergeContent.MERGE_FORMAT_ZIP); + mergeRunner. + setProperty(MergeContent.MERGE_STRATEGY, MergeContent.MERGE_STRATEGY_DEFRAGMENT); mergeRunner.setProperty(MergeContent.KEEP_PATH, "true"); mergeRunner.enqueue(unpacked.toArray(new MockFlowFile[0])); mergeRunner.run(); @@ -192,16 +229,20 @@ public class TestUnpackContent { mergeRunner.assertTransferCount(MergeContent.REL_ORIGINAL, 2); mergeRunner.assertTransferCount(MergeContent.REL_FAILURE, 0); - final List<MockFlowFile> packed = mergeRunner.getFlowFilesForRelationship(MergeContent.REL_MERGED); + final List<MockFlowFile> packed = mergeRunner. + getFlowFilesForRelationship(MergeContent.REL_MERGED); for (final MockFlowFile flowFile : packed) { - flowFile.assertAttributeEquals(CoreAttributes.FILENAME.key(), "data.zip"); + flowFile. + assertAttributeEquals(CoreAttributes.FILENAME.key(), "data.zip"); } } @Test public void testZipHandlesBadData() throws IOException { - final TestRunner unpackRunner = TestRunners.newTestRunner(new UnpackContent()); - unpackRunner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.ZIP_FORMAT); + final TestRunner unpackRunner = TestRunners. + newTestRunner(new UnpackContent()); + unpackRunner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.ZIP_FORMAT); unpackRunner.enqueue(dataPath.resolve("data.tar")); unpackRunner.run(); @@ -213,8 +254,10 @@ public class TestUnpackContent { @Test public void testTarHandlesBadData() throws IOException { - final TestRunner unpackRunner = TestRunners.newTestRunner(new UnpackContent()); - unpackRunner.setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.TAR_FORMAT); + final TestRunner unpackRunner = TestRunners. + newTestRunner(new UnpackContent()); + unpackRunner. + setProperty(UnpackContent.PACKAGING_FORMAT, UnpackContent.TAR_FORMAT); unpackRunner.enqueue(dataPath.resolve("data.zip")); unpackRunner.run(); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestValidateXml.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestValidateXml.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestValidateXml.java index 9701e75..d550183 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestValidateXml.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestValidateXml.java @@ -31,7 +31,8 @@ public class TestValidateXml { @Test public void testValid() throws IOException, SAXException { final TestRunner runner = TestRunners.newTestRunner(new ValidateXml()); - runner.setProperty(ValidateXml.SCHEMA_FILE, "src/test/resources/TestXml/XmlBundle.xsd"); + runner. + setProperty(ValidateXml.SCHEMA_FILE, "src/test/resources/TestXml/XmlBundle.xsd"); runner.enqueue(Paths.get("src/test/resources/TestXml/xml-snippet.xml")); runner.run(); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestJson/json-sample.json ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestJson/json-sample.json b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestJson/json-sample.json index 09de806..1037289 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestJson/json-sample.json +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestJson/json-sample.json @@ -1,415 +1,415 @@ [ - { - "_id": "54df94072d5dbf7dc6340cc5", - "index": 0, - "guid": "b9f636cb-b939-42a9-b067-70d286116271", - "isActive": true, - "balance": "$3,200.07", - "picture": "http://placehold.it/32x32", - "age": 20, - "eyeColor": "brown", - "name": { - "first": "Shaffer", - "last": "Pearson" + { + "_id": "54df94072d5dbf7dc6340cc5", + "index": 0, + "guid": "b9f636cb-b939-42a9-b067-70d286116271", + "isActive": true, + "balance": "$3,200.07", + "picture": "http://placehold.it/32x32", + "age": 20, + "eyeColor": "brown", + "name": { + "first": "Shaffer", + "last": "Pearson" + }, + "company": "DATAGEN", + "email": "[email protected]", + "phone": "+1 (972) 588-2272", + "address": "662 Rewe Street, Starks, California, 9066", + "about": "Aliquip exercitation ad duis irure consectetur magna aliquip amet. Exercitation labore ex laboris non dolor eu. In magna amet non nulla sit laboris do aliqua aliquip. Est elit ipsum ad ea in Lorem mollit Lorem laborum. Ad labore minim aliqua dolore reprehenderit commodo nulla fugiat eiusmod nostrud cillum est. Deserunt minim in non aliqua non.\r\n", + "registered": "Wednesday, January 7, 2015 5:51 PM", + "latitude": -50.359159, + "longitude": -94.01781, + "tags": [ + "ea", + "enim", + "commodo", + "magna", + "sunt", + "dolore", + "aute" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Holloway Kim" + }, + { + "id": 1, + "name": "Clark Medina" + }, + { + "id": 2, + "name": "Rosemarie Salazar" + } + ], + "greeting": "Hello, Shaffer! You have 9 unread messages.", + "favoriteFruit": "apple" }, - "company": "DATAGEN", - "email": "[email protected]", - "phone": "+1 (972) 588-2272", - "address": "662 Rewe Street, Starks, California, 9066", - "about": "Aliquip exercitation ad duis irure consectetur magna aliquip amet. Exercitation labore ex laboris non dolor eu. In magna amet non nulla sit laboris do aliqua aliquip. Est elit ipsum ad ea in Lorem mollit Lorem laborum. Ad labore minim aliqua dolore reprehenderit commodo nulla fugiat eiusmod nostrud cillum est. Deserunt minim in non aliqua non.\r\n", - "registered": "Wednesday, January 7, 2015 5:51 PM", - "latitude": -50.359159, - "longitude": -94.01781, - "tags": [ - "ea", - "enim", - "commodo", - "magna", - "sunt", - "dolore", - "aute" - ], - "range": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "friends": [ - { - "id": 0, - "name": "Holloway Kim" - }, - { - "id": 1, - "name": "Clark Medina" - }, - { - "id": 2, - "name": "Rosemarie Salazar" - } - ], - "greeting": "Hello, Shaffer! You have 9 unread messages.", - "favoriteFruit": "apple" - }, - { - "_id": "54df94073ab1785758096418", - "index": 1, - "guid": "fda79e72-6489-41f5-bbd5-a5e7d2996dda", - "isActive": false, - "balance": "$1,416.15", - "picture": "http://placehold.it/32x32", - "age": 38, - "eyeColor": "blue", - "name": { - "first": "Frazier", - "last": "Ramsey" + { + "_id": "54df94073ab1785758096418", + "index": 1, + "guid": "fda79e72-6489-41f5-bbd5-a5e7d2996dda", + "isActive": false, + "balance": "$1,416.15", + "picture": "http://placehold.it/32x32", + "age": 38, + "eyeColor": "blue", + "name": { + "first": "Frazier", + "last": "Ramsey" + }, + "company": "STREZZO", + "email": "[email protected]", + "phone": "+1 (909) 448-2724", + "address": "624 Cedar Street, Iola, North Carolina, 2827", + "about": "Sit sunt eiusmod irure ipsum Lorem irure aliquip cupidatat in proident dolore sunt adipisicing. Aute ipsum reprehenderit aute aliquip ad id pariatur dolor dolore et exercitation. Pariatur est adipisicing eu aliqua ea sint qui. Fugiat officia voluptate anim dolore cupidatat amet. Amet cillum dolor magna elit fugiat.\r\n", + "registered": "Sunday, January 5, 2014 1:18 PM", + "latitude": -14.729254, + "longitude": 126.396861, + "tags": [ + "non", + "laboris", + "nulla", + "commodo", + "nostrud", + "qui", + "ea" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Valenzuela Stone" + }, + { + "id": 1, + "name": "King Munoz" + }, + { + "id": 2, + "name": "Kari Woodard" + } + ], + "greeting": "Hello, Frazier! You have 7 unread messages.", + "favoriteFruit": "strawberry" }, - "company": "STREZZO", - "email": "[email protected]", - "phone": "+1 (909) 448-2724", - "address": "624 Cedar Street, Iola, North Carolina, 2827", - "about": "Sit sunt eiusmod irure ipsum Lorem irure aliquip cupidatat in proident dolore sunt adipisicing. Aute ipsum reprehenderit aute aliquip ad id pariatur dolor dolore et exercitation. Pariatur est adipisicing eu aliqua ea sint qui. Fugiat officia voluptate anim dolore cupidatat amet. Amet cillum dolor magna elit fugiat.\r\n", - "registered": "Sunday, January 5, 2014 1:18 PM", - "latitude": -14.729254, - "longitude": 126.396861, - "tags": [ - "non", - "laboris", - "nulla", - "commodo", - "nostrud", - "qui", - "ea" - ], - "range": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "friends": [ - { - "id": 0, - "name": "Valenzuela Stone" - }, - { - "id": 1, - "name": "King Munoz" - }, - { - "id": 2, - "name": "Kari Woodard" - } - ], - "greeting": "Hello, Frazier! You have 7 unread messages.", - "favoriteFruit": "strawberry" - }, - { - "_id": "54df9407369a4d3f1b4aed39", - "index": 2, - "guid": "b6a68edb-4ddd-487b-b104-f02bec805e4c", - "isActive": true, - "balance": "$2,487.31", - "picture": "http://placehold.it/32x32", - "age": 27, - "eyeColor": "green", - "name": { - "first": "Cindy", - "last": "Shepherd" + { + "_id": "54df9407369a4d3f1b4aed39", + "index": 2, + "guid": "b6a68edb-4ddd-487b-b104-f02bec805e4c", + "isActive": true, + "balance": "$2,487.31", + "picture": "http://placehold.it/32x32", + "age": 27, + "eyeColor": "green", + "name": { + "first": "Cindy", + "last": "Shepherd" + }, + "company": "EMTRAK", + "email": "[email protected]", + "phone": "+1 (867) 466-3223", + "address": "659 Colin Place, Vaughn, Washington, 1106", + "about": "Nulla sunt aliquip eiusmod occaecat duis officia eiusmod aliqua cillum ut. Irure eu est nulla dolor laborum eiusmod Lorem dolore culpa aliquip veniam duis. Sint cupidatat laboris commodo sunt consequat ullamco culpa ad labore. Velit do voluptate quis occaecat ex ipsum cupidatat occaecat dolor officia laborum labore.\r\n", + "registered": "Thursday, June 26, 2014 9:56 PM", + "latitude": 85.829527, + "longitude": -79.452723, + "tags": [ + "cillum", + "do", + "veniam", + "dolore", + "voluptate", + "et", + "adipisicing" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Decker Carver" + }, + { + "id": 1, + "name": "Donaldson Burgess" + }, + { + "id": 2, + "name": "Santana Heath" + } + ], + "greeting": "Hello, Cindy! You have 8 unread messages.", + "favoriteFruit": "strawberry" }, - "company": "EMTRAK", - "email": "[email protected]", - "phone": "+1 (867) 466-3223", - "address": "659 Colin Place, Vaughn, Washington, 1106", - "about": "Nulla sunt aliquip eiusmod occaecat duis officia eiusmod aliqua cillum ut. Irure eu est nulla dolor laborum eiusmod Lorem dolore culpa aliquip veniam duis. Sint cupidatat laboris commodo sunt consequat ullamco culpa ad labore. Velit do voluptate quis occaecat ex ipsum cupidatat occaecat dolor officia laborum labore.\r\n", - "registered": "Thursday, June 26, 2014 9:56 PM", - "latitude": 85.829527, - "longitude": -79.452723, - "tags": [ - "cillum", - "do", - "veniam", - "dolore", - "voluptate", - "et", - "adipisicing" - ], - "range": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "friends": [ - { - "id": 0, - "name": "Decker Carver" - }, - { - "id": 1, - "name": "Donaldson Burgess" - }, - { - "id": 2, - "name": "Santana Heath" - } - ], - "greeting": "Hello, Cindy! You have 8 unread messages.", - "favoriteFruit": "strawberry" - }, - { - "_id": "54df94076f342042d027ca67", - "index": 3, - "guid": "ac591519-1642-4092-9646-17b4b7a9e38b", - "isActive": false, - "balance": "$3,480.12", - "picture": "http://placehold.it/32x32", - "age": 37, - "eyeColor": "green", - "name": { - "first": "Colon", - "last": "Gamble" + { + "_id": "54df94076f342042d027ca67", + "index": 3, + "guid": "ac591519-1642-4092-9646-17b4b7a9e38b", + "isActive": false, + "balance": "$3,480.12", + "picture": "http://placehold.it/32x32", + "age": 37, + "eyeColor": "green", + "name": { + "first": "Colon", + "last": "Gamble" + }, + "company": "RONELON", + "email": "[email protected]", + "phone": "+1 (988) 431-2933", + "address": "472 Ryerson Street, Gwynn, Wyoming, 4200", + "about": "Ad duis nostrud laboris id aute reprehenderit veniam aute aute laborum exercitation laborum. In minim quis in sunt minim labore deserunt id dolor ea sit. Ipsum tempor Lorem aliqua ad sit quis duis exercitation quis. Dolore voluptate aute ut est non quis do aute exercitation consectetur reprehenderit proident quis.\r\n", + "registered": "Tuesday, July 29, 2014 1:38 PM", + "latitude": -9.922105, + "longitude": -170.581901, + "tags": [ + "fugiat", + "incididunt", + "proident", + "laboris", + "id", + "ullamco", + "non" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Shawn Collins" + }, + { + "id": 1, + "name": "Holland West" + }, + { + "id": 2, + "name": "Daniel Fischer" + } + ], + "greeting": "Hello, Colon! You have 7 unread messages.", + "favoriteFruit": "strawberry" }, - "company": "RONELON", - "email": "[email protected]", - "phone": "+1 (988) 431-2933", - "address": "472 Ryerson Street, Gwynn, Wyoming, 4200", - "about": "Ad duis nostrud laboris id aute reprehenderit veniam aute aute laborum exercitation laborum. In minim quis in sunt minim labore deserunt id dolor ea sit. Ipsum tempor Lorem aliqua ad sit quis duis exercitation quis. Dolore voluptate aute ut est non quis do aute exercitation consectetur reprehenderit proident quis.\r\n", - "registered": "Tuesday, July 29, 2014 1:38 PM", - "latitude": -9.922105, - "longitude": -170.581901, - "tags": [ - "fugiat", - "incididunt", - "proident", - "laboris", - "id", - "ullamco", - "non" - ], - "range": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "friends": [ - { - "id": 0, - "name": "Shawn Collins" - }, - { - "id": 1, - "name": "Holland West" - }, - { - "id": 2, - "name": "Daniel Fischer" - } - ], - "greeting": "Hello, Colon! You have 7 unread messages.", - "favoriteFruit": "strawberry" - }, - { - "_id": "54df94075774d288fc86a912", - "index": 4, - "guid": "daec0340-7900-4a65-92fc-22e727577660", - "isActive": true, - "balance": "$3,042.74", - "picture": "http://placehold.it/32x32", - "age": 36, - "eyeColor": "brown", - "name": { - "first": "Carter", - "last": "Russo" + { + "_id": "54df94075774d288fc86a912", + "index": 4, + "guid": "daec0340-7900-4a65-92fc-22e727577660", + "isActive": true, + "balance": "$3,042.74", + "picture": "http://placehold.it/32x32", + "age": 36, + "eyeColor": "brown", + "name": { + "first": "Carter", + "last": "Russo" + }, + "company": "NORALEX", + "email": "[email protected]", + "phone": "+1 (819) 543-3605", + "address": "147 Everit Street, Saticoy, Missouri, 5963", + "about": "Ea irure non pariatur ipsum. Magna eu enim anim Lorem quis sint cillum. Voluptate proident commodo dolor aute consectetur reprehenderit dolor nostrud ipsum cillum magna dolor. Reprehenderit sit consequat pariatur enim do occaecat exercitation reprehenderit.\r\n", + "registered": "Saturday, January 25, 2014 10:12 PM", + "latitude": -65.101248, + "longitude": 19.867506, + "tags": [ + "dolore", + "et", + "ex", + "eu", + "nostrud", + "ex", + "ad" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Felicia Hull" + }, + { + "id": 1, + "name": "Jerri Mays" + }, + { + "id": 2, + "name": "Jo Justice" + } + ], + "greeting": "Hello, Carter! You have 7 unread messages.", + "favoriteFruit": "apple" }, - "company": "NORALEX", - "email": "[email protected]", - "phone": "+1 (819) 543-3605", - "address": "147 Everit Street, Saticoy, Missouri, 5963", - "about": "Ea irure non pariatur ipsum. Magna eu enim anim Lorem quis sint cillum. Voluptate proident commodo dolor aute consectetur reprehenderit dolor nostrud ipsum cillum magna dolor. Reprehenderit sit consequat pariatur enim do occaecat exercitation reprehenderit.\r\n", - "registered": "Saturday, January 25, 2014 10:12 PM", - "latitude": -65.101248, - "longitude": 19.867506, - "tags": [ - "dolore", - "et", - "ex", - "eu", - "nostrud", - "ex", - "ad" - ], - "range": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "friends": [ - { - "id": 0, - "name": "Felicia Hull" - }, - { - "id": 1, - "name": "Jerri Mays" - }, - { - "id": 2, - "name": "Jo Justice" - } - ], - "greeting": "Hello, Carter! You have 7 unread messages.", - "favoriteFruit": "apple" - }, - { - "_id": "54df940741be468e58e87dd3", - "index": 5, - "guid": "16a037a3-fe30-4c51-8d09-f24ad54f4719", - "isActive": true, - "balance": "$1,979.92", - "picture": "http://placehold.it/32x32", - "age": 20, - "eyeColor": "blue", - "name": { - "first": "Claudia", - "last": "Houston" + { + "_id": "54df940741be468e58e87dd3", + "index": 5, + "guid": "16a037a3-fe30-4c51-8d09-f24ad54f4719", + "isActive": true, + "balance": "$1,979.92", + "picture": "http://placehold.it/32x32", + "age": 20, + "eyeColor": "blue", + "name": { + "first": "Claudia", + "last": "Houston" + }, + "company": "FISHLAND", + "email": "[email protected]", + "phone": "+1 (860) 498-3802", + "address": "821 Remsen Avenue, Ada, Vermont, 3101", + "about": "Lorem eu deserunt et non id consectetur laborum voluptate id magna labore. Dolore enim voluptate mollit culpa cupidatat officia do aute voluptate Lorem commodo. Nisi nostrud amet in labore ullamco nisi magna adipisicing voluptate aliquip qui consequat enim. Pariatur adipisicing nostrud ut deserunt ad excepteur. Lorem do voluptate adipisicing et laborum commodo nulla excepteur laborum quis tempor proident velit.\r\n", + "registered": "Thursday, August 7, 2014 7:48 AM", + "latitude": 34.6075, + "longitude": -2.643176, + "tags": [ + "enim", + "eu", + "sint", + "qui", + "elit", + "laboris", + "commodo" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Boyd Morrison" + }, + { + "id": 1, + "name": "Wendi Sandoval" + }, + { + "id": 2, + "name": "Mindy Bush" + } + ], + "greeting": "Hello, Claudia! You have 8 unread messages.", + "favoriteFruit": "apple" }, - "company": "FISHLAND", - "email": "[email protected]", - "phone": "+1 (860) 498-3802", - "address": "821 Remsen Avenue, Ada, Vermont, 3101", - "about": "Lorem eu deserunt et non id consectetur laborum voluptate id magna labore. Dolore enim voluptate mollit culpa cupidatat officia do aute voluptate Lorem commodo. Nisi nostrud amet in labore ullamco nisi magna adipisicing voluptate aliquip qui consequat enim. Pariatur adipisicing nostrud ut deserunt ad excepteur. Lorem do voluptate adipisicing et laborum commodo nulla excepteur laborum quis tempor proident velit.\r\n", - "registered": "Thursday, August 7, 2014 7:48 AM", - "latitude": 34.6075, - "longitude": -2.643176, - "tags": [ - "enim", - "eu", - "sint", - "qui", - "elit", - "laboris", - "commodo" - ], - "range": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "friends": [ - { - "id": 0, - "name": "Boyd Morrison" - }, - { - "id": 1, - "name": "Wendi Sandoval" - }, - { - "id": 2, - "name": "Mindy Bush" - } - ], - "greeting": "Hello, Claudia! You have 8 unread messages.", - "favoriteFruit": "apple" - }, - { - "_id": "54df9407fbfc2103751de2e7", - "index": 6, - "guid": "60241980-5362-41dd-b6e5-e55f174904cf", - "isActive": true, - "balance": "$3,106.83", - "picture": "http://placehold.it/32x32", - "age": 40, - "eyeColor": "green", - "name": { - "first": "Beulah", - "last": "Myers" - }, - "company": "UNI", - "email": "[email protected]", - "phone": "+1 (969) 407-3571", - "address": "661 Matthews Court, Osage, Delaware, 1167", - "about": "Officia ipsum reprehenderit in nostrud Lorem labore consectetur nulla quis officia ullamco. Eiusmod ipsum deserunt consectetur cillum et duis do esse veniam occaecat Lorem dolor consequat. Lorem esse cupidatat aute et ut.\r\n", - "registered": "Sunday, January 25, 2015 8:22 PM", - "latitude": 72.620891, - "longitude": 155.859974, - "tags": [ - "minim", - "fugiat", - "irure", - "culpa", - "exercitation", - "labore", - "commodo" - ], - "range": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ], - "friends": [ - { - "id": 0, - "name": "Corina Francis" - }, - { - "id": 1, - "name": "Vera Carson" - }, - { - "id": 2, - "name": "Blevins Camacho" - } - ], - "greeting": "Hello, Beulah! You have 8 unread messages.", - "favoriteFruit": "apple" - } + { + "_id": "54df9407fbfc2103751de2e7", + "index": 6, + "guid": "60241980-5362-41dd-b6e5-e55f174904cf", + "isActive": true, + "balance": "$3,106.83", + "picture": "http://placehold.it/32x32", + "age": 40, + "eyeColor": "green", + "name": { + "first": "Beulah", + "last": "Myers" + }, + "company": "UNI", + "email": "[email protected]", + "phone": "+1 (969) 407-3571", + "address": "661 Matthews Court, Osage, Delaware, 1167", + "about": "Officia ipsum reprehenderit in nostrud Lorem labore consectetur nulla quis officia ullamco. Eiusmod ipsum deserunt consectetur cillum et duis do esse veniam occaecat Lorem dolor consequat. Lorem esse cupidatat aute et ut.\r\n", + "registered": "Sunday, January 25, 2015 8:22 PM", + "latitude": 72.620891, + "longitude": 155.859974, + "tags": [ + "minim", + "fugiat", + "irure", + "culpa", + "exercitation", + "labore", + "commodo" + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "friends": [ + { + "id": 0, + "name": "Corina Francis" + }, + { + "id": 1, + "name": "Vera Carson" + }, + { + "id": 2, + "name": "Blevins Camacho" + } + ], + "greeting": "Hello, Beulah! You have 8 unread messages.", + "favoriteFruit": "apple" + } ] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/ControllerStatusReportingTask.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/ControllerStatusReportingTask.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/ControllerStatusReportingTask.java index d87f5d1..5b95094 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/ControllerStatusReportingTask.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/ControllerStatusReportingTask.java @@ -92,7 +92,8 @@ public class ControllerStatusReportingTask extends AbstractReportingTask { connectionBorderLine = connectionBorderBuilder.toString(); processorLineFormat = context.getProperty(SHOW_DELTAS).asBoolean() ? PROCESSOR_LINE_FORMAT_WITH_DELTA : PROCESSOR_LINE_FORMAT_NO_DELTA; - processorHeader = String.format(processorLineFormat, "Processor Name", "Processor ID", "Processor Type", "Run Status", "Flow Files In", "Flow Files Out", "Bytes Read", "Bytes Written", "Tasks", "Proc Time"); + processorHeader = String.format(processorLineFormat, "Processor Name", "Processor ID", "Processor Type", "Run Status", "Flow Files In", + "Flow Files Out", "Bytes Read", "Bytes Written", "Tasks", "Proc Time"); final StringBuilder processorBorderBuilder = new StringBuilder(processorHeader.length()); for (int i = 0; i < processorHeader.length(); i++) { @@ -150,13 +151,7 @@ public class ControllerStatusReportingTask extends AbstractReportingTask { } } - /** - * Recursively prints the status of all connections in this group. - * - * @param groupStatus - * @param group - * @param builder - */ + // Recursively prints the status of all connections in this group. private void printConnectionStatus(final ProcessGroupStatus groupStatus, final StringBuilder builder, final boolean showDeltas) { final List<ConnectionStatus> connectionStatuses = new ArrayList<>(); populateConnectionStatuses(groupStatus, connectionStatuses); @@ -254,13 +249,7 @@ public class ControllerStatusReportingTask extends AbstractReportingTask { return sb.toString(); } - /** - * Recursively the status of all processors in this group. - * - * @param groupStatus - * @param group - * @param builder - */ + // Recursively the status of all processors in this group. private void printProcessorStatus(final ProcessGroupStatus groupStatus, final StringBuilder builder, final boolean showDeltas) { final List<ProcessorStatus> processorStatuses = new ArrayList<>(); populateProcessorStatuses(groupStatus, processorStatuses); http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/54818893/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java index 8f17c7b..bb8971a 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java @@ -255,7 +255,8 @@ public class MonitorMemory extends AbstractReportingTask { public ValidationResult validate(final String subject, final String input, final ValidationContext context) { if (!PERCENTAGE_PATTERN.matcher(input).matches() && !DATA_SIZE_PATTERN.matcher(input).matches()) { - return new ValidationResult.Builder().input(input).subject(subject).valid(false).explanation("Valid value is a number in the range of 0-99 followed by a percent sign (e.g. 65%) or a Data Size (e.g. 100 MB)").build(); + return new ValidationResult.Builder().input(input).subject(subject).valid(false) + .explanation("Valid value is a number in the range of 0-99 followed by a percent sign (e.g. 65%) or a Data Size (e.g. 100 MB)").build(); } return new ValidationResult.Builder().input(input).subject(subject).valid(true).build();
