-
Notifications
You must be signed in to change notification settings - Fork 387
Adding unit tests for RootedFileSystemProvider impl of java.nio.file.… #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding unit tests for RootedFileSystemProvider impl of java.nio.file.… #25
Conversation
…spi.FileSystemProvider
|
I've also confirmed that all tests pass with the new changes committed by @lgoldstein. |
| */ | ||
| public class AssertableFile extends BaseTestSupport { | ||
|
|
||
| public AssertableFile() { super(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move superclass call to separate line
|
Very nice - a few minor issues to fix - once you do that and re-post I will be happy to merge your contribution into the master branch. |
|
|
||
| public static Boolean isNonEmpty(byte [] bytes) { | ||
| Boolean cond = bytes != null && bytes.length > 0; | ||
| assertTrue("bytes are non empty", cond); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please use byte[] (no space)
- Please use org.apache.sshd.common.util.NumberUtils.isEmpty(bytes)
|
Thanks for the quick review Lyor. Will post up an update tomorrow. |
|
@lgoldstein I pushed up fixes per your comments. Tested with backing out the the fix and found the fail(...) messages were very helpful. Thanks for that suggestion. |
|
Committed and pushed to the master branch - congratulations and thanks for your contribution. A few minor issues for future reference:
In the future, please run our mvn clean install as it applies the checkstyle and rat plugins as well. In general, we require the license/copyright notice at the top of the file (see other files in the project for the content). As far as style goes - we use
These are just the main ones - when in doubt, look at other code and copy the style.All these can be easily configured in Eclipse and applied as code style as well as automatic save actions. |
|
Please close the request since merged into main branch |
|
Thanks @lgoldstein will keep in mind for future reference. |
Per https://issues.apache.org/jira/browse/SSHD-605, these unit tests test the RootedFileSystemProvider (mirroring the API) to validate that FS actions taken outside of RootedFileSystem#getRoot() throw an InvalidPathException.