Open abelsromero opened 6 years ago
ISSUE: Note: This DOES NOT happen with Java8. When running the test (both IntelliJ and shell) inside a path that has been symlinked some test fail.
CAUSE: Some tests (eg. composed_attributes_should_be_built_as_attributes_map) use this method to locate the target expectedFile file:
composed_attributes_should_be_built_as_attributes_map
expectedFile
String pwd = new File("").getAbsolutePath(); File inputFile = classpath.getResource("rendersample.asciidoc"); String inputPath = inputFile.getPath().substring(pwd.length() + 1); new AsciidoctorInvoker().invoke("-a", "stylesheet=mystyles.css", "-a", "linkcss", inputPath); File expectedFile = new File(inputPath.replaceFirst("\\.asciidoc$", ".html"));
But, when the path is in a symlink, in inputFile you get the real path, but in pwd you get the symlink path. This is what I get:
inputFile
inputFile:C:\home\personal\github\asciidoctorj\asciidoctorj-core\out\test\resources\rendersample.asciidoc pwd: C:\home\bin\.babun\cygwin\home\asalgadr\github\asciidoctorj\asciidoctorj-core
Env: Asciidoctorj: 1.5.6-SNASHOT (master) Windows7 Java 9.0.4
Instead of new File("."), we could also do a classpath.getResource(".") to get the pwd. It works in my local, but I am not sure of repercusions in other OSs, need to test on more machines,
File(".")
classpath.getResource(".")
ISSUE: Note: This DOES NOT happen with Java8. When running the test (both IntelliJ and shell) inside a path that has been symlinked some test fail.
CAUSE: Some tests (eg.
composed_attributes_should_be_built_as_attributes_map
) use this method to locate the targetexpectedFile
file:But, when the path is in a symlink, in
inputFile
you get the real path, but in pwd you get the symlink path. This is what I get:Env: Asciidoctorj: 1.5.6-SNASHOT (master) Windows7 Java 9.0.4