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

In general, using ServiceLoader without specific classloader is problematic in OSGi. So the first thing to try is passing a suitable classloader.


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

Can anyone help me with the problem described here https://www.eclipse.org/forums/index.php/m/1827553/?

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

As you can see here https://www.eclipse.org/forums/index.php?t=msg&th=1103807&goto=1827558&#msg_1827558, 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 {//
////
//@BeforeEach//
//public void setup() {//
//ServiceLoader<ISetup> sl = ServiceLoader.<ISetup>load(ISetup.class);//
//Assert.assertFalse(IterableExtensions.isEmpty(sl));//
//}//
////
//@Test//
//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 Eclipse.

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

Thanks for your help and best regards,

Stefan






_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user



Back to the top