Running JUnit 4 tests organised with inner classeshttps://www.eclipse.org/forums/index.php/mv/msg/283010/788050/#msg_788050
I have organised my JUnit tests using one test class for the class that I'm testing and one static inner class each for each method / behaviour that I'm testing.

This works really well for me from an organisational point of view, but I'm am having trouble finding out how to run all the scripts at once. When I shift+alt+X T to run the tests, Eclipse offers me a choice of all the inner classes to run and I seem to have to pick one rather than to run all of them at once.

I really want to run them all at the same time. Is there a way I can configure this?

Many thanks]]>Joe Lemmer2012-02-01T09:38:28-00:00Re: Running JUnit 4 tests organised with inner classeshttps://www.eclipse.org/forums/index.php/mv/msg/283010/788074/#msg_788074
JUnit 4 comes with a runner class called Enclosed, which does what you need.

Am 01.02.2012 10:38, schrieb Joe Lemmer:
> Hi,
>
> I have organised my JUnit tests using one test class for the class that
> I'm testing and one static inner class each for each method / behaviour
> that I'm testing.
>
> public class TestMyClass {
>
> public static class TestMyFirstMethod {
> @Test
> public void testMthodOneDoesSomething() {
> // test code here
> }
>
> @Test
> public void testMethodOneDoesSomethingElse() {
> // test code here
> }
> }
>
> public static class TestMyMethodTwo {
>
> @Test
> public void testMyMthodTwoDoesSomething() {
> // test code here
> }
> }
> }
>
> This works really well for me from an organisational point of view, but
> I'm am having trouble finding out how to run all the scripts at once.
> When I shift+alt+X T to run the tests, Eclipse offers me a choice of all
> the inner classes to run and I seem to have to pick one rather than to
> run all of them at once.
>
> I really want to run them all at the same time. Is there a way I can
> configure this?
>
> Many thanks]]>Heiner Westphal2012-02-01T10:16:01-00:00Re: Running JUnit 4 tests organised with inner classeshttps://www.eclipse.org/forums/index.php/mv/msg/283010/788105/#msg_788105
Joe Lemmer2012-02-01T10:56:11-00:00