Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Junit5 tests no longer found with Tycho 2.2

Tried to reproduce but receiving another error during the test run:

org.apache.maven.surefire.util.SurefireReflectionException:
java.util.ServiceConfigurationError:
org.junit.platform.engine.TestEngine:
org.junit.jupiter.engine.JupiterTestEngine not a subtype


!ENTRY org.eclipse.osgi 4 0 2021-02-16 17:13:24.863
!MESSAGE Application error
!STACK 1
org.apache.maven.surefire.util.SurefireReflectionException:
java.util.ServiceConfigurationError:
org.junit.platform.engine.TestEngine:
org.junit.jupiter.engine.JupiterTestEngine not a subtype
at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:139)
at org.apache.maven.surefire.booter.SurefireReflector.instantiateProvider(SurefireReflector.java:265)
at org.apache.maven.surefire.booter.ProviderFactory.createProvider(ProviderFactory.java:118)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:83)
at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:116)
at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.start(HeadlessTestApplication.java:23)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
at org.eclipse.equinox.launcher.Main.main(Main.java:1434)
Caused by: java.util.ServiceConfigurationError:
org.junit.platform.engine.TestEngine:
org.junit.jupiter.engine.JupiterTestEngine not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:591)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1238)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1266)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386)
at java.base/java.lang.Iterable.forEach(Iterable.java:74)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:95)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:75)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.<init>(JUnitPlatformProvider.java:86)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:135)
... 18 more

On Tue, Feb 16, 2021 at 10:19 AM Sebastian Zarnekow
<sebastian.zarnekow@xxxxxxxxx> wrote:
>
> Hello Felix,
>
> you may want to add your finding to https://bugs.eclipse.org/bugs/show_bug.cgi?id=570521 - it's probably worthy to collect all the evidence at a central location in Bugzilla.
>
> Best
> Sebastian
>
>
>
> On Tue, Feb 16, 2021 at 9:56 AM Lars Vogel <lars.vogel@xxxxxxxxxxx> wrote:
>>
>> Felix, I had issues in the past with tests not  being defined as "public".
>>
>> AFAIK JUnit 5 does recommend leaving out the public modifier but IIIRC
>> Tycho did not pick up tests using the default access modifier. I try
>> later if that is still the case for my example tests.
>>
>> Best regards, Lars
>>
>>
>> On Mon, Feb 15, 2021 at 2:50 PM Felix Dorner <felix.dorner@xxxxxxxxx> wrote:
>> >
>> > There's so many parameters I have a hard time trying to design a minimal test. I'm debugging it atm, and  - I have not a real clue about many things in the stack - it somehow enters the junit vintage engine trying to treat it as a junit 4 test suite or something. I'll keep trying, and sorry if this stacktrace is totally useless to you, but maybe you can read between the lines:
>> >
>> > Thread [WorkbenchTestable] (Suspended)
>> > DefensiveAllDefaultPossibilitiesBuilder(AllDefaultPossibilitiesBuilder).runnerForClass(Class<?>) line: 36
>> > DefensiveAllDefaultPossibilitiesBuilder.runnerForClass(Class<?>) line: 57
>> > DefensiveAllDefaultPossibilitiesBuilder(RunnerBuilder).safeRunnerForClass(Class<?>) line: 70
>> > ClassSelectorResolver.resolveTestClass(Class<?>, Context) line: 66
>> > ClassSelectorResolver.resolve(ClassSelector, SelectorResolver$Context) line: 47
>> > EngineDiscoveryRequestResolution.lambda$resolve$2(DiscoverySelector, SelectorResolver) line: 134
>> > 156049556.apply(Object) line: not available
>> > ReferencePipeline$3$1.accept(P_OUT) line: 195
>> > ArrayList$ArrayListSpliterator.tryAdvance(Consumer<? super E>) line: 1632
>> > ReferencePipeline$Head<E_IN,E_OUT>(ReferencePipeline<P_IN,P_OUT>).forEachWithCancel(Spliterator<P_OUT>, Sink<P_OUT>) line: 127
>> > ReferencePipeline$2(AbstractPipeline<E_IN,E_OUT,S>).copyIntoWithCancel(Sink<P_IN>, Spliterator<P_IN>) line: 502
>> > ReferencePipeline$2(AbstractPipeline<E_IN,E_OUT,S>).copyInto(Sink<P_IN>, Spliterator<P_IN>) line: 488
>> > ReferencePipeline$2(AbstractPipeline<E_IN,E_OUT,S>).wrapAndCopyInto(S, Spliterator<P_IN>) line: 474
>> > FindOps$FindOp<T,O>.evaluateSequential(PipelineHelper<T>, Spliterator<S>) line: 150
>> > ReferencePipeline$2(AbstractPipeline<E_IN,E_OUT,S>).evaluate(TerminalOp<E_OUT,R>) line: 234
>> > ReferencePipeline$2(ReferencePipeline<P_IN,P_OUT>).findFirst() line: 543
>> > EngineDiscoveryRequestResolution.resolve(DiscoverySelector, Function<SelectorResolver,Resolution>) line: 185
>> > EngineDiscoveryRequestResolution.resolve(DiscoverySelector) line: 125
>> > EngineDiscoveryRequestResolution.resolveCompletely(DiscoverySelector) line: 91
>> > EngineDiscoveryRequestResolution.run() line: 82
>> > EngineDiscoveryRequestResolver<T>.resolve(EngineDiscoveryRequest, T) line: 113
>> > VintageDiscoverer.discover(EngineDiscoveryRequest, UniqueId) line: 44
>> > VintageTestEngine.discover(EngineDiscoveryRequest, UniqueId) line: 63
>> > DefaultLauncher.discoverEngineRoot(TestEngine, LauncherDiscoveryRequest) line: 181
>> > DefaultLauncher.discoverRoot(LauncherDiscoveryRequest, String) line: 168
>> > DefaultLauncher.discover(LauncherDiscoveryRequest) line: 124
>> > TestPlanScannerFilter.accept(Class) line: 56
>> > DefaultScanResult.applyFilter(ScannerFilter, ClassLoader) line: 102
>> > JUnitPlatformProvider.scanClasspath() line: 143
>> > JUnitPlatformProvider.invoke(Object) line: 124
>> > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
>> > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
>> > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
>> > Method.invoke(Object, Object...) line: 566
>> > ReflectionUtils.invokeMethodWithArray2(Object, Method, Object...) line: 206
>> > ProviderFactory$ProviderProxy.invoke(Object) line: 161
>> > ProviderFactory.invokeProvider(Object, ClassLoader, Object, ProviderConfiguration, boolean, StartupConfiguration, boolean) line: 84
>> > OsgiSurefireBooter.run(String[]) line: 116
>> > UITestApplication(AbstractUITestApplication).runTests() line: 46
>> >
>> >
>> >
>> > On Mon, Feb 15, 2021 at 1:25 PM Aleksandar Kurtakov <akurtako@xxxxxxxxxx> wrote:
>> >>
>> >>
>> >>
>> >> On Mon, Feb 15, 2021 at 2:02 PM Felix Dorner <felix.dorner@xxxxxxxxx> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> I am migrating from tycho 1.7 to 2.2. In 1.7 my junit 5 tests run fine, but for 2.2 I get "No tests found". I'm not sure how the test finding thing goes on but the surefire.properties file which is passed to the test runner application totally finds test classes:
>> >>>
>> >>> __provider.tc.1=...
>> >>> __provider.tc.0=...
>> >>>
>> >>
>> >> Can you share a minimal reproducer?  I've heard of such cases and every time it was different missing piece but these should be fixed now so I really need a way to see what goes wrong in your case.
>> >>
>> >>>
>> >>> any ideas?
>> >>> Thanks,
>> >>> Felix
>> >>>
>> >>> --
>> >>> Linux. The choice of a GNU generation.
>> >>> _______________________________________________
>> >>> tycho-user mailing list
>> >>> tycho-user@xxxxxxxxxxx
>> >>> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user
>> >>
>> >>
>> >>
>> >> --
>> >> Aleksandar Kurtakov
>> >> Red Hat Eclipse Team
>> >> _______________________________________________
>> >> tycho-user mailing list
>> >> tycho-user@xxxxxxxxxxx
>> >> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user
>> >
>> >
>> >
>> > --
>> > Linux. The choice of a GNU generation.
>> > _______________________________________________
>> > tycho-user mailing list
>> > tycho-user@xxxxxxxxxxx
>> > To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user
>>
>>
>>
>> --
>> Eclipse Platform project co-lead
>> CEO vogella GmbH
>>
>> Haindaalwisch 17a, 22395 Hamburg
>> Amtsgericht Hamburg: HRB 127058
>> Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
>> USt-IdNr.: DE284122352
>> Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com
>> _______________________________________________
>> tycho-user mailing list
>> tycho-user@xxxxxxxxxxx
>> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user
>
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user



-- 
Eclipse Platform project co-lead
CEO vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com


Back to the top