Class FileExists

java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<Path>
com._1c.g5.v8.dt.testing.matchers.FileExists
All Implemented Interfaces:
org.hamcrest.Matcher<Path>, org.hamcrest.SelfDescribing

public class FileExists extends org.hamcrest.TypeSafeMatcher<Path>
Matcher that matches if the examined Path does or does not exist.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    describeMismatchSafely(Path item, org.hamcrest.Description description)
     
    void
    describeTo(org.hamcrest.Description description)
     
    static org.hamcrest.Matcher<Path>
    Creates a matcher that matches if the examined Path exists.
    protected boolean
     
    static org.hamcrest.Matcher<Path>
    Creates a matcher that matches if the examined Path does not exist.

    Methods inherited from class org.hamcrest.TypeSafeMatcher

    describeMismatch, matches

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • describeMismatchSafely

      protected void describeMismatchSafely(Path item, org.hamcrest.Description description)
      Overrides:
      describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<Path>
    • matchesSafely

      protected boolean matchesSafely(Path path)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<Path>
    • exists

      public static org.hamcrest.Matcher<Path> exists()
      Creates a matcher that matches if the examined Path exists.

      For example:

       assertThat(Paths.get("path/to/some/file"), exists())
       
    • notExists

      public static org.hamcrest.Matcher<Path> notExists()
      Creates a matcher that matches if the examined Path does not exist.

      For example:

       assertThat(Paths.get("path/to/some/file"), notExists())