Class PathSubject


  • public class PathSubject
    extends com.google.common.truth.Subject<PathSubject,​java.nio.file.Path>
    Truth support for validating java.nio.file.Path.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.common.truth.Subject

        com.google.common.truth.Subject.Factory<SubjectT extends com.google.common.truth.Subject<SubjectT,​ActualT>,​ActualT extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      PathSubject​(com.google.common.truth.FailureMetadata failureMetadata, java.nio.file.Path subject)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static PathSubject assertThat​(java.io.File file)  
      static PathSubject assertThat​(java.nio.file.Path path)  
      void contains​(java.lang.String expectedContent)  
      void containsAllOf​(java.lang.String... expectedContents)  
      void containsFile​(java.lang.String fileName)
      Asserts that the directory tree contains a file with the given name.
      void contentWithUnixLineSeparatorsIsExactly​(java.lang.String expected)  
      void doesNotContain​(java.lang.String expectedContent)  
      void doesNotContainFile​(java.lang.String fileName)
      Asserts that the directory tree does not contains a file with the given name.
      void doesNotExist()  
      void exists()  
      void hasContents​(byte[] expectedContents)  
      void hasContents​(java.lang.String... expectedContents)  
      void hasName​(java.lang.String name)  
      void isDirectory()  
      void isEqualTo​(java.io.File expected)  
      void isExecutable()  
      void isFile()  
      void isNewerThan​(long expectedTimeMillis)  
      void isNewerThan​(java.nio.file.attribute.FileTime expectedTime)  
      void isNotEqualTo​(java.io.File unexpected)  
      void isReadable()  
      void isWritable()  
      static com.google.common.truth.Subject.Factory<PathSubject,​java.nio.file.Path> paths()  
      void wasModifiedAt​(long expectedTimeMillis)  
      void wasModifiedAt​(java.nio.file.attribute.FileTime expectedTime)  
      • Methods inherited from class com.google.common.truth.Subject

        actual, actualAsString, actualCustomStringRepresentation, check, check, equals, fail, fail, fail, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutSubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNotSameInstanceAs, isNull, isSameAs, isSameInstanceAs, named, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PathSubject

        public PathSubject​(@NonNull
                           com.google.common.truth.FailureMetadata failureMetadata,
                           @Nullable
                           java.nio.file.Path subject)
    • Method Detail

      • paths

        public static com.google.common.truth.Subject.Factory<PathSubject,​java.nio.file.Path> paths()
      • isEqualTo

        public void isEqualTo​(@Nullable
                              java.io.File expected)
      • isNotEqualTo

        public void isNotEqualTo​(@Nullable
                                 java.io.File unexpected)
      • assertThat

        public static PathSubject assertThat​(@Nullable
                                             java.nio.file.Path path)
      • assertThat

        public static PathSubject assertThat​(@Nullable
                                             java.io.File file)
      • hasName

        public void hasName​(@NonNull
                            java.lang.String name)
      • exists

        public void exists()
      • doesNotExist

        public void doesNotExist()
      • isFile

        public void isFile()
      • isDirectory

        public void isDirectory()
      • isReadable

        public void isReadable()
      • isWritable

        public void isWritable()
      • isExecutable

        public void isExecutable()
      • hasContents

        public void hasContents​(@NonNull
                                byte[] expectedContents)
      • hasContents

        public void hasContents​(@NonNull
                                java.lang.String... expectedContents)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • contentWithUnixLineSeparatorsIsExactly

        public void contentWithUnixLineSeparatorsIsExactly​(@NonNull
                                                           java.lang.String expected)
      • contains

        public void contains​(@NonNull
                             java.lang.String expectedContent)
      • containsAllOf

        public void containsAllOf​(@NonNull
                                  java.lang.String... expectedContents)
      • doesNotContain

        public void doesNotContain​(@NonNull
                                   java.lang.String expectedContent)
      • wasModifiedAt

        public void wasModifiedAt​(@NonNull
                                  java.nio.file.attribute.FileTime expectedTime)
      • wasModifiedAt

        public void wasModifiedAt​(long expectedTimeMillis)
      • isNewerThan

        public void isNewerThan​(@NonNull
                                java.nio.file.attribute.FileTime expectedTime)
      • isNewerThan

        public void isNewerThan​(long expectedTimeMillis)
      • containsFile

        public void containsFile​(@NonNull
                                 java.lang.String fileName)
        Asserts that the directory tree contains a file with the given name.
      • doesNotContainFile

        public void doesNotContainFile​(@NonNull
                                       java.lang.String fileName)
        Asserts that the directory tree does not contains a file with the given name.