Code example for Method

Methods: getAnnotation

0
     */ 
    @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;
                 
                // Check whether we need to invert the test result (known failures)