tests: define equals & hashcode for the MockVirtualFile

To be able to compare two MockVirtualFiles defined by the same path.
This commit is contained in:
Kirill Likhodedov
2019-03-19 11:58:30 +03:00
parent d699847f50
commit 9d6794d239
@@ -126,6 +126,20 @@ public class MockVirtualFile extends VirtualFile {
return VfsUtilCore.toVirtualFileArray(myChildren);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MockVirtualFile file = (MockVirtualFile)o;
return getPath().equals(file.getPath());
}
@Override
public int hashCode() {
return getPath().hashCode();
}
@NotNull
@Override
public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) throws IOException {