[
https://issues.apache.org/jira/browse/NIFI-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15865575#comment-15865575
]
ASF GitHub Bot commented on NIFI-3442:
--------------------------------------
Github user trixpan commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1474#discussion_r101007689
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutFTP.java
---
@@ -0,0 +1,90 @@
+/*
+ * 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.processors.standard;
+
+import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.processors.standard.util.FTPTransfer;
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockftpserver.fake.FakeFtpServer;
+import org.mockftpserver.fake.UserAccount;
+import org.mockftpserver.fake.filesystem.DirectoryEntry;
+import org.mockftpserver.fake.filesystem.FileSystem;
+import org.mockftpserver.fake.filesystem.WindowsFakeFileSystem;
+
+import java.io.FileInputStream;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+public class TestPutFTP {
+
+ final FakeFtpServer fakeFtpServer = new FakeFtpServer();
+ final String username = "nifi-ftp-user";
+ final String password = "Test test test chocolate";
+ int ftpPort;
+
+ @Before
+ public void setUp() throws Exception {
+ fakeFtpServer.setServerControlPort(0);
+ fakeFtpServer.addUserAccount(new UserAccount(username, password,
"c:\\data"));
+
+ FileSystem fileSystem = new WindowsFakeFileSystem();
+ fileSystem.add(new DirectoryEntry("c:\\data"));
+ fakeFtpServer.setFileSystem(fileSystem);
+
+ fakeFtpServer.start();
+
+ ftpPort = fakeFtpServer.getServerControlPort();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ fakeFtpServer.stop();
+ }
+
+ @Test
+ public void testValidators() {
+
+ }
+
+ @Test
+ public void BasicFileUpload() throws IOException {
--- End diff --
fixed
> FTPTransfer tries to evaluate PORT as expression language, although property
> doesn't support EL
> -----------------------------------------------------------------------------------------------
>
> Key: NIFI-3442
> URL: https://issues.apache.org/jira/browse/NIFI-3442
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 0.7.1, 1.1.1
> Reporter: Andre
> Assignee: Andre
>
> while crafting test coverage for PutFTP I noticed the following error:
> java.lang.AssertionError: java.lang.IllegalStateException: Attempting to
> Evaluate Expressions but PropertyDescriptor[Port] indicates that the
> Expression Language is not supported. If you realize that this is the case
> and do not want this error to occur, it can be disabled by calling
> TestRunner.setValidateExpressionUsage(false)
> Root cause seems to be a disconnect between the property builder (EL = false)
> and the attempt to evaluate the property as part of client.connect
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)