Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Problem with Tycho 1.7.0 / JUnit 5 / Java 11

You could try packagin jar (with proper dependencies inside pom), a suitable classloader would be for example the "this.getClass().getClassloader()" but that might depend on your overall needs. You can also try set the context-classloader but on the long term it might be required that xtext uses proper loading mechanisms.

In general, all code that relies on "a default global classloader" is subject to fail in several environments (applet, J2EE, Web...), not only OSGi.

Am 18.05.20 um 10:49 schrieb Christian Dietrich:
but indeed. problem can also be found when running as plugin test

question: if i remember correct there was a posibility to run tests as
pure maven surefire tests instead of tycho-surefire plugin tests, but i
could not find it at a first glance. or do i remember wrong?


Am 18.05.20 um 10:32 schrieb Christoph Läubrich:
In general, using ServiceLoader without specific classloader is
problematic in OSGi. So the first thing to try is passing a suitable

Am 18.05.20 um 10:20 schrieb Stefan Kapferer:
Hi there

Can anyone help me with the problem described here

Have a problem running JUnit tests (Xtext tests) with Maven and Tycho
under Java 11.

As you can see here,
Christian thinks it is a bug in Tycho.

He provided a simple unit test to reproduce the problem:

/package org.xtext.example.mydsl.tests;//
//import java.util.ServiceLoader;//
//import org.eclipse.xtext.ISetup;//
//import org.eclipse.xtext.xbase.lib.IterableExtensions;//
//import org.junit.Assert;//
//import org.junit.jupiter.api.BeforeEach;//
//import org.junit.jupiter.api.Test;//
//public class DemoTest {//
//public void setup() {//
//ServiceLoader<ISetup> sl = ServiceLoader.<ISetup>load(ISetup.class);//
//public void test02_openFile() {//

I also attached a sample project there, where the unit tests fail
with Maven and Tycho. The tests however run perfectly fine within

Does someone here know what the problem could be or does know a

Thanks for your help and best regards,


tycho-user mailing list
To unsubscribe from this list, visit

tycho-user mailing list
To unsubscribe from this list, visit

Back to the top