I read about Structuring Unit Tests with having a test class per class and an inner class per method. Figured that seemed like a handy way to organize the tests, so I tried
I think some of the answers might be for older versions of JUnit. In JUnit 4 this worked for me:
@RunWith(Suite.class)
@Suite.SuiteClasses({ DogTests.BarkTests.class, DogTests.EatTests.class })
public class DogTests
{
public static class BarkTests
{
@Test
public void quietBark_IsAtLeastAudible() { }
@Test
public void loudBark_ScaresAveragePerson() { }
}
public static class EatTests
{
@Test
public void normalFood_IsEaten() { }
@Test
public void badFood_ThrowsFit() { }
}
}