builder:CheckstyleWriterTest: use system's file separator
This commit is contained in:
parent
df4c951142
commit
4de68a84ce
1 changed files with 6 additions and 2 deletions
|
@ -30,6 +30,8 @@ public class CheckstyleWriterTest {
|
||||||
|
|
||||||
private static final String TEMPLATE = "C:%s\nTW:%s";
|
private static final String TEMPLATE = "C:%s\nTW:%s";
|
||||||
|
|
||||||
|
private static final String FILE_SEPARATOR = System.getProperty("file.separator");
|
||||||
|
|
||||||
private CheckstyleWriter checkstyleWriter;
|
private CheckstyleWriter checkstyleWriter;
|
||||||
|
|
||||||
private OutputProperties outputProperties;
|
private OutputProperties outputProperties;
|
||||||
|
@ -181,9 +183,11 @@ public class CheckstyleWriterTest {
|
||||||
@Test
|
@Test
|
||||||
public void throwRteIfErrorWritingFile() throws Exception {
|
public void throwRteIfErrorWritingFile() throws Exception {
|
||||||
//given
|
//given
|
||||||
outputProperties.setDirectory(Paths.get("/../imaginary"));
|
final String imaginary = String.join(FILE_SEPARATOR, "", "..", "imaginary");
|
||||||
|
outputProperties.setDirectory(Paths.get(imaginary));
|
||||||
exception.expect(RuntimeException.class);
|
exception.expect(RuntimeException.class);
|
||||||
exception.expectMessage("java.nio.file.NoSuchFileException: /../imaginary/checkstyle-LAYOUT.xml");
|
exception.expectMessage(
|
||||||
|
"java.nio.file.NoSuchFileException: " + imaginary + FILE_SEPARATOR + "checkstyle-LAYOUT.xml");
|
||||||
//when
|
//when
|
||||||
checkstyleWriter.run();
|
checkstyleWriter.run();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue