org.hamcrest.Matchers#instanceOf ( )源码实例Demo

下面列出了org.hamcrest.Matchers#instanceOf ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Test
public void shouldConfigureFixedPrefixAutomatically() throws Exception {

	this.resolver.addFixedVersionStrategy("fixedversion", "/js/**", "/css/**", "/fixedversion/css/**");

	Matcher<VersionStrategy> matcher = Matchers.instanceOf(FixedVersionStrategy.class);
	assertThat(this.resolver.getStrategyMap().size(), is(4));
	assertThat(this.resolver.getStrategyForPath("js/something.js"), matcher);
	assertThat(this.resolver.getStrategyForPath("fixedversion/js/something.js"), matcher);
	assertThat(this.resolver.getStrategyForPath("css/something.css"), matcher);
	assertThat(this.resolver.getStrategyForPath("fixedversion/css/something.css"), matcher);
}
 
@Test
public void shouldConfigureFixedPrefixAutomatically() throws Exception {

	this.resolver.addFixedVersionStrategy("fixedversion", "/js/**", "/css/**", "/fixedversion/css/**");

	Matcher<VersionStrategy> matcher = Matchers.instanceOf(FixedVersionStrategy.class);
	assertThat(this.resolver.getStrategyMap().size(), is(4));
	assertThat(this.resolver.getStrategyForPath("js/something.js"), matcher);
	assertThat(this.resolver.getStrategyForPath("fixedversion/js/something.js"), matcher);
	assertThat(this.resolver.getStrategyForPath("css/something.css"), matcher);
	assertThat(this.resolver.getStrategyForPath("fixedversion/css/something.css"), matcher);
}
 
private Matcher<List<LogEntry>> anyList() {
  return Matchers.instanceOf(List.class);
}
 
源代码4 项目: edittext-mask   文件: HintViewAction.java
@Override
public Matcher<View> getConstraints() {
    return Matchers.instanceOf(TextView.class);
}