org.eclipse.jetty.toolchain.test
Class StringAssert

java.lang.Object
  extended by org.eclipse.jetty.toolchain.test.StringAssert

public final class StringAssert
extends Object


Method Summary
static void assertContains(String msg, String haystack, String needle)
          Asserts that string (haystack) contains specified text ( needle).
static void assertContains(String msg, String haystack, String needle, int offset)
          Asserts that string (haystack) contains specified text ( needle), starting at offset (in haystack).
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)
static void assertNotContains(String msg, String haystack, String needle)
          Asserts that string (haystack) does not contain specified text (needle).
static void assertNotContains(String msg, String haystack, String needle, int offset)
          Asserts that string (haystack) does not contain specified text (needle), starting at offset (in haystack).
static void assertStartsWith(String msg, String haystack, String expected)
          Asserts that the string (haystack) starts with the string ( expected)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertContains

public static void assertContains(String msg,
                                  String haystack,
                                  String needle)
Asserts that string (haystack) contains specified text ( needle).

Parameters:
msg - the assertion message
haystack - the text to search in
needle - the text to search for

assertContains

public static void assertContains(String msg,
                                  String haystack,
                                  String needle,
                                  int offset)
Asserts that string (haystack) contains specified text ( needle), starting at offset (in haystack).

Parameters:
msg - the assertion message
haystack - the text to search in
needle - the text to search for
offset - 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 message
linesExpected - the list of expected lines
linesActual - the list of actual lines

assertNotContains

public static void assertNotContains(String msg,
                                     String haystack,
                                     String needle)
Asserts that string (haystack) does not contain specified text (needle).

Parameters:
msg - the assertion message
haystack - the text to search in
needle - the text to search for

assertNotContains

public static void assertNotContains(String msg,
                                     String haystack,
                                     String needle,
                                     int offset)
Asserts that string (haystack) does not contain specified text (needle), starting at offset (in haystack).

Parameters:
msg - the assertion message
haystack - the text to search in
needle - the text to search for
offset - the offset in (haystack) to perform search from

assertStartsWith

public static void assertStartsWith(String msg,
                                    String haystack,
                                    String expected)
Asserts that the string (haystack) starts with the string ( expected)

Parameters:
msg - the assertion message
haystack - the text to search in
expected - the expected starts with text


Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.