
org.robolectric.shadows.ShadowContentProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import android.content.ContentProvider;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;
import static org.robolectric.shadow.api.Shadow.directlyOn;
@Implements(ContentProvider.class)
public class ShadowContentProvider {
@RealObject private ContentProvider realContentProvider;
private String callingPackage;
public void setCallingPackage(String callingPackage) {
this.callingPackage = callingPackage;
}
@Implementation
public String getCallingPackage() {
if (callingPackage != null) {
return callingPackage;
} else {
return directlyOn(realContentProvider, ContentProvider.class, "getCallingPackage");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy