Code example for TestCase

Methods: getClass, getName

0
     * Checks whether the given TestCase method has the given annotation.  
     */ 
    @SuppressWarnings("unchecked") 
    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; 
    } 
 
    @Override 
    @SuppressWarnings("deprecation") 
    public void runProtected(final Test test, Protectable p) {
        if ((fFlags & CoreTestSuite.DRY_RUN) == 0) {
            if (test instanceof TestCase) {
                TestCase testCase = (TestCase)test;