Package org.hamcrest.core

Examples of org.hamcrest.core.SubstringMatcher


        assertThat(feed.getEntries().size(), greaterThan(0));
        for (Object o : feed.getEntries()) {
            SyndEntryImpl message = (SyndEntryImpl) o;
            XContentBuilder xcb = toJson(message, null, null, false);
            assertThat(xcb, notNullValue());
            assertThat(xcb.string(), new SubstringMatcher("<p>") {
                @Override
                protected boolean evalSubstringOf(String s) {
                    return s.indexOf(substring) < 0;
                }
View Full Code Here


            }
        });
    }

    private Matcher<String> countString(final String substring, final int targetCount) {
        return new SubstringMatcher(substring) {
            @Override
            protected boolean evalSubstringOf(String string) {
                int count = 0;
                int current = 0;
View Full Code Here

    assertThat(nonXaJmsConnectionFactory,
        not(instanceOf(PoolingConnectionFactory.class)));
  }

  private Matcher<? super String> containsString(final int times, String s) {
    return new SubstringMatcher(s) {

      @Override
      protected String relationship() {
        return "containing " + times + " times";
      }
View Full Code Here

    assertThat(output, containsString(2, "Count is 1"));
    assertThat(output, containsString(1, "Simulated error"));
  }

  private Matcher<? super String> containsString(final int times, String s) {
    return new SubstringMatcher(s) {

      @Override
      protected String relationship() {
        return "containing " + times + " times";
      }
View Full Code Here

TOP

Related Classes of org.hamcrest.core.SubstringMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.