Replies: 1 comment
-
@ebresie, I have not tried running it on Windows. I run it locally on the Mac and using travis for every release. The only local resource issues are loading of actual image files, the tests for which I disable by default and only enable when running locally. The test spec files are in resources and each resource directory has a file named for the package to which this resouce directory belongs, it contains the directory prefix for the location to allow generating a fully qualified class name for the java test file. However, this is only used to produce error messages in tests that the IDE (IntelliJ) will display as links to files. The resource files are loaded as Java resources. The files are loaded from resources using an absolute resource path, for example It seems that when running tests on your setup, the test resources are not copied to the build directory for the test run. I could be wrong but it is something related to the test build. |
Beta Was this translation helpful? Give feedback.
-
I was running tests on recent codebase and getting failures like the below relating to missing test resource files.
For an example, the missing files listing path like C:\com\vladsch\flexmark\test\util\core_formatter_no_blanklines_spec.md is not in any way where my code or the test resources are located.
I find the given file located in the ..\flexmark-core-tests\src\test\resources not in any way located srcs\test\java\com\vladsch\flexmark\test\util\core_formatter_no_blanklines_spec.md showing as failing in the test.
Not sure if this is an issue due to my environment (Windows 11, mvn 3.8.6, Java 11), if it's a true failure (maybe due to reorganization), or some kind of classpath issue.
Is anyone else having similar problems?
T E S T S
Running com.vladsch.flexmark.core.test.util.formatter.ComboCoreFormatterNoBlankLinesSpecTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.134 sec <<< FAILURE!
initializationError(com.vladsch.flexmark.core.test.util.formatter.ComboCoreFormatterNoBlankLinesSpecTest) Time elapsed: 0.008 sec <<< FAILURE!
java.lang.AssertionError: Resource path: 'C:\com\vladsch\flexmark\test\util\core_formatter_no_blanklines_spec.md' not found.
at com.vladsch.flexmark.test.util.TestUtils.getSpecResourceFileUrl(TestUtils.java:557)
at com.vladsch.flexmark.test.util.spec.ResourceLocation.of(ResourceLocation.java:116)
at com.vladsch.flexmark.core.test.util.formatter.ComboCoreFormatterNoBlankLinesSpecTest.(ComboCoreFormatterNoBlankLinesSpecTest.java:16)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.runners.Parameterized$RunnersFactory.allParameters(Parameterized.java:424)
at org.junit.runners.Parameterized$RunnersFactory.(Parameterized.java:375)
at org.junit.runners.Parameterized$RunnersFactory.(Parameterized.java:360)
at org.junit.runners.Parameterized.(Parameterized.java:303)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28)
at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Running com.vladsch.flexmark.core.test.util.formatter.ComboCoreFormatterSpecTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0 sec <<< FAILURE!
initializationError(com.vladsch.flexmark.core.test.util.formatter.ComboCoreFormatterSpecTest) Time elapsed: 0 sec <<< FAILURE!
java.lang.AssertionError: Resource path: 'C:\com\vladsch\flexmark\test\util\core_formatter_spec.md' not found.
at com.vladsch.flexmark.test.util.TestUtils.getSpecResourceFileUrl(TestUtils.java:557)
at com.vladsch.flexmark.test.util.spec.ResourceLocation.of(ResourceLocation.java:116)
at com.vladsch.flexmark.core.test.util.formatter.ComboCoreFormatterSpecTest.(ComboCoreFormatterSpecTest.java:12)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.runners.Parameterized$RunnersFactory.allParameters(Parameterized.java:424)
at org.junit.runners.Parameterized$RunnersFactory.(Parameterized.java:375)
at org.junit.runners.Parameterized$RunnersFactory.(Parameterized.java:360)
at org.junit.runners.Parameterized.(Parameterized.java:303)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28)
at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Running com.vladsch.flexmark.core.test.util.formatter.ComboCoreTranslationFormatterSpecTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec <<< FAILURE!
Beta Was this translation helpful? Give feedback.
All reactions