summaryrefslogtreecommitdiff
path: root/legacy-test/src
AgeCommit message (Collapse)Author
2017-11-28Move legacy-test to test-basePaul Duffin
Make it consistent with the test-mock and test-runner directories. Also renames the files in api/ subdirectory. Bug: 30188076 Test: make checkbuild Change-Id: If4f99a65fcca416ede5b3e63481398f0b451bcb7
2017-11-14Stop using c.a.i.u.Predicate outside test-runnerPaul Duffin
This class has been deprecated and should only be used in the frameworks/base/test-runner directory. Bug: 30188076 Test: make checkbuild Change-Id: I61059a96aa6045c44546239b94b329c02bb745a1
2017-06-22Clean up Predicate related code in android.testPaul Duffin
Part of the work of removing JUnit and dependent android.test classes from the Android API involves providing a static library that developers can include in their test applications to ease migration. That library will be built directly from the source (as opposed to android.jar which is built from stubs) and so developers will be able to see classes and methods that are not present in the stubs. This change is one of a number of similar changes that cleanup the existing non-API code in order to minimize the additional methods and classes exposed externally. The basic approach is to remove unused classes and methods, use least visible access modifier possible and generally minimize the amount of publicly visible code. The HasClassAnnotation and HasMethodAnnotation were never used separately and only used by HasAnnotation. This merges the functionality into a single nested class in TestPredicates, hidden behind the new TestPredicates.hasAnnotation(). The HasAnnotationTest was renamed as TestPredicatesTest and the HasClassAnnotationTest and HasMethodAnnotationTest classes were removed as their tests provide no additional coverage. The removal of the Has*Annotation.java files means that the test-runner/src/android/test/suitebuilder/annotation/ directory is empty apart from the package.html file so that was moved to legacy-test to sit alongside the actual annotation classes. The Predicates class, while part of the legacy-test module was only ever used by the test-runner module and only its not() method was actually used. So, the not() method and associated nested class were moved to TestPredicates, the tests for not() were moved to TestPredicatesTest and the Predicates* classes were removed. That allowed for the removal of the legacy-android-tests as that is now empty. TestPredicates has a number of constants that were public. They were hidden by moving them to the class that actually used them. A minor generic issue was fixed in AssignableFrom. Bug: 30188076 Test: make checkbuild and run FrameworkTestRunnerTests Change-Id: I861da388a4146bb28e1e480d1b7ba9137b7b270e
2017-05-12Moved c.a.i.u.Predicate[s] into legacy-testPaul Duffin
These classes are only used by android.test classes that are being removed. As their name suggests they should not be in the Android API at all so it makes sense to remove them. Especially as there is java.lang.function.Predicate available now. It appears as though Predicate was only added in to the API because it was used by a method in the API as the directory in which it and Predicates live was not on the list of classes to explicitly index. Moving it into legacy-test meant that they are now being indexed explicitly which means that Predicates needs to be hidden. Keeps running the tests as part of the existing target. At runtime apps targeted at the API version before these are removed will have the legacy-test library automatically added to their classpath so they should see no effect. Apps that target a later API will have to include those classes from the android.legacy.test.jar which will contain all the android.test classes that depend on it as well. Bug: 30188076 Test: make checkbuild Change-Id: I6f6f5f16fe93bd80227a450c6254166632fc6813
2016-12-14Copy core-junit files into legacy-test.Paul Duffin
The legacy-test directory contains part of the Android API and so must maintain backwards compatibility. The junit classes that are in the API are copied here to ensure that they do not change when external/junit is upgraded. Bug: 30188076 Test: make checkbuild and checked legacy-test contents Change-Id: I6c263afc16c06abfd027334be51a41422239a189
2016-12-08Move android.test classes from core/java to legacy-test/srcPaul Duffin
(cherry picked from 2395179afb2ea957a9ba66404021c14160361611) Bug: 30188076 Test: make checkbuild Merged-In: Ifa291909fcf47da788627b496bd72f54efd78ed7 Change-Id: Ie20dceb9f89df245ed6da5fc2fb06185bd7b104b