From 6324442acf77be1a9dd677bba0c44d2061cb9af2 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Fri, 5 Jun 2015 16:08:46 -0400 Subject: [PATCH 1/2] NIFI-661: - Fixing issue which caused the invalid icon from wrapping in Firefox. --- .../src/main/webapp/js/nf/canvas/nf-settings.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js index c7b2b651d1..d3238925a1 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js @@ -599,9 +599,9 @@ nf.Settings = (function () { // more details formatter var moreControllerServiceDetails = function (row, cell, value, columnDef, dataContext) { - var markup = '  '; + var markup = ''; if (!nf.Common.isEmpty(dataContext.validationErrors)) { - markup += ''; + markup += ''; } return markup; }; @@ -1197,9 +1197,9 @@ nf.Settings = (function () { initNewReportingTaskDialog(); var moreReportingTaskDetails = function (row, cell, value, columnDef, dataContext) { - var markup = '  '; + var markup = ''; if (!nf.Common.isEmpty(dataContext.validationErrors)) { - markup += ''; + markup += ''; } return markup; }; From c9ddf21ad63c032ec936adc25e2886b7632be098 Mon Sep 17 00:00:00 2001 From: Aldrin Piri Date: Sat, 6 Jun 2015 11:16:52 -0400 Subject: [PATCH 2/2] NIFI-663: Updating tests to provide valid options for assertions when in a Windows environment. Preferring regex to contains/endsWith --- .../standard/TestExecuteStreamCommand.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java index 90fb28f287..d565bca3aa 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java @@ -16,24 +16,24 @@ */ package org.apache.nifi.processors.standard; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.apache.nifi.util.MockFlowFile; +import org.apache.nifi.util.TestRunner; +import org.apache.nifi.util.TestRunners; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; +import java.util.regex.Pattern; -import org.apache.nifi.util.MockFlowFile; -import org.apache.nifi.util.TestRunner; -import org.apache.nifi.util.TestRunners; - -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @@ -70,7 +70,7 @@ public class TestExecuteStreamCommand { MockFlowFile outputFlowFile = flowFiles.get(0); byte[] byteArray = outputFlowFile.toByteArray(); String result = new String(byteArray); - assertTrue("Test was a success\r\n".equals(result) || "Test was a success\n".equals(result)); + assertTrue(Pattern.compile("Test was a success\r?\n").matcher(result).find()); assertEquals("0", outputFlowFile.getAttribute("execution.status")); assertEquals("java", outputFlowFile.getAttribute("execution.command")); assertEquals("-jar;", outputFlowFile.getAttribute("execution.command.args").substring(0, 5)); @@ -131,8 +131,7 @@ public class TestExecuteStreamCommand { byte[] byteArray = flowFiles.get(0).toByteArray(); String result = new String(byteArray); - assertTrue(result.contains(File.separator + "nifi-standard-processors:ModifiedResult\r\n") - || result.contains(File.separator + "nifi-standard-processors:ModifiedResult\n")); + assertTrue(Pattern.compile("nifi-standard-processors:ModifiedResult\r?\n").matcher(result).find()); } @Test @@ -153,8 +152,9 @@ public class TestExecuteStreamCommand { List flowFiles = controller.getFlowFilesForRelationship(ExecuteStreamCommand.OUTPUT_STREAM_RELATIONSHIP); byte[] byteArray = flowFiles.get(0).toByteArray(); String result = new String(byteArray); - assertTrue(result.contains(File.separator + "nifi-standard-processors" + File.separator + "target:ModifiedResult\r\n") - || result.contains(File.separator + "nifi-standard-processors" + File.separator + "target:ModifiedResult\n")); + + final String quotedSeparator = Pattern.quote(File.separator); + assertTrue(Pattern.compile(quotedSeparator + "nifi-standard-processors" + quotedSeparator + "target:ModifiedResult\r?\n").matcher(result).find()); } @Test @@ -177,7 +177,7 @@ public class TestExecuteStreamCommand { byte[] byteArray = flowFiles.get(0).toByteArray(); String result = new String(byteArray); assertTrue("TestIngestAndUpdate.jar should not have received anything to modify", - result.endsWith("target:ModifiedResult\n")); + Pattern.compile("target:ModifiedResult\r?\n$").matcher(result).find()); } // this is dependent on window with cygwin...so it's not enabled @@ -226,7 +226,7 @@ public class TestExecuteStreamCommand { List flowFiles = controller.getFlowFilesForRelationship(ExecuteStreamCommand.OUTPUT_STREAM_RELATIONSHIP); byte[] byteArray = flowFiles.get(0).toByteArray(); String result = new String(byteArray); - String[] dynamicEnvironment = result.split("\n"); + String[] dynamicEnvironment = result.split("\r?\n"); assertEquals("Should contain two environment variables starting with NIFI", 2, dynamicEnvironment.length); assertEquals("NIFI_TEST_2 environment variable is missing", "NIFI_TEST_2=testvalue2", dynamicEnvironment[0]); assertEquals("NIFI_TEST_1 environment variable is missing", "NIFI_TEST_1=testvalue1", dynamicEnvironment[1]);