Investigate TreeWalkerTest.testDestroyNonExistingCache failure on Windows. #1496

This commit is contained in:
Roman Ivanov 2015-07-29 20:56:09 -07:00
parent f8bd84c6e3
commit b82be7c60f
2 changed files with 3 additions and 7 deletions

View File

@ -1081,8 +1081,6 @@
<regex><pattern>.*.ConfigurationLoader\$.*</pattern><branchRate>65</branchRate><lineRate>84</lineRate></regex>
<regex><pattern>.*.DefaultLogger</pattern><branchRate>75</branchRate><lineRate>76</lineRate></regex>
<regex><pattern>.*.PackageNamesLoader</pattern><branchRate>78</branchRate><lineRate>72</lineRate></regex>
<!-- till https://github.com/checkstyle/checkstyle/issues/1496 -->
<regex><pattern>.*.PropertyCacheFile</pattern><branchRate>87</branchRate><lineRate>98</lineRate></regex>
<regex><pattern>.*.TreeWalker</pattern><branchRate>94</branchRate><lineRate>91</lineRate></regex>
<regex><pattern>.*.checks.AbstractOptionCheck</pattern><branchRate>100</branchRate><lineRate>80</lineRate></regex>

View File

@ -132,13 +132,11 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
public void testDestroyNonExistingCache() throws Exception {
final TreeWalker treeWalker = new TreeWalker();
treeWalker.configure(new DefaultConfiguration("default config"));
treeWalker.setCacheFile("/invalid");
//https://support.microsoft.com/en-us/kb/177506
treeWalker.setCacheFile("/:invalid");
try {
treeWalker.destroy();
// till
if (!System.getProperty("os.name").startsWith("Windows")) {
fail();
}
fail();
}
catch (IllegalStateException ex) {
assertTrue(ex.getCause() instanceof IOException);