Class Overview
A collection of hamcrest matchers for matching Intent objects.
Summary
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
final
void
|
wait()
|
|
Public Methods
public
static
Matcher<Intent>
anyIntent
()
public
static
Matcher<Intent>
hasAction
(Matcher<String> actionMatcher)
| Parameters |
actionMatcher |
Matcher |
public
static
Matcher<Intent>
hasCategories
(Set<String> categories)
| Parameters |
categories |
Set |
public
static
Matcher<Intent>
hasCategories
(Matcher<? extends Iterable<? super String>> categoriesMatcher)
| Parameters |
categoriesMatcher |
Matcher |
public
static
Matcher<Intent>
hasComponent
(String className)
Returns a matcher that will only match intents targeted to a single class by using hasClassName(String). The input string must contain the package name + short
class name. For example hasComponent("com.google.provider.NotePad").
| Parameters |
className |
String: complete class path
|
public
static
Matcher<Intent>
hasComponent
(Matcher<ComponentName> componentMatcher)
Can match an intent by class name, package name or short class name.
public
static
Matcher<Intent>
hasComponent
(ComponentName componentName)
Returns a matcher that will only match intents targeted to the componentName's class, . For example: Intent intent = new Intent() .setComponentName(new
ComponentName("com.google.provider", "com.google.provider.Notepad")); will match all intents
targeted to Notepad.java.
| Parameters |
componentName |
ComponentName: a componentName that has the target class specified
|
public
static
Matcher<Intent>
hasData
(Matcher<Uri> uriMatcher)
| Parameters |
uriMatcher |
Matcher |
public
static
Matcher<Intent>
hasData
(Uri uri)
public
static
Matcher<Intent>
hasExtra
(Matcher<String> keyMatcher, Matcher<?> valueMatcher)
| Parameters |
keyMatcher |
Matcher |
valueMatcher |
Matcher |
public
static
Matcher<Intent>
hasExtra
(String key, T value)
| Parameters |
key |
String |
value |
T |
public
static
Matcher<Intent>
hasExtraWithKey
(Matcher<String> keyMatcher)
| Parameters |
keyMatcher |
Matcher |
public
static
Matcher<Intent>
hasExtras
(Matcher<Bundle> bundleMatcher)
| Parameters |
bundleMatcher |
Matcher |
public
static
Matcher<Intent>
hasFlag
(int flag)
public
static
Matcher<Intent>
hasFlags
(int flags)
public
static
Matcher<Intent>
hasFlags
(int... flags)
public
static
Matcher<Intent>
hasPackage
(Matcher<String> packageMatcher)
| Parameters |
packageMatcher |
Matcher |
public
static
Matcher<Intent>
hasPackage
(String packageName)
| Parameters |
packageName |
String |
public
static
Matcher<Intent>
hasType
(Matcher<String> typeMatcher)
| Parameters |
typeMatcher |
Matcher |
public
static
Matcher<Intent>
isInternal
()
Matches an intent if its package is the same as the target package for the instrumentation
test.
public
static
Matcher<Intent>
toPackage
(String packageName)
Matches an intent based on the package of activity which can handle the intent.
| Parameters |
packageName |
String: packages of activity that can handle the intent
|