public TestRunner getRunner() { TestRunner runner = TestRunners.newTestRunner(QueryRecord.class); /** * we have to disable validation of expression language because the scope of the evaluation * depends of the value of another property: if we are caching the schema/queries or not. If * we don't disable the validation, it'll throw an error saying that the scope is incorrect. */ runner.setValidateExpressionUsage(false); return runner; }
public TestRunner getRunner() { TestRunner runner = TestRunners.newTestRunner(ReplaceTextWithMapping.class); /** * we have to disable validation of expression language because the processor will * need to evaluate the REGEX field with AND without flow files. If not disabled, * the test will throw an error about the evaluation scope */ runner.setValidateExpressionUsage(false); return runner; }
public TestRunner getRunner() { TestRunner runner = TestRunners.newTestRunner(ReplaceText.class); /** * we have to disable validation of expression language because the scope of the evaluation * for the search value depends of another property (the evaluation mode). If not disabling * the validation, it'll throw an error about the eval */ runner.setValidateExpressionUsage(false); return runner; }
@Test public void testLoggingToStdErr() throws IOException { File exJar = new File("src/test/resources/ExecuteCommand/TestLogStdErr.jar"); File dummy = new File("src/test/resources/ExecuteCommand/1mb.txt"); String jarPath = exJar.getAbsolutePath(); exJar.setExecutable(true); final TestRunner controller = TestRunners.newTestRunner(ExecuteStreamCommand.class); controller.setValidateExpressionUsage(false); controller.enqueue(dummy.toPath()); controller.setProperty(ExecuteStreamCommand.EXECUTION_COMMAND, "java"); controller.setProperty(ExecuteStreamCommand.EXECUTION_ARGUMENTS, "-jar;" + jarPath); controller.run(1); controller.assertTransferCount(ExecuteStreamCommand.ORIGINAL_RELATIONSHIP, 1); controller.assertTransferCount(ExecuteStreamCommand.OUTPUT_STREAM_RELATIONSHIP, 1); List<MockFlowFile> flowFiles = controller.getFlowFilesForRelationship(ExecuteStreamCommand.OUTPUT_STREAM_RELATIONSHIP); MockFlowFile flowFile = flowFiles.get(0); assertEquals(0, flowFile.getSize()); assertEquals("fffffffffffffffffffffffffffffff", flowFile.getAttribute("execution.error").substring(0, 31)); }
@Before public void setup(){ putSFTPRunner = TestRunners.newTestRunner(PutSFTP.class); putSFTPRunner.setProperty(SFTPTransfer.HOSTNAME, "localhost"); putSFTPRunner.setProperty(SFTPTransfer.PORT, Integer.toString(sshTestServer.getSSHPort())); putSFTPRunner.setProperty(SFTPTransfer.USERNAME, sshTestServer.getUsername()); putSFTPRunner.setProperty(SFTPTransfer.PASSWORD, sshTestServer.getPassword()); putSFTPRunner.setProperty(SFTPTransfer.STRICT_HOST_KEY_CHECKING, "false"); putSFTPRunner.setProperty(SFTPTransfer.BATCH_SIZE, "2"); putSFTPRunner.setProperty(SFTPTransfer.REMOTE_PATH, "nifi_test/"); putSFTPRunner.setProperty(SFTPTransfer.REJECT_ZERO_BYTE, "true"); putSFTPRunner.setProperty(SFTPTransfer.CONFLICT_RESOLUTION, FileTransfer.CONFLICT_RESOLUTION_REPLACE); putSFTPRunner.setProperty(SFTPTransfer.CREATE_DIRECTORY, "true"); putSFTPRunner.setProperty(SFTPTransfer.DATA_TIMEOUT, "30 sec"); putSFTPRunner.setValidateExpressionUsage(false); }
@Before public void setup(){ getSFTPRunner = TestRunners.newTestRunner(GetSFTP.class); getSFTPRunner.setProperty(SFTPTransfer.HOSTNAME, "localhost"); getSFTPRunner.setProperty(SFTPTransfer.PORT, Integer.toString(sshTestServer.getSSHPort())); getSFTPRunner.setProperty(SFTPTransfer.USERNAME, sshTestServer.getUsername()); getSFTPRunner.setProperty(SFTPTransfer.PASSWORD, sshTestServer.getPassword()); getSFTPRunner.setProperty(SFTPTransfer.STRICT_HOST_KEY_CHECKING, "false"); getSFTPRunner.setProperty(SFTPTransfer.DATA_TIMEOUT, "30 sec"); getSFTPRunner.setProperty(SFTPTransfer.REMOTE_PATH, "/"); getSFTPRunner.removeProperty(SFTPTransfer.FILE_FILTER_REGEX); getSFTPRunner.setProperty(SFTPTransfer.PATH_FILTER_REGEX, ""); getSFTPRunner.setProperty(SFTPTransfer.POLLING_INTERVAL, "60 sec"); getSFTPRunner.setProperty(SFTPTransfer.RECURSIVE_SEARCH, "false"); getSFTPRunner.setProperty(SFTPTransfer.IGNORE_DOTTED_FILES, "true"); getSFTPRunner.setProperty(SFTPTransfer.DELETE_ORIGINAL, "true"); getSFTPRunner.setProperty(SFTPTransfer.MAX_SELECTS, "100"); getSFTPRunner.setProperty(SFTPTransfer.REMOTE_POLL_BATCH_SIZE, "5000"); getSFTPRunner.setValidateExpressionUsage(false); }