Java Code Examples for org.robolectric.util.ReflectionHelpers#getStaticField()

The following examples show how to use org.robolectric.util.ReflectionHelpers#getStaticField() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HokoGradleTestRunner.java    From hoko-android with Apache License 2.0 5 votes vote down vote up
private String getType(Config config) {
    try {
        return ReflectionHelpers.getStaticField(config.constants(), "BUILD_TYPE");
    } catch (Throwable e) {
        return null;
    }
}
 
Example 2
Source File: HokoGradleTestRunner.java    From hoko-android with Apache License 2.0 5 votes vote down vote up
private String getFlavor(Config config) {
    try {
        return ReflectionHelpers.getStaticField(config.constants(), "FLAVOR");
    } catch (Throwable e) {
        return null;
    }
}
 
Example 3
Source File: HokoGradleTestRunner.java    From hoko-android with Apache License 2.0 5 votes vote down vote up
private String getPackageName(Config config) {
    try {
        final String packageName = config.packageName();
        if (packageName != null && !packageName.isEmpty()) {
            return packageName;
        } else {
            return ReflectionHelpers.getStaticField(config.constants(), "APPLICATION_ID");
        }
    } catch (Throwable e) {
        return null;
    }
}
 
Example 4
Source File: CustomRunner.java    From algoliasearch-client-android with MIT License 5 votes vote down vote up
private String getType(Config config) {
    try {
        return ReflectionHelpers.getStaticField(config.constants(), "BUILD_TYPE");
    } catch (Throwable e) {
        return null;
    }
}
 
Example 5
Source File: CustomRunner.java    From algoliasearch-client-android with MIT License 5 votes vote down vote up
private String getFlavor(Config config) {
    try {
        return ReflectionHelpers.getStaticField(config.constants(), "FLAVOR");
    } catch (Throwable e) {
        return null;
    }
}
 
Example 6
Source File: CustomRunner.java    From algoliasearch-client-android with MIT License 5 votes vote down vote up
private String getPackageName(Config config) {
    try {
        final String packageName = config.packageName();
        if (packageName != null && !packageName.isEmpty()) {
            return packageName;
        } else {
            return ReflectionHelpers.getStaticField(config.constants(), "APPLICATION_ID");
        }
    } catch (Throwable e) {
        return null;
    }
}