Examples of StringContains


Examples of org.hamcrest.core.StringContains

        StringBuilder output = new StringBuilder();
        tag.writeTag(output);

        assertThat("Should use the right context and file path",
            output.toString(),
            new StringContains(SCRIPT_TAG_OUTPUT)
        );
    }
View Full Code Here

Examples of org.hamcrest.core.StringContains

    }

    @Factory
    public static Matcher<String> containsStripNewLines(final String expected) {
        final String strippedExpected = StringExtensions.stripNewLines(expected);
        return new StringContains(strippedExpected) {
            @Override
            public boolean matchesSafely(final String actual) {
                return super.matchesSafely(StringExtensions.stripNewLines(actual));
            }
View Full Code Here

Examples of org.hamcrest.core.StringContains

    }

    @Factory
    public static Matcher<String> containsStripNewLines(final String expected) {
        final String strippedExpected = StringExtensions.stripNewLines(expected);
        return new StringContains(strippedExpected) {
            @Override
            public boolean matchesSafely(final String actual) {
                return super.matchesSafely(StringExtensions.stripNewLines(actual));
            }
View Full Code Here

Examples of org.hamcrest.core.StringContains

    messagingTemplate.convertAndSend("myQueue", "msg to convert");
    verify(jmsTemplate).send(eq("myQueue"), messageCreator.capture());

    thrown.expect(org.springframework.messaging.converter.MessageConversionException.class);
    thrown.expectMessage(new StringContains("Test exception"));
    messageCreator.getValue().createMessage(mock(Session.class));
  }
View Full Code Here

Examples of org.hamcrest.core.StringContains

        Assert.assertEquals(-1, dlr.getErrorCode());
        Assert.assertNull(dlr.getText());

        // broken null-check caused date format to be applied to null date,
        // which results in the current time being formatted instead of all-zeroes
        Assert.assertThat(dlr.toShortMessage(), new StringContains(DeliveryReceipt.FIELD_DONE_DATE + "0000000000"));
    }
View Full Code Here

Examples of org.hamcrest.core.StringContains

        throw new MessageConversionException("Test exception");
      }
    });

    thrown.expect(org.springframework.messaging.converter.MessageConversionException.class);
    thrown.expectMessage(new StringContains("Test exception"));
    messagingTemplate.convertAndSend("myQueue", "msg to convert");
  }
View Full Code Here

Examples of org.hamcrest.text.StringContains

    }

    @Factory
    public static Matcher<String> containsStripNewLines(final String expected) {
        final String strippedExpected = StringUtils.stripNewLines(expected);
        return new StringContains(strippedExpected) {
            @Override
            public boolean matchesSafely(final String actual) {
                return super.matchesSafely(StringUtils.stripNewLines(actual));
            }
View Full Code Here

Examples of org.hamcrest.text.StringContains

    }

    @Factory
    public static Matcher<String> containsStripNewLines(final String expected) {
        final String strippedExpected = StringUtils.stripNewLines(expected);
        return new StringContains(strippedExpected) {
            @Override
            public boolean matchesSafely(final String actual) {
                return super.matchesSafely(StringUtils.stripNewLines(actual));
            }
View Full Code Here

Examples of org.hamcrest.text.StringContains

    public void testHandler() {
        AgentLoggerHandler handler = new AgentLoggerHandler();
        handler.setPrintStream(printStream);

        context.checking(new Expectations() {{
            oneOf(printStream).println(with(new StringContains("DEBUG (org.hotswap.agent.config.PluginManager) - A 1 B 2 C 3")));
        }});

        handler.print(PluginManager.class, AgentLogger.Level.DEBUG, "A {} B {} C {}", null, "1", 2, 3L);
    }
View Full Code Here

Examples of org.jmock.core.constraint.StringContains

    protected IsInstanceOf any( Class type ) {
        return instanceOf(type);
    }
   
    protected StringContains substring( String substring ) {
        return new StringContains(substring);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.