-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bugfix/call single in karate basejs from classpath #1317
Bugfix/call single in karate basejs from classpath #1317
Conversation
…le when packaged in Spring Boot (karatelabs#751 (comment))
…ith loading files from Spring Boot classpath. Making Nashorn lazy-init and synchronized to avoid parallel() test execution concurrency issues (keeping function to allow external override).
I merged this. also did a little more refactoring of one request - can we avoid these 2 lines: ClassLoader cl = this.classLoader != null ? this.classLoader : Resource.class.getClassLoader();
InputStream tempStream = cl.getResourceAsStream(relativePath.replace(FileUtils.CLASSPATH_COLON, "")); if I'm not mistaken, the classLoader will never be null. also, the |
and just FYI - I just came across this: https://github.com/classgraph/classgraph since this area has been so painful - and considering who knows what issues that Java 9 modules / jigsaw will bring - maybe we should just use this. wonder what you think @joelpramos |
@ptrthomas for the first question - Files.newInputStream(path) is exactly where my problem with Spring Boot was. I left the null checks for classloader because I was only able to test in Windows (packaged JAR and via IntelliJ) and docker but couldn't test with other CI/CD tools / Mac. Classgraph seems interesting ... I read through it and will probably be best to use to avoid such problems in the future as there might be other problems with other frameworks. I'll try to set it up during this week. |
ah ok, then fine - if it works it works. yes do look at Classgraph when you get time - an extra JAR dep is worth it |
This reverts commit 0cdaa47.
Description
Thanks for contributing this Pull Request. Make sure that you submit this Pull Request against the
develop
branch of this repository, add a brief description, and tag the relevant issue(s) and PR(s) below.