Class StringAssert
java.lang.Object
org.eclipse.jetty.toolchain.test.StringAssert
Collection of common asserts for Strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertContains(String msg, String haystack, String needle) Asserts that string (haystack) contains specified text (needle).static voidassertContains(String msg, String haystack, String needle, int offset) Asserts that string (haystack) contains specified text (needle), starting at offset (inhaystack).static voidAsserts that the list of String lines contains the same lines (without a regard for the order of those lines)static voidassertNotContains(String msg, String haystack, String needle) Asserts that string (haystack) does not contain specified text (needle).static voidassertNotContains(String msg, String haystack, String needle, int offset) Asserts that string (haystack) does not contain specified text (needle), starting at offset (inhaystack).static voidassertStartsWith(String msg, String haystack, String expected) Asserts that the string (haystack) starts with the string (expected)
-
Constructor Details
-
StringAssert
private StringAssert()
-
-
Method Details
-
assertContains
-
assertContains
Asserts that string (haystack) contains specified text (needle), starting at offset (inhaystack).- Parameters:
msg- the assertion messagehaystack- the text to search inneedle- the text to search foroffset- the offset in (haystack) to perform search from
-
assertContainsSame
public static void assertContainsSame(String msg, List<String> linesExpected, List<String> linesActual) Asserts that the list of String lines contains the same lines (without a regard for the order of those lines)- Parameters:
msg- the assertion messagelinesExpected- the list of expected lineslinesActual- the list of actual lines
-
assertNotContains
-
assertNotContains
Asserts that string (haystack) does not contain specified text (needle), starting at offset (inhaystack).- Parameters:
msg- the assertion messagehaystack- the text to search inneedle- the text to search foroffset- the offset in (haystack) to perform search from
-
assertStartsWith
-