当前位置: 首页>>代码示例>>Java>>正文


Java AllOf类代码示例

本文整理汇总了Java中org.hamcrest.core.AllOf的典型用法代码示例。如果您正苦于以下问题:Java AllOf类的具体用法?Java AllOf怎么用?Java AllOf使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AllOf类属于org.hamcrest.core包,在下文中一共展示了AllOf类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fooAllOf

import org.hamcrest.core.AllOf; //导入依赖的package包/类
public void fooAllOf() {
    Espresso.onView(AllOf.allOf(ViewMatchers.withId(R.id.some_id), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    Espresso.onView(AllOf.allOf(ViewMatchers.withText(R.string.some_text), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    Espresso.onView(AllOf.allOf(ViewMatchers.withText("some text"), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    Espresso.onView(AllOf.allOf(RistrettoViewMatchers.with("some text"), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(ViewMatchers.withId(R.id.some_id), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(ViewMatchers.withText(R.string.some_text), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(ViewMatchers.withText("some text"), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(RistrettoViewMatchers.with("some text"), ViewMatchers.isDisplayed())).perform(ViewAction.click());
    
    Espresso.onView(AllOf.allOf(ViewMatchers.isDisplayed(), ViewMatchers.withId(R.id.some_id))).perform(ViewAction.click());
    Espresso.onView(AllOf.allOf(ViewMatchers.isDisplayed(), ViewMatchers.withText(R.string.some_text))).perform(ViewAction.click());
    Espresso.onView(AllOf.allOf(ViewMatchers.isDisplayed(), ViewMatchers.withText("some text"))).perform(ViewAction.click());
    Espresso.onView(AllOf.allOf(ViewMatchers.isDisplayed(), RistrettoViewMatchers.with("some text"))).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(ViewMatchers.isDisplayed(), ViewMatchers.withId(R.id.some_id))).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(ViewMatchers.isDisplayed(), ViewMatchers.withText(R.string.some_text))).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(ViewMatchers.isDisplayed(), ViewMatchers.withText("some text"))).perform(ViewAction.click());
    Ristretto.withView(AllOf.allOf(ViewMatchers.isDisplayed(), RistrettoViewMatchers.with("some text"))).perform(ViewAction.click());
}
 
开发者ID:vincetreur,项目名称:Ristretto,代码行数:20,代码来源:OnViewAllOfWithIsDisplayedNoImport.java

示例2: sendStreamMessage

import org.hamcrest.core.AllOf; //导入依赖的package包/类
@Test
public void sendStreamMessage() {
    //Wait to make sure the messages are loaded
    sleep(2000);

    onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolderAndClick(MessageType.STREAM_MESSAGE, R.id.contentView)));
    sleep(1000);

    //Fill message EditText
    ViewInteraction messageInteraction = onView(allOf(withId(R.id.message_et), isDisplayed()));
    messageInteraction.perform(replaceText(testMessageStream));

    //Click Send Button
    ViewInteraction imageView = onView(allOf(withId(R.id.send_btn), isDisplayed()));
    imageView.perform(click());

    sleep(2000);

    //Scroll And check the new sent message
    onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolder(testMessageStream, R.id.contentView)));

    onView(AllOf.allOf(withId(R.id.contentView), withText(testMessageStream))).check(matches(isDisplayed()));

    checkIfMessagesMatchTheHeaderParent();
    checkOrderOfMessagesCurrentList();
}
 
开发者ID:zulip,项目名称:zulip-android,代码行数:27,代码来源:RecyclerViewTests.java

示例3: sendPrivateMessage

import org.hamcrest.core.AllOf; //导入依赖的package包/类
@Test
public void sendPrivateMessage() {
    //Wait to make sure the messages are loaded
    sleep(2000);

    onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolderAndClick(MessageType.PRIVATE_MESSAGE, R.id.contentView)));
    sleep(1000);

    //Fill message EditText
    ViewInteraction messageInteraction = onView(allOf(withId(R.id.message_et), isDisplayed()));
    messageInteraction.perform(replaceText(testMessagePrivate));

    //Click Send Button
    ViewInteraction imageView = onView(allOf(withId(R.id.send_btn), isDisplayed()));
    imageView.perform(click());

    sleep(2000);

    //Scroll And check the new sent message
    onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolder(testMessagePrivate, R.id.contentView)));

    onView(AllOf.allOf(withId(R.id.contentView), withText(testMessagePrivate))).check(matches(isDisplayed()));

    checkIfMessagesMatchTheHeaderParent();
    checkOrderOfMessagesCurrentList();
}
 
开发者ID:zulip,项目名称:zulip-android,代码行数:27,代码来源:RecyclerViewTests.java

示例4: and_returns_instanceOf_AllOf

import org.hamcrest.core.AllOf; //导入依赖的package包/类
@Test
public void and_returns_instanceOf_AllOf() {
    //given
    List<Matcher<? super View>> matchers = new ArrayList<>();
    Matcher<View> matcher = new SimpleWrappingViewMatcher<>(null);
    matchers.add(matcher);

    //when
    Matcher<? super View> link = AND.link(matchers);

    //then
    assertThat(link).isInstanceOf(AllOf.class);
}
 
开发者ID:blipinsk,项目名称:cortado,代码行数:14,代码来源:Linker_Tests.java

示例5: expectMessageContaining

import org.hamcrest.core.AllOf; //导入依赖的package包/类
private void expectMessageContaining(String... parts) {
    List<Matcher<? super String>> matchers = new ArrayList<>();
    for (String part : parts) {
        matchers.add(StringContains.containsString(format(part)));
    }
    delegate.expectMessage(AllOf.allOf(matchers));
}
 
开发者ID:assertj,项目名称:assertj-vavr,代码行数:8,代码来源:ExpectedException.java

示例6: hasSameExternalValuesThan

import org.hamcrest.core.AllOf; //导入依赖的package包/类
@Factory
public static <T> Matcher<MuleMessage> hasSameExternalValuesThan(MuleMessage message) {
	List<Matcher<? super MuleMessage>> allScopeMatchers = new ArrayList<Matcher<? super MuleMessage>>(3);
	
	Object payload = message != null ? message.getPayload() : null;
	
	allScopeMatchers.add(SamePropertiesMatcher.hasSamePropertiesThan(message));
	allScopeMatchers.add(SameAttachmentsMatcher.hasSameAttachmentsThan(message));
	allScopeMatchers.add(PayloadMatcher.hasPayload(payload));
	
	return new AllOf<MuleMessage>(allScopeMatchers);
}
 
开发者ID:vromero,项目名称:mule-module-hamcrest,代码行数:13,代码来源:SameExternalValuesMatcher.java

示例7: hasSamePropertiesThan

import org.hamcrest.core.AllOf; //导入依赖的package包/类
@Factory
public static <T> Matcher<MuleMessage> hasSamePropertiesThan(MuleMessage message) {
	List<Matcher<? super MuleMessage>> allScopeMatchers = new ArrayList<Matcher<? super MuleMessage>>(4);
	
	allScopeMatchers.add(new SamePropertiesMatcher(PropertyScope.INBOUND, message));
	allScopeMatchers.add(new SamePropertiesMatcher(PropertyScope.OUTBOUND, message));
	allScopeMatchers.add(new SamePropertiesMatcher(PropertyScope.INVOCATION, message));
	allScopeMatchers.add(new SamePropertiesMatcher(PropertyScope.SESSION, message));
	
	return new AllOf<MuleMessage>(allScopeMatchers);
}
 
开发者ID:vromero,项目名称:mule-module-hamcrest,代码行数:12,代码来源:SamePropertiesMatcher.java

示例8: hasSameAttachmentsThan

import org.hamcrest.core.AllOf; //导入依赖的package包/类
@Factory
public static <T> Matcher<MuleMessage> hasSameAttachmentsThan(MuleMessage message) {
	List<Matcher<? super MuleMessage>> allScopeMatchers = new ArrayList<Matcher<? super MuleMessage>>(2);
	
	allScopeMatchers.add(new SameAttachmentsMatcher(AttachmentScope.INBOUND, message));
	allScopeMatchers.add(new SameAttachmentsMatcher(AttachmentScope.OUTBOUND, message));
	
	return new AllOf<MuleMessage>(allScopeMatchers);
}
 
开发者ID:vromero,项目名称:mule-module-hamcrest,代码行数:10,代码来源:SameAttachmentsMatcher.java

示例9: expectMessageContaining

import org.hamcrest.core.AllOf; //导入依赖的package包/类
private void expectMessageContaining(String... parts) {
  List<Matcher<? super String>> matchers = new ArrayList<>();
  for (String part : parts) {
    matchers.add(StringContains.containsString(format(part)));
  }
  delegate.expectMessage(AllOf.allOf(matchers));
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:8,代码来源:ExpectedException.java

示例10: withNameAndBuildingFor

import org.hamcrest.core.AllOf; //导入依赖的package包/类
private Matcher<XCScheme.BuildActionEntry> withNameAndBuildingFor(
    String name, Matcher<? super EnumSet<XCScheme.BuildActionEntry.BuildFor>> buildFor) {
  return AllOf.allOf(
      buildActionEntryWithName(name),
      new FeatureMatcher<XCScheme.BuildActionEntry, EnumSet<XCScheme.BuildActionEntry.BuildFor>>(
          buildFor, "Building for", "BuildFor") {
        @Override
        protected EnumSet<XCScheme.BuildActionEntry.BuildFor> featureValueOf(
            XCScheme.BuildActionEntry entry) {
          return entry.getBuildFor();
        }
      });
}
 
开发者ID:facebook,项目名称:buck,代码行数:14,代码来源:WorkspaceAndProjectGeneratorTest.java

示例11: sameSessionDataAs

import org.hamcrest.core.AllOf; //导入依赖的package包/类
public static Matcher<Session> sameSessionDataAs(Session data) {
    List<Matcher<? super Session>> matchers = new ArrayList<>();

    matchers.add(sessionWithId(data.id()));
    matchers.add(sessionCreatedAt(data.createdAt()));
    matchers.add(sessionUpdatedAt(data.updatedAt()));
    matchers.add(sessionWithMaxAge(data.maxAge()));

    matchers.addAll(data.keys().stream().map(key -> sessionWithSameAttributeAs(data, key)).collect(Collectors.toList()));

    return new AllOf<>(matchers);
}
 
开发者ID:testinfected,项目名称:molecule,代码行数:13,代码来源:SessionMatchers.java

示例12: allOf

import org.hamcrest.core.AllOf; //导入依赖的package包/类
/**
 * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
 */
@SafeVarargs
public static <T> OutputMatcher<T> allOf(OutputMatcher<T>... matchers) {
    return OutputMatcherFactory.create(AllOf.allOf(matchers));
}
 
开发者ID:ottogroup,项目名称:flink-spector,代码行数:8,代码来源:OutputMatchers.java

示例13: hasWarnings

import org.hamcrest.core.AllOf; //导入依赖的package包/类
public static Matcher<List<Warning>> hasWarnings(Matcher<List<Warning>>... matchers) {
  return new AllOf<>(Arrays.asList(matchers));
}
 
开发者ID:a11n,项目名称:lint-junit-rule,代码行数:4,代码来源:WarningMatcher.java

示例14: reportAnd

import org.hamcrest.core.AllOf; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static <T> T reportAnd(Object matchValuesArray, Class<T> clazz) {
    List<Matcher> matchers = MatcherSyntax.matcherListFragment(clazz, matchValuesArray);
    return (T) argThat(clazz, new AllOf(matchers));
}
 
开发者ID:pobrelkey,项目名称:moxiemocks,代码行数:6,代码来源:MoxieMatchers.java

示例15: arrayWithAll

import org.hamcrest.core.AllOf; //导入依赖的package包/类
/**
 *
 * Matches a non-primitive array containing elements matching the given parameters (which may be {@link MoxieMatchers} invocations).
 * <p>
 *
 * Note that the order in which the values to be matched are specified is not significant; the array merely needs to
 * contain a match for each given parameter in any order.  For a matcher where ordering is significant, use {@link MoxieMatchers#array(Object[]) array()}.
 * <p>
 *
 * @return <code>null</code>
 */
@SuppressWarnings("unchecked")
static public <T> T[] arrayWithAll(T... items) {
    List<Matcher> itemMatchers = MatcherSyntax.matcherListFragment(Object.class, items);
    List<Matcher> arrayMatchers = new ArrayList<Matcher>();
    for (Matcher itemMatcher : itemMatchers) {
        arrayMatchers.add(IsArrayContaining.hasItemInArray(itemMatcher));
    }
    return (T[]) argThat(Object[].class, new AllOf(arrayMatchers));
}
 
开发者ID:pobrelkey,项目名称:moxiemocks,代码行数:21,代码来源:MoxieMatchers.java


注:本文中的org.hamcrest.core.AllOf类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。