FileDocCategorySizeDatePackage
HasAnnotationTest.javaAPI DocAndroid 1.5 API2556Wed May 06 22:42:02 BST 2009android.test.suitebuilder.annotation

HasAnnotationTest

public class HasAnnotationTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
private booleanhasExampleAnnotation(java.lang.Class aClass, java.lang.String methodName)

        Method method = aClass.getMethod(methodName);
        TestMethod testMethod = new TestMethod(method, aClass);
        return new HasAnnotation(Example.class).apply(testMethod);
    
public voidtestThatClassAnnotatioCausesAllMethodsToBeReportedAsBeingAnnotated()

        assertTrue(hasExampleAnnotation(ClassWithAnnotation.class, "testWithoutAnnotation"));
    
public voidtestThatMethodWithAnnotationIsReportedAsBeingAnnotated()

        assertTrue(hasExampleAnnotation(ClassWithAnnotation.class, "testWithAnnotation"));
        assertTrue(hasExampleAnnotation(ClassWithoutAnnotation.class, "testWithAnnotation"));
    
public voidtestThatMethodWithOutAnnotationIsNotReportedAsBeingAnnotated()

        assertFalse(hasExampleAnnotation(ClassWithoutAnnotation.class, "testWithoutAnnotation"));