Class StringAssert

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

@Deprecated(forRemoval=true, since="6.0") public final class StringAssert extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
use Hamcrest assertThat() techniques
Collection of common asserts for Strings.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assertContains(String msg, String haystack, String needle)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use assertThat(msg, haystack, containsString(needle)); instead
    static void
    assertContains(String msg, String haystack, String needle, int offset)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use assertThat(msg, haystack.substring(offset), containsString(needle)); instead
    static void
    assertContainsSame(String msg, List<String> linesExpected, List<String> linesActual)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use assertThat(msg, linesActual, containsInAnyOrder(linesExpected.toArray())); instead
    static void
    assertNotContains(String msg, String haystack, String needle)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use assertThat(msg, haystack, not(containsString(needle))); instead
    static void
    assertNotContains(String msg, String haystack, String needle, int offset)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use assertThat(msg, haystack.substring(offset), not(containsString(needle))); instead
    static void
    assertStartsWith(String msg, String haystack, String expected)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use assertThat(msg, haystack, startsWith(expected)); instead

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StringAssert

      private StringAssert()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • assertContains

      @Deprecated(forRemoval=true, since="6.0") public static void assertContains(String msg, String haystack, String needle)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use assertThat(msg, haystack, containsString(needle)); instead
      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

      @Deprecated(forRemoval=true, since="6.0") public static void assertContains(String msg, String haystack, String needle, int offset)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use assertThat(msg, haystack.substring(offset), containsString(needle)); instead
      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

      @Deprecated(forRemoval=true, since="6.0") public static void assertContainsSame(String msg, List<String> linesExpected, List<String> linesActual)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use assertThat(msg, linesActual, containsInAnyOrder(linesExpected.toArray())); instead
      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

      @Deprecated(forRemoval=true, since="6.0") public static void assertNotContains(String msg, String haystack, String needle)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use assertThat(msg, haystack, not(containsString(needle))); instead
      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

      @Deprecated(forRemoval=true, since="6.0") public static void assertNotContains(String msg, String haystack, String needle, int offset)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use assertThat(msg, haystack.substring(offset), not(containsString(needle))); instead
      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

      @Deprecated(forRemoval=true, since="6.0") public static void assertStartsWith(String msg, String haystack, String expected)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use assertThat(msg, haystack, startsWith(expected)); instead
      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