Search in sources :

Example 6 with TestMethod

use of android.test.suitebuilder.TestMethod in project android_frameworks_base by DirtyUnicorns.

the class HasMethodAnnotationTest method methodHasAnnotation.

private boolean methodHasAnnotation(Class<? extends TestCase> aClass, String methodName, Class<? extends Annotation> expectedClassification) throws NoSuchMethodException {
    Method method = aClass.getMethod(methodName);
    TestMethod testMethod = new TestMethod(method, aClass);
    return new HasMethodAnnotation(expectedClassification).apply(testMethod);
}
Also used : TestMethod(android.test.suitebuilder.TestMethod) Method(java.lang.reflect.Method) TestMethod(android.test.suitebuilder.TestMethod)

Example 7 with TestMethod

use of android.test.suitebuilder.TestMethod in project android_frameworks_base by DirtyUnicorns.

the class HasAnnotationTest method hasExampleAnnotation.

private boolean hasExampleAnnotation(Class<? extends TestCase> aClass, String methodName) throws NoSuchMethodException {
    Method method = aClass.getMethod(methodName);
    TestMethod testMethod = new TestMethod(method, aClass);
    return new HasAnnotation(Example.class).apply(testMethod);
}
Also used : TestMethod(android.test.suitebuilder.TestMethod) Method(java.lang.reflect.Method) TestMethod(android.test.suitebuilder.TestMethod)

Example 8 with TestMethod

use of android.test.suitebuilder.TestMethod in project android_frameworks_base by DirtyUnicorns.

the class HasClassAnnotationTest method classHasAnnotation.

private boolean classHasAnnotation(Class<? extends TestCase> aClass, Class<Smoke> expectedClassification) throws NoSuchMethodException {
    Method method = aClass.getMethod("testSomeTest");
    TestMethod testMethod = new TestMethod(method, aClass);
    return new HasClassAnnotation(expectedClassification).apply(testMethod);
}
Also used : TestMethod(android.test.suitebuilder.TestMethod) Method(java.lang.reflect.Method) TestMethod(android.test.suitebuilder.TestMethod)

Example 9 with TestMethod

use of android.test.suitebuilder.TestMethod in project android_frameworks_base by crdroidandroid.

the class HasAnnotationTest method hasExampleAnnotation.

private boolean hasExampleAnnotation(Class<? extends TestCase> aClass, String methodName) throws NoSuchMethodException {
    Method method = aClass.getMethod(methodName);
    TestMethod testMethod = new TestMethod(method, aClass);
    return new HasAnnotation(Example.class).apply(testMethod);
}
Also used : TestMethod(android.test.suitebuilder.TestMethod) Method(java.lang.reflect.Method) TestMethod(android.test.suitebuilder.TestMethod)

Example 10 with TestMethod

use of android.test.suitebuilder.TestMethod in project android_frameworks_base by crdroidandroid.

the class HasMethodAnnotationTest method methodHasAnnotation.

private boolean methodHasAnnotation(Class<? extends TestCase> aClass, String methodName, Class<? extends Annotation> expectedClassification) throws NoSuchMethodException {
    Method method = aClass.getMethod(methodName);
    TestMethod testMethod = new TestMethod(method, aClass);
    return new HasMethodAnnotation(expectedClassification).apply(testMethod);
}
Also used : TestMethod(android.test.suitebuilder.TestMethod) Method(java.lang.reflect.Method) TestMethod(android.test.suitebuilder.TestMethod)

Aggregations

TestMethod (android.test.suitebuilder.TestMethod)21 Method (java.lang.reflect.Method)15 TestSuiteBuilder (android.test.suitebuilder.TestSuiteBuilder)5 TestSuite (junit.framework.TestSuite)5 HasAnnotation (android.test.suitebuilder.annotation.HasAnnotation)1 Predicate (com.android.internal.util.Predicate)1 BrokenTest (dalvik.annotation.BrokenTest)1 SideEffect (dalvik.annotation.SideEffect)1