morristech
8/16/2016 - 6:43 AM

Sample use of the Enclosed.class test runner

Sample use of the Enclosed.class test runner

@RunWith(Enclosed.class)
public class WorkflowStateMachineTest {




    @RunWith(Parameterized.class)
    public static class ParameterizedTests {
    
        @Parameter public ISBatchType mTestBatchType; // first data value (0) is default
        @Parameter(value = 1) public ISWorkflowState mTestBatchState;
        
        @Parameters(name = "transitioning back from {1} <- for {0} batch")
        public static Collection<Object[]> data() {
          // return ...
        }
        
        // ...
        
        @Test
        public void shouldNotAllowMovingBack_FromParameterizedStates() {
          // ...
        }
    }



    public static class IndividualTests {
        @Test
        public void shouldDoSomething_LikeAnyRegularTest() {
            // ...
        }    
    }
    
    
    
}