kellyfj
kellyfj

Reputation: 6943

Why does `testAndroidTestCaseSetupProperly` take so long to run?

When running android test cases why does testAndroidTestCaseSetupProperly take so long when (I think) all it is doing is checking the Context? It seems to take anywhere from 10 to 20 seconds.

Upvotes: 0

Views: 328

Answers (1)

Jared Burrows
Jared Burrows

Reputation: 55527

Look at the Android Source here: https://android.googlesource.com/platform/frameworks/base/+/donut-release/core/java/android/test/AndroidTestCase.java.

Here is the source:

public void testAndroidTestCaseSetupProperly() {
    assertNotNull("Context is null. setContext should be called before tests are run",
            mContext);        
}

All it is doing is asserting not null. I am pretty sure it must be some of your other test cases that are taking a while.

Empty, but the official docs are here: http://developer.android.com/reference/android/test/AndroidTestCase.html#testAndroidTestCaseSetupProperly().

Upvotes: 2

Related Questions