Android Test Test Preconditions

In Android developers, I saw that the testPreconditions () method should run before all tests. But in my application, the test, it acts like a regular test. It does not start before all tests. Something is wrong?

Here is a description of the testPreconditions () conditions from the Android developer: "The prerequisite test checks the initial conditions of the application before performing other tests. It is similar to setUp (), but with less overhead since it runs only once."

+5
source share
3 answers

Actually, testPreconditions () is another unit test. Here is a quote from the Android Application Testing Guide, Diego Torres Milano’s book:

" testPreconditions . , , . .

, (2011-06-23). Android (. 76). Packt Publishing. Kindle Edition.

+6

Android SDK:

   The name 'test preconditions' is a convention to signal that if this
   test doesn't pass, the test case was not set up properly and it might
   explain any and all failures in other tests.  This is not guaranteed
   to run before other tests, as junit uses reflection to find the tests.
+1

, (ActivityInstrumentationTestCase2) :

public void testPreconditions()
0

All Articles