private static AntUnitSuite getJUnit3AntSuite()

in src/main/org/apache/ant/antunit/junit4/AntUnitSuiteRunner.java [88:110]


    private static AntUnitSuite getJUnit3AntSuite(Class<?> testCaseClass)
            throws InitializationError {
        try {
            Method suiteMethod = testCaseClass.getMethod("suite");
            if (!Modifier.isStatic(suiteMethod.getModifiers())) {
                throw new InitializationError("suite method must be static");
            }
            Object suite = suiteMethod.invoke(null);
            if (suite == null) {
                throw new InitializationError("suite method can not return null");
            }
            if (!(suite instanceof AntUnitSuite)) {
                throw new InitializationError("suite method must return an AntUnitSuite");
            }
            return (AntUnitSuite) suite;
        } catch (NoSuchMethodException e) {
            throw new InitializationError(e);
        } catch (IllegalAccessException e) {
            throw new InitializationError(e);
        } catch (InvocationTargetException e) {
            throw new InitializationError(e);
        }
    }