Skip to content
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

Tests are not crossplatform > Windows KO (path filename) #135

Open
adriens opened this issue Sep 19, 2018 · 5 comments
Open

Tests are not crossplatform > Windows KO (path filename) #135

adriens opened this issue Sep 19, 2018 · 5 comments
Assignees
Labels

Comments

@adriens
Copy link
Collaborator

adriens commented Sep 19, 2018

2018-09-19 20_28_28-additional schemacrawler lints - netbeans ide 8 2

@adriens adriens added the tests label Sep 19, 2018
@adriens adriens self-assigned this Sep 19, 2018
@adriens
Copy link
Collaborator Author

adriens commented Sep 19, 2018

In the common testcase that all test extend, we have :

        Path out = Paths.get("target/test_"+this.getClass().getSimpleName()+".json");

See https://stackoverflow.com/questions/9834776/java-nio-file-path-issue

@adriens
Copy link
Collaborator Author

adriens commented Sep 19, 2018

@adriens
Copy link
Collaborator Author

adriens commented Sep 19, 2018

@adriens
Copy link
Collaborator Author

adriens commented Sep 19, 2018

final Path linterConfigsFile = FileSystems.getDefault().getPath("",this.getClass().getClassLoader().getResource(linterName + "/schemacrawler-linter-configs-test.xml").getPath());

@adriens
Copy link
Collaborator Author

adriens commented Sep 19, 2018

Here is a code sample submitted by @schemacrawler :

final Path codePath = Paths.get(testClass.getProtectionDomain()
.getCodeSource().getLocation().toURI()).normalize().toAbsolutePath();

Notice the use of URI which could really do the job !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant