Class RepositoryModificationTestHelper


  • public class RepositoryModificationTestHelper
    extends Object
    Helper to apply modifications to working copies of repositories in order to test various operations, e.g. committing changes.
    • Method Detail

      • leaveCheckoutPathUnmodified

        public static void leaveCheckoutPathUnmodified​(@NotNull
                                                       @NotNull File checkoutPath)
        Do nothing with the working copy.
      • createFileInCheckoutPath

        public static void createFileInCheckoutPath​(@NotNull
                                                    @NotNull File checkoutPath)
        Create a random file in the working copy.
      • deleteFileFromCheckoutPath

        public static void deleteFileFromCheckoutPath​(@NotNull
                                                      @NotNull File checkoutPath)
        Delete a random file from the working copy. Will perform a recursive search.
      • modifyFileInCheckoutPath

        public static void modifyFileInCheckoutPath​(@NotNull
                                                    @NotNull File checkoutPath)
        Modifies content of a random file in the working copy. Will perform a recursive search.
      • getRepositoryTrackedFile

        @Nullable
        public static @Nullable File getRepositoryTrackedFile​(@NotNull
                                                              @NotNull File fileOrDirectory)
        Try to find any repository tracked file.
        Parameters:
        fileOrDirectory - either a directory to scan or a file to test
        Returns:
        any file which is not a special repository file, or null if no file qualified