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
Disable/fix some tests on Windows #9811
Conversation
public void testIgnoresHiddenDirectories() throws IOException { | ||
// Setup a /tmp/.svn/ShouldNotBeFound.java folder structure. | ||
File tempDir = Files.createTempDir(); | ||
File nestedHiddenDir = new File(tempDir, ".svn"); | ||
nestedHiddenDir.mkdir(); | ||
File javaFile = new File(nestedHiddenDir, "ShouldNotBeFound.java"); | ||
javaFile.createNewFile(); | ||
// windows needs the hidden attribute to be set on file (not parent directory) | ||
java.nio.file.Files.setAttribute(javaFile.toPath(), "dos:hidden", Boolean.TRUE); |
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.
How about using Files.getFileAttributeView(javaFile.toPath(), DosFileAttributeView.class)
and if it's non-null then call setHidden(true)
?
import java.util.Set; | ||
|
||
/** | ||
* Tests for ResourceAccumulator. | ||
*/ | ||
public class ResourceAccumulatorTest extends TestCase { | ||
|
||
private final static boolean IS_WINDOWS = System.getProperty("os.name") |
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.
Do we have commons-lang3 in the classpath? We could use SystemUtils.IS_OS_WINDOWS
then.
There are two new style warnings, could you fix those? |
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.
LGTM (besides style issues)
Disables tests that fail on Windows because of filesystem specifics, fixes one test.