/** * @param clazz the test class * @throws InitializationError in case the initialization fails */ public ProcessorSuiteRunner(Class<?> clazz) throws InitializationError { super(clazz); ProcessorSuite suite = clazz.getAnnotation(ProcessorSuite.class); if (null == suite) { throw new InitializationError( "The test class must be annotated with " + ProcessorSuite.class.getName()); } if (suite.processorTypes().length == 0) { throw new InitializationError("ProcessorSuite#processorTypes must not be empty"); } Constructor<? extends CommandLineEnhancer> cliEnhancerConstructor = null; if (suite.commandLineEnhancer() != CommandLineEnhancer.class) { try { cliEnhancerConstructor = suite.commandLineEnhancer().getConstructor(); } catch (NoSuchMethodException e) { throw new InitializationError( suite.commandLineEnhancer().getName() + " does not have a default constructor."); } catch (SecurityException e) { throw new InitializationError(e); } } methods = initializeTestCases(suite, cliEnhancerConstructor); }