Tests for filesystem-nio

* Split tests into integration and unit tests
* Rewritten and completed unit tests
** By introducing a layer around Files.* to allow mocking of
NIO-Operations
** And introducing a factory to allow mocking of constructors
* Integration tests ignored temporarily
** TODO reduce amount of testcases and enable
This commit is contained in:
Markus Kreusch
2016-01-06 01:51:46 +01:00
parent a05fa19de4
commit 801253aa27
35 changed files with 3450 additions and 1632 deletions
@@ -33,4 +33,17 @@ public interface Node {
Instant lastModified() throws UncheckedIOException;
/**
* @return the {@link FileSystem} this Node belongs to
*/
default FileSystem fileSystem() {
return parent() //
.map(Node::fileSystem) //
.orElseGet(() -> (FileSystem) this);
}
default boolean belongsToSameFilesystem(Node other) {
return fileSystem() == other.fileSystem();
}
}
@@ -8,7 +8,7 @@ import java.util.Iterator;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
public final class PathResolver {
final class PathResolver {
private static final String DOT = ".";
private static final String DOTDOT = "..";