blob: 3c682922102d707bb028a024eba62c17da038738 [file] [log] [blame]
This folder is for Robolectric tests inside the platform.
To add a test class annotate it as follows:
@Config(manifest = Config.NONE, sdk = 26)
@SystemLoaderClasses({ClassUnderTest.class, DependencyClasses.class})
Robolectric loads some classes that it decides from versioned jars of the framework. Since we are
part of the framework some of our classes get loaded from these jars. This is NOT what we want, we
want to test against what we wrote in the tree. Because of this we use a custom test runner,
FrameworkRobolectricTestRunner, that bypasses these jars and loads certain classes from the system
class loader.
To specify which classes to load use either @SystemLoaderClasses or @SystemLoaderPackages. In
* You MUST put the class under test here.
* If you encounter any exceptions that might be caused by a different version of the class being
loaded, such as NoSuchMethodException, put the class involved in the exception in this annotation
and try again.
Check file for more info.