Code example for Method

Methods: getAnnotation

0
     */ 
    @SuppressWarnings("unchecked") 
    private boolean hasAnnotation(TestCase test, Class clazz) {
        try { 
            Method method = test.getClass().getMethod(test.getName());
            return method.getAnnotation(clazz) != null;
        } catch (Exception e) {
            // Ignore 
        } 
         
        return false; 
    } 
     
    /** 
     * Runs the tests and collects their result in a TestResult. 
     */ 
    public void run(TestResult result) {
        // Run tests 
        int i = 0;
         
        while (fTests.size() != 0 && !result.shouldStop()) {