Hmm, no one ever had to run the same test code with different
configurations? Simple example: Knopflerfish comes with declarative services
built in, the other two frameworks need a bundle for that so the
provisioning list is different. How would you handle that?


On Mon, Apr 19, 2010 at 12:28 PM, Norbert Somlai <nsom...@gmail.com> wrote:
> Hello,
>
> I would like to  run the same tests on different frameworks but with 
> different configuration options (specifically different set of bundles).
> What is the best practice doing that? I tried subclassing tests and it 
> does not work properly for some reason using Pax's JUnit4Runner.
>
> Here is what I did:
>
> public class TestMain   {
>   @Test
>   public void testSomething  {
>      assertTrue(false);
>   }
>    // more tests and some utility methods }
>
> public class TestEquinox extends TestMain {
>     @Configuration
>     public static Option[] configure() throws Exception {
>        return options(equinox(), waitForFrameworkStartup(), provision(
>                scanFile("file:bundles-equinox.lst"),
>                scanFile("file:bundles.lst")));
>     }
>
>   �...@test
>     public void testSomethingElse {
>         // this runs fine, but results in duplicated code
>     }
> }
>
> In this setup, the tests in the main class pass without even running 
> (!), I checked with adding some logging to them. If I add tests to the 
> subclass, they run fine, but my plan was to put only the different 
> configurations to the subclasses and not to duplicate all test code  
> there. What am I doing wrong?
>
> Thanks, Norbert
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
>



--
Randy


_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to