junit 4 "unrooted" tests with parametrized tests

253 views
Skip to first unread message

open fokus

unread,
Oct 24, 2014, 3:12:02 PM10/24/14
to bndtool...@googlegroups.com
I am using the latest bndtools version and linux.

I use parametrized unit tests like so:

@RunWith(Parameterized.class)
public class TestBundleFilter {
    @Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][] {
            { 10, 1 } ,
            { 10, 1 }
            });
        }
   
    public TestBundleFilter(int i, int j) {
        ...
    }

@Test
public void testme() { .. }

When I right-click on a run descriptor -> run as bnd osgi test launcher (junit) the eclipse junit view
shows me an "Unrooted Tests" entry without the test method name, If there are several test methods, only one is run.

I tried several junit build options, including junit 4.11 that comes with bnd tools, springsource junit and the eclipse integrated JUnit4. Nothing works.
 I don't have this problem with the normal ( ie not running in an osgi container ) unit tests.

According to google, this problem has been around since junit 3 but, as I said , I don't encounter it using eclipse luna when run as a non-osgi junit test.

Does anybody encountered this problem ( making parametrized effecitvely unusable ) ?

Thanks
Peter

Peter Kriens

unread,
Oct 25, 2014, 5:55:06 AM10/25/14
to bndtool...@googlegroups.com
I do not think you can use @RunWith & the OSGi tests. I have no idea how that interacts with the special OSGi runner we have in the biz.aQute.junit tester ... 

You can file a bug on this but we will need to find a person that is willing to figure out what to do about this. Pull requests welcome ...

Kind regards,

Peter Kriens

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

open fokus

unread,
Oct 25, 2014, 2:05:17 PM10/25/14
to bndtool...@googlegroups.com
Thanks Peter

junit 4 "unrooted" tests with parametrized tests #661


Best regards

Peter

Reply all
Reply to author
Forward
0 new messages