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

ShamrockUnitTest not Windows friendly #479

Merged
merged 5 commits into from
Jan 18, 2019
Merged

ShamrockUnitTest not Windows friendly #479

merged 5 commits into from
Jan 18, 2019

Conversation

jeffmaury
Copy link
Contributor

See #478
Signed-off-by: Jeff MAURY jmaury@redhat.com

URL resource = testClass.getClassLoader().getResource(classFileName);

String path = resource.getPath();
try {
Path path = Paths.get(resource.toURI());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rationale behind not using getPath() anymore?

Also, it seems there are some indentation issues: we indent with 4 spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rationale is that the Path API provides a way to transform an URL(URI) to a file system path where we were trying do do it with string manipulations which was erroneous on Windows.

@gsmet
Copy link
Member

gsmet commented Jan 14, 2019

CI fails with the following error:

2019-01-12T08:17:49.0042095Z [ERROR] initializationError(org.jboss.shamrock.arc.test.SimpleBeanTest)  Time elapsed: 0.007 s  <<< ERROR!
2019-01-12T08:17:49.0099168Z java.lang.ExceptionInInitializerError
2019-01-12T08:17:49.0099643Z 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2019-01-12T08:17:49.0099989Z 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2019-01-12T08:17:49.0100313Z 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2019-01-12T08:17:49.0100634Z 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
2019-01-12T08:17:49.0100936Z 	at java.lang.Class.newInstance(Class.java:442)
2019-01-12T08:17:49.0101242Z 	at org.jboss.shamrock.runner.RuntimeRunner.run(RuntimeRunner.java:114)
2019-01-12T08:17:49.0101696Z 	at org.jboss.shamrock.test.ShamrockUnitTest.doSetup(ShamrockUnitTest.java:105)
2019-01-12T08:17:49.0102108Z 	at org.jboss.shamrock.test.ShamrockUnitTest.<init>(ShamrockUnitTest.java:66)
2019-01-12T08:17:49.0102539Z 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2019-01-12T08:17:49.0102831Z 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2019-01-12T08:17:49.0103254Z 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2019-01-12T08:17:49.0103668Z 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
2019-01-12T08:17:49.0104183Z 	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
2019-01-12T08:17:49.0104463Z 	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
2019-01-12T08:17:49.0104717Z 	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
2019-01-12T08:17:49.0109764Z 	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
2019-01-12T08:17:49.0110172Z 	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
2019-01-12T08:17:49.0110437Z 	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
2019-01-12T08:17:49.0110696Z 	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:362)
2019-01-12T08:17:49.0110942Z 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
2019-01-12T08:17:49.0111205Z 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
2019-01-12T08:17:49.0111639Z 	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
2019-01-12T08:17:49.0111831Z 	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
2019-01-12T08:17:49.0112388Z 	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
2019-01-12T08:17:49.0112565Z 	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
2019-01-12T08:17:49.0112777Z 	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
2019-01-12T08:17:49.0113171Z Caused by: java.lang.RuntimeException: Failed to start shamrock
2019-01-12T08:17:49.0113478Z 	at org.jboss.shamrock.runner.ApplicationImpl.<clinit>(Unknown Source)
2019-01-12T08:17:49.0113646Z 	... 26 more
2019-01-12T08:17:49.0113846Z Caused by: java.lang.NoClassDefFoundError: io/smallrye/config/inject/ConfigProducer_Bean
2019-01-12T08:17:49.0114026Z 	at org.jboss.protean.arc.setup.Default_ComponentsProvider.getComponents(Unknown Source)
2019-01-12T08:17:49.0114212Z 	at org.jboss.protean.arc.ArcContainerImpl.<init>(ArcContainerImpl.java:83)
2019-01-12T08:17:49.0114378Z 	at org.jboss.protean.arc.Arc.initialize(Arc.java:34)
2019-01-12T08:17:49.0114581Z 	at org.jboss.shamrock.arc.runtime.ArcDeploymentTemplate.getContainer(ArcDeploymentTemplate.java:48)
2019-01-12T08:17:49.0114760Z 	at org.jboss.shamrock.deployment.steps.ArcAnnotationProcessor$build3.deploy(Unknown Source)
2019-01-12T08:17:49.0114944Z 	... 27 more
2019-01-12T08:17:49.0115127Z Caused by: java.lang.ClassNotFoundException: io.smallrye.config.inject.ConfigProducer_Bean
2019-01-12T08:17:49.0115324Z 	at org.jboss.shamrock.runner.RuntimeClassLoader.findClass(RuntimeClassLoader.java:256)
2019-01-12T08:17:49.0115570Z 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
2019-01-12T08:17:49.0115765Z 	at org.jboss.shamrock.runner.RuntimeClassLoader.loadClass(RuntimeClassLoader.java:157)
2019-01-12T08:17:49.0116095Z 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
@stuartwdouglas stuartwdouglas merged commit 79c2b29 into quarkusio:master Jan 18, 2019
@stuartwdouglas stuartwdouglas added this to the 0.7.0 milestone Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants