You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2015/04/29 22:14:33 UTC

[11/13] incubator-nifi git commit: NIFI-533: Fixed bug in unit test that caused flowfiles to be evaluated in arbitrary order

NIFI-533: Fixed bug in unit test that caused flowfiles to be evaluated in arbitrary order


Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/946fd7ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/946fd7ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/946fd7ce

Branch: refs/heads/develop
Commit: 946fd7ce09c8e5d7224cf8da178eb2189a7a749e
Parents: 591b143
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Apr 29 15:15:45 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Wed Apr 29 15:15:45 2015 -0400

----------------------------------------------------------------------
 .../nifi/processors/hadoop/TestListHDFS.java    | 40 ++++++++++----------
 1 file changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/946fd7ce/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java b/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java
index 499fd51..c0b7c1e 100644
--- a/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java
+++ b/nifi/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java
@@ -25,7 +25,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.URI;
 import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
@@ -191,12 +191,12 @@ public class TestListHDFS {
         }
 
         @Override
-        protected FileSystem getFileSystem(Configuration config) throws IOException {
+        protected FileSystem getFileSystem(final Configuration config) throws IOException {
             return fileSystem;
         }
 
         @Override
-        protected void persistLocalState(String directory, String serializedState) throws IOException {
+        protected void persistLocalState(final String directory, final String serializedState) throws IOException {
             super.persistLocalState(directory, serializedState);
             localStateSaved = true;
         }
@@ -209,7 +209,7 @@ public class TestListHDFS {
         public void addFileStatus(final Path parent, final FileStatus child) {
             Set<FileStatus> children = fileStatuses.get(parent);
             if ( children == null ) {
-                children = new HashSet<>();
+                children = new LinkedHashSet<>();
                 fileStatuses.put(parent, children);
             }
 
@@ -233,32 +233,32 @@ public class TestListHDFS {
         }
 
         @Override
-        public FSDataInputStream open(Path f, int bufferSize) throws IOException {
+        public FSDataInputStream open(final Path f, final int bufferSize) throws IOException {
             return null;
         }
 
         @Override
-        public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException {
+        public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException {
             return null;
         }
 
         @Override
-        public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException {
+        public FSDataOutputStream append(final Path f, final int bufferSize, final Progressable progress) throws IOException {
             return null;
         }
 
         @Override
-        public boolean rename(Path src, Path dst) throws IOException {
+        public boolean rename(final Path src, final Path dst) throws IOException {
             return false;
         }
 
         @Override
-        public boolean delete(Path f, boolean recursive) throws IOException {
+        public boolean delete(final Path f, final boolean recursive) throws IOException {
             return false;
         }
 
         @Override
-        public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException {
+        public FileStatus[] listStatus(final Path f) throws FileNotFoundException, IOException {
             final Set<FileStatus> statuses = fileStatuses.get(f);
             if ( statuses == null ) {
                 return new FileStatus[0];
@@ -268,7 +268,7 @@ public class TestListHDFS {
         }
 
         @Override
-        public void setWorkingDirectory(Path new_dir) {
+        public void setWorkingDirectory(final Path new_dir) {
 
         }
 
@@ -278,12 +278,12 @@ public class TestListHDFS {
         }
 
         @Override
-        public boolean mkdirs(Path f, FsPermission permission) throws IOException {
+        public boolean mkdirs(final Path f, final FsPermission permission) throws IOException {
             return false;
         }
 
         @Override
-        public FileStatus getFileStatus(Path f) throws IOException {
+        public FileStatus getFileStatus(final Path f) throws IOException {
             return null;
         }
 
@@ -291,7 +291,7 @@ public class TestListHDFS {
 
 
     private class MockCacheClient extends AbstractControllerService implements DistributedMapCacheClient {
-        private ConcurrentMap<Object, Object> values = new ConcurrentHashMap<>();
+        private final ConcurrentMap<Object, Object> values = new ConcurrentHashMap<>();
         private boolean failOnCalls = false;
 
         private void verifyNotFail() throws IOException {
@@ -301,7 +301,7 @@ public class TestListHDFS {
         }
 
         @Override
-        public <K, V> boolean putIfAbsent(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer) throws IOException {
+        public <K, V> boolean putIfAbsent(final K key, final V value, final Serializer<K> keySerializer, final Serializer<V> valueSerializer) throws IOException {
             verifyNotFail();
             final Object retValue = values.putIfAbsent(key, value);
             return (retValue == null);
@@ -309,26 +309,26 @@ public class TestListHDFS {
 
         @Override
         @SuppressWarnings("unchecked")
-        public <K, V> V getAndPutIfAbsent(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer, Deserializer<V> valueDeserializer) throws IOException {
+        public <K, V> V getAndPutIfAbsent(final K key, final V value, final Serializer<K> keySerializer, final Serializer<V> valueSerializer, final Deserializer<V> valueDeserializer) throws IOException {
             verifyNotFail();
             return (V) values.putIfAbsent(key, value);
         }
 
         @Override
-        public <K> boolean containsKey(K key, Serializer<K> keySerializer) throws IOException {
+        public <K> boolean containsKey(final K key, final Serializer<K> keySerializer) throws IOException {
             verifyNotFail();
             return values.containsKey(key);
         }
 
         @Override
-        public <K, V> void put(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer) throws IOException {
+        public <K, V> void put(final K key, final V value, final Serializer<K> keySerializer, final Serializer<V> valueSerializer) throws IOException {
             verifyNotFail();
             values.put(key, value);
         }
 
         @Override
         @SuppressWarnings("unchecked")
-        public <K, V> V get(K key, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException {
+        public <K, V> V get(final K key, final Serializer<K> keySerializer, final Deserializer<V> valueDeserializer) throws IOException {
             verifyNotFail();
             return (V) values.get(key);
         }
@@ -338,7 +338,7 @@ public class TestListHDFS {
         }
 
         @Override
-        public <K> boolean remove(K key, Serializer<K> serializer) throws IOException {
+        public <K> boolean remove(final K key, final Serializer<K> serializer) throws IOException {
             verifyNotFail();
             values.remove(key);
             return true;