]> source.dussan.org Git - jgit.git/commitdiff
ExternalToolTest: Rename class name to usual name for test cases 55/189455/3
authorDavid Ostrovsky <david@ostrovsky.org>
Mon, 10 Jan 2022 20:18:24 +0000 (21:18 +0100)
committerDavid Ostrovsky <david@ostrovsky.org>
Thu, 20 Jan 2022 05:52:13 +0000 (06:52 +0100)
Change-Id: I00e4a5e73f530b7ac671d09b9b447bb24d6419fa

org.eclipse.jgit.test/BUILD
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/diffmergetool/ExternalDiffToolTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/diffmergetool/ExternalToolTest.java [deleted file]
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/diffmergetool/ExternalToolTestCase.java [new file with mode: 0644]

index ed73539004ea0ae0826232e58bf5c3885fc0fcf9..6f6c88ce8d4b7301881d46663d5fbf1c76e2e541 100644 (file)
@@ -13,7 +13,7 @@ HELPERS = glob(
 ) + [PKG + c for c in [
     "api/AbstractRemoteCommandTest.java",
     "diff/AbstractDiffTestCase.java",
-    "internal/diffmergetool/ExternalToolTest.java",
+    "internal/diffmergetool/ExternalToolTestCase.java",
     "internal/revwalk/ObjectReachabilityTestCase.java",
     "internal/revwalk/ReachabilityCheckerTestCase.java",
     "internal/storage/file/GcTestCase.java",
index b141a86f76c75865c956580c1e76dfbaead5b365..c9ebec763841ab4ada6b795125881c763b88a5b4 100644 (file)
@@ -30,7 +30,7 @@ import org.junit.Test;
 /**
  * Testing external diff tools.
  */
-public class ExternalDiffToolTest extends ExternalToolTest {
+public class ExternalDiffToolTest extends ExternalToolTestCase {
 
        @Test
        public void testToolNames() {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/diffmergetool/ExternalToolTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/diffmergetool/ExternalToolTest.java
deleted file mode 100644 (file)
index c7c8eca..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2020-2021, Simeon Andreev <simeon.danailov.andreev@gmail.com> and others.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Distribution License v. 1.0 which is available at
- * https://www.eclipse.org/org/documents/edl-v10.php.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-package org.eclipse.jgit.internal.diffmergetool;
-
-import java.io.File;
-import java.nio.file.Files;
-
-import org.eclipse.jgit.junit.RepositoryTestCase;
-import org.eclipse.jgit.util.FS;
-import org.eclipse.jgit.util.FS_POSIX;
-import org.junit.After;
-import org.junit.Assume;
-import org.junit.Before;
-
-/**
- * Base test case for external merge and diff tool tests.
- */
-public abstract class ExternalToolTest extends RepositoryTestCase {
-
-       protected static final String DEFAULT_CONTENT = "line1";
-
-       protected File localFile;
-
-       protected File remoteFile;
-
-       protected File mergedFile;
-
-       protected File baseFile;
-
-       protected File commandResult;
-
-       @Before
-       @Override
-       public void setUp() throws Exception {
-               super.setUp();
-
-               localFile = writeTrashFile("localFile.txt", DEFAULT_CONTENT + "\n");
-               localFile.deleteOnExit();
-               remoteFile = writeTrashFile("remoteFile.txt", DEFAULT_CONTENT + "\n");
-               remoteFile.deleteOnExit();
-               mergedFile = writeTrashFile("mergedFile.txt", "");
-               mergedFile.deleteOnExit();
-               baseFile = writeTrashFile("baseFile.txt", "");
-               baseFile.deleteOnExit();
-               commandResult = writeTrashFile("commandResult.txt", "");
-               commandResult.deleteOnExit();
-       }
-
-       @After
-       @Override
-       public void tearDown() throws Exception {
-               Files.delete(localFile.toPath());
-               Files.delete(remoteFile.toPath());
-               Files.delete(mergedFile.toPath());
-               Files.delete(baseFile.toPath());
-               Files.delete(commandResult.toPath());
-
-               super.tearDown();
-       }
-
-
-       protected static void assumePosixPlatform() {
-               Assume.assumeTrue(
-                               "This test can run only in Linux tests",
-                               FS.DETECTED instanceof FS_POSIX);
-       }
-}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/diffmergetool/ExternalToolTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/diffmergetool/ExternalToolTestCase.java
new file mode 100644 (file)
index 0000000..0cc1297
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2020-2021, Simeon Andreev <simeon.danailov.andreev@gmail.com> and others.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+package org.eclipse.jgit.internal.diffmergetool;
+
+import java.io.File;
+import java.nio.file.Files;
+
+import org.eclipse.jgit.junit.RepositoryTestCase;
+import org.eclipse.jgit.util.FS;
+import org.eclipse.jgit.util.FS_POSIX;
+import org.junit.After;
+import org.junit.Assume;
+import org.junit.Before;
+
+/**
+ * Base test case for external merge and diff tool tests.
+ */
+public abstract class ExternalToolTestCase extends RepositoryTestCase {
+
+       protected static final String DEFAULT_CONTENT = "line1";
+
+       protected File localFile;
+
+       protected File remoteFile;
+
+       protected File mergedFile;
+
+       protected File baseFile;
+
+       protected File commandResult;
+
+       @Before
+       @Override
+       public void setUp() throws Exception {
+               super.setUp();
+
+               localFile = writeTrashFile("localFile.txt", DEFAULT_CONTENT + "\n");
+               localFile.deleteOnExit();
+               remoteFile = writeTrashFile("remoteFile.txt", DEFAULT_CONTENT + "\n");
+               remoteFile.deleteOnExit();
+               mergedFile = writeTrashFile("mergedFile.txt", "");
+               mergedFile.deleteOnExit();
+               baseFile = writeTrashFile("baseFile.txt", "");
+               baseFile.deleteOnExit();
+               commandResult = writeTrashFile("commandResult.txt", "");
+               commandResult.deleteOnExit();
+       }
+
+       @After
+       @Override
+       public void tearDown() throws Exception {
+               Files.delete(localFile.toPath());
+               Files.delete(remoteFile.toPath());
+               Files.delete(mergedFile.toPath());
+               Files.delete(baseFile.toPath());
+               Files.delete(commandResult.toPath());
+
+               super.tearDown();
+       }
+
+
+       protected static void assumePosixPlatform() {
+               Assume.assumeTrue(
+                               "This test can run only in Linux tests",
+                               FS.DETECTED instanceof FS_POSIX);
+       }
+}