Skip to content

Commit 1822ced

Browse files
1 parent 8c972a0 commit 1822ced

39 files changed

+192
-197
lines changed

src/test/java/org/codehaus/plexus/archiver/AbstractArchiverTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected void close() throws IOException {
3434
}
3535

3636
@Test
37-
void testModesAndOverridesAreUnsetByDefault() {
37+
void modesAndOverridesAreUnsetByDefault() {
3838
assertEquals(-1, archiver.getDefaultFileMode());
3939
assertEquals(-1, archiver.getOverrideFileMode());
4040

@@ -43,13 +43,13 @@ void testModesAndOverridesAreUnsetByDefault() {
4343
}
4444

4545
@Test
46-
void testWhenUnsetModeUsesDefault() {
46+
void whenUnsetModeUsesDefault() {
4747
assertEquals(Archiver.DEFAULT_FILE_MODE, archiver.getFileMode());
4848
assertEquals(Archiver.DEFAULT_DIR_MODE, archiver.getDirectoryMode());
4949
}
5050

5151
@Test
52-
void testSetModeIsUsedWithFlagsForType() {
52+
void setModeIsUsedWithFlagsForType() {
5353
archiver.setFileMode(0400);
5454
assertEquals(0100400, archiver.getFileMode());
5555

@@ -58,7 +58,7 @@ void testSetModeIsUsedWithFlagsForType() {
5858
}
5959

6060
@Test
61-
void testSetDefaultIncludesFlagsForType() {
61+
void setDefaultIncludesFlagsForType() {
6262
archiver.setDefaultFileMode(0400);
6363
assertEquals(0100400, archiver.getDefaultFileMode());
6464

@@ -67,7 +67,7 @@ void testSetDefaultIncludesFlagsForType() {
6767
}
6868

6969
@Test
70-
void testDefaultIsUsedWhenModeIsUnset() {
70+
void defaultIsUsedWhenModeIsUnset() {
7171
archiver.setDefaultFileMode(0400);
7272
assertEquals(0100400, archiver.getFileMode());
7373

@@ -76,7 +76,7 @@ void testDefaultIsUsedWhenModeIsUnset() {
7676
}
7777

7878
@Test
79-
void testOverridesCanBeReset() {
79+
void overridesCanBeReset() {
8080
archiver.setFileMode(0400);
8181
archiver.setFileMode(-1);
8282
assertEquals(-1, archiver.getOverrideFileMode());
@@ -87,7 +87,7 @@ void testOverridesCanBeReset() {
8787
}
8888

8989
@Test
90-
void testSetDestFileInTheWorkingDir() {
90+
void setDestFileInTheWorkingDir() {
9191
archiver.setDestFile(new File("archive"));
9292
}
9393
}

src/test/java/org/codehaus/plexus/archiver/AbstractUnArchiverTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.codehaus.plexus.archiver;
1818

1919
import java.io.File;
20-
import java.io.IOException;
2120
import java.util.Date;
2221

2322
import org.codehaus.plexus.components.io.filemappers.FileMapper;
@@ -60,7 +59,7 @@ void tearDown() {
6059
}
6160

6261
@Test
63-
void shouldThrowExceptionBecauseRewrittenPathIsOutOfDirectory(@TempDir File targetFolder) throws ArchiverException {
62+
void shouldThrowExceptionBecauseRewrittenPathIsOutOfDirectory(@TempDir File targetFolder) throws Exception {
6463
// given
6564

6665
// The prefix includes the target directory name to make sure we catch cases when the paths
@@ -81,7 +80,7 @@ void shouldThrowExceptionBecauseRewrittenPathIsOutOfDirectory(@TempDir File targ
8180
}
8281

8382
@Test
84-
void shouldExtractWhenFileOnDiskDoesNotExist(@TempDir File temporaryFolder) throws IOException {
83+
void shouldExtractWhenFileOnDiskDoesNotExist(@TempDir File temporaryFolder) throws Exception {
8584
// given
8685
File file = new File(temporaryFolder, "whatever.txt"); // does not create the file!
8786
String entryname = file.getName();
@@ -95,7 +94,7 @@ void shouldExtractWhenFileOnDiskDoesNotExist(@TempDir File temporaryFolder) thro
9594
}
9695

9796
@Test
98-
void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive(@TempDir File temporaryFolder) throws IOException {
97+
void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive(@TempDir File temporaryFolder) throws Exception {
9998
// given
10099
File file = new File(temporaryFolder, "whatever.txt");
101100
file.createNewFile();
@@ -112,7 +111,7 @@ void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive(@TempDir File temporar
112111

113112
@Test
114113
void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive_andWarnAboutDifferentCasing(@TempDir File temporaryFolder)
115-
throws IOException {
114+
throws Exception {
116115
// given
117116
File file = new File(temporaryFolder, "whatever.txt");
118117
file.createNewFile();
@@ -126,7 +125,7 @@ void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive_andWarnAboutDifferentC
126125
}
127126

128127
@Test
129-
void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDisk(@TempDir File temporaryFolder) throws IOException {
128+
void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDisk(@TempDir File temporaryFolder) throws Exception {
130129
// given
131130
File file = new File(temporaryFolder, "whatever.txt");
132131
file.createNewFile();
@@ -143,7 +142,7 @@ void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDisk(@TempDir File temporar
143142

144143
@Test
145144
void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDiskAndWarnAboutDifferentCasing(@TempDir File temporaryFolder)
146-
throws IOException {
145+
throws Exception {
147146
// given
148147
File file = new File(temporaryFolder, "whatever.txt");
149148
file.createNewFile();
@@ -160,7 +159,7 @@ void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDiskAndWarnAboutDifferentCa
160159
}
161160

162161
@Test
163-
void shouldNotWarnAboutDifferentCasingForDirectoryEntries(@TempDir File temporaryFolder) throws IOException {
162+
void shouldNotWarnAboutDifferentCasingForDirectoryEntries(@TempDir File temporaryFolder) throws Exception {
164163
// given
165164
File file = new File(temporaryFolder, "whatever.txt");
166165
file.createNewFile();
@@ -175,7 +174,7 @@ void shouldNotWarnAboutDifferentCasingForDirectoryEntries(@TempDir File temporar
175174
}
176175

177176
@Test
178-
void shouldExtractWhenCasingDifferOnlyInEntryNamePath(@TempDir File temporaryFolder) throws IOException {
177+
void shouldExtractWhenCasingDifferOnlyInEntryNamePath(@TempDir File temporaryFolder) throws Exception {
179178
// given
180179
String entryName = "directory/whatever.txt";
181180
File file = new File(temporaryFolder, entryName); // does not create the file!

src/test/java/org/codehaus/plexus/archiver/DotDirectiveArchiveFinalizerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class DotDirectiveArchiveFinalizerTest extends TestSupport {
1515

1616
@Test
17-
void testDotDirectiveArchiveFinalizer() throws Exception {
17+
void dotDirectiveArchiveFinalizer() throws Exception {
1818
DotDirectiveArchiveFinalizer ddaf =
1919
new DotDirectiveArchiveFinalizer(new File(getBasedir(), "src/test/dotfiles"));
2020

@@ -40,7 +40,7 @@ void testDotDirectiveArchiveFinalizer() throws Exception {
4040
}
4141

4242
@Test
43-
void testDefaultDotDirectiveBehaviour() throws Exception {
43+
void defaultDotDirectiveBehaviour() throws Exception {
4444
File dotFileDirectory = new File(getBasedir(), "src/test/dotfiles");
4545

4646
JarArchiver archiver = new JarArchiver();

src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DuplicateFilesTest extends TestSupport {
2929
private static final File destination = getTestFile("target/output/duplicateFiles");
3030

3131
@Test
32-
void testZipArchiver() throws Exception {
32+
void zipArchiver() throws Exception {
3333
Archiver archiver = lookup(Archiver.class, "zip");
3434
archiver.setDuplicateBehavior(Archiver.DUPLICATES_SKIP);
3535

@@ -55,14 +55,14 @@ void testZipArchiver() throws Exception {
5555
}
5656

5757
@Test
58-
void testDirArchiver() throws Exception {
58+
void dirArchiver() throws Exception {
5959
Archiver archiver = lookup(Archiver.class, "dir");
6060
createArchive(archiver, "dir");
6161
testFinalFile("target/output/duplicateFiles.dir/duplicateFiles/foo.txt");
6262
}
6363

6464
@Test
65-
void testTarArchiver() throws Exception {
65+
void tarArchiver() throws Exception {
6666
TarArchiver archiver = (TarArchiver) lookup(Archiver.class, "tar");
6767
archiver.setLongfile(TarLongFileMode.posix);
6868
archiver.setDuplicateBehavior(Archiver.DUPLICATES_SKIP);

src/test/java/org/codehaus/plexus/archiver/EmptyDirectoryTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@
3737
class EmptyDirectoryTest extends TestSupport {
3838

3939
@Test
40-
void testZipArchiver() throws Exception {
40+
void zipArchiver() throws Exception {
4141
testEmptyDirectory("zip", lookup(Archiver.class, "zip"));
4242
}
4343

4444
@Test
45-
void testJarArchiver() throws Exception {
45+
void jarArchiver() throws Exception {
4646
// No JAR UnArchiver implementation :(
4747
// testEmptyDirectory( "jar" );
4848
}
4949

5050
@Test
51-
void testTarArchiver() throws Exception {
51+
void tarArchiver() throws Exception {
5252
final TarArchiver tar = (TarArchiver) lookup(Archiver.class, "tar");
5353
tar.setLongfile(TarLongFileMode.posix);
5454
testEmptyDirectory("tar", tar);

src/test/java/org/codehaus/plexus/archiver/SymlinkTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.codehaus.plexus.archiver;
22

33
import java.io.File;
4-
import java.io.IOException;
54
import java.nio.file.Files;
65

76
import org.codehaus.plexus.archiver.dir.DirectoryArchiver;
@@ -24,30 +23,30 @@ class SymlinkTest extends TestSupport {
2423

2524
@Test
2625
@DisabledOnOs(OS.WINDOWS)
27-
void testSymlinkDir() throws IOException {
26+
void symlinkDir() throws Exception {
2827
File dummyContent = getTestFile("src/test/resources/symlinks/src/symDir");
2928
assertTrue(dummyContent.isDirectory());
3029
assertTrue(Files.isSymbolicLink(dummyContent.toPath()));
3130
}
3231

3332
@Test
3433
@DisabledOnOs(OS.WINDOWS)
35-
void testSymlinkDirWithSlash() throws IOException {
34+
void symlinkDirWithSlash() throws Exception {
3635
File dummyContent = getTestFile("src/test/resources/symlinks/src/symDir/");
3736
assertTrue(dummyContent.isDirectory());
3837
assertTrue(Files.isSymbolicLink(dummyContent.toPath()));
3938
}
4039

4140
@Test
4241
@DisabledOnOs(OS.WINDOWS)
43-
void testSymlinkFile() {
42+
void symlinkFile() {
4443
File dummyContent = getTestFile("src/test/resources/symlinks/src/symR");
4544
assertFalse(dummyContent.isDirectory());
4645
assertTrue(Files.isSymbolicLink(dummyContent.toPath()));
4746
}
4847

4948
@Test
50-
void testSymlinkTar() throws Exception {
49+
void symlinkTar() throws Exception {
5150
TarArchiver archiver = (TarArchiver) lookup(Archiver.class, "tar");
5251
archiver.setLongfile(TarLongFileMode.posix);
5352

@@ -67,7 +66,7 @@ void testSymlinkTar() throws Exception {
6766
}
6867

6968
@Test
70-
void testSymlinkZip() throws Exception {
69+
void symlinkZip() throws Exception {
7170
ZipArchiver archiver = (ZipArchiver) lookup(Archiver.class, "zip");
7271

7372
File dummyContent = getTestFile("src/test/resources/symlinks/src");
@@ -89,7 +88,7 @@ void testSymlinkZip() throws Exception {
8988

9089
@Test
9190
@DisabledOnOs(OS.WINDOWS)
92-
void testSymlinkDirArchiver() throws Exception {
91+
void symlinkDirArchiver() throws Exception {
9392
DirectoryArchiver archiver = (DirectoryArchiver) lookup(Archiver.class, "dir");
9493

9594
File dummyContent = getTestFile("src/test/resources/symlinks/src");

src/test/java/org/codehaus/plexus/archiver/bzip2/BZip2ArchiverTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.junit.jupiter.api.Test;
4040

4141
import static org.junit.jupiter.api.Assertions.assertEquals;
42-
import static org.junit.jupiter.api.Assertions.assertFalse;
42+
import static org.junit.jupiter.api.Assertions.assertNotSame;
4343
import static org.junit.jupiter.api.Assertions.assertTrue;
4444
import static org.junit.jupiter.api.Assertions.fail;
4545

@@ -49,7 +49,7 @@
4949
class BZip2ArchiverTest extends BasePlexusArchiverTest {
5050

5151
@Test
52-
void testCreateArchive() throws Exception {
52+
void createArchive() throws Exception {
5353
ZipArchiver zipArchiver = (ZipArchiver) lookup(Archiver.class, "zip");
5454
zipArchiver.addDirectory(getTestFile("src"));
5555
zipArchiver.setDestFile(getTestFile("target/output/archiveForbz2.zip"));
@@ -63,7 +63,7 @@ void testCreateArchive() throws Exception {
6363
}
6464

6565
@Test
66-
void testCreateEmptyArchive() throws Exception {
66+
void createEmptyArchive() throws Exception {
6767
BZip2Archiver archiver = (BZip2Archiver) lookup(Archiver.class, "bzip2");
6868
archiver.setDestFile(getTestFile("target/output/empty.bz2"));
6969
try {
@@ -75,7 +75,7 @@ void testCreateEmptyArchive() throws Exception {
7575
}
7676

7777
@Test
78-
void testCreateResourceCollection() throws Exception {
78+
void createResourceCollection() throws Exception {
7979
final File pomFile = new File("pom.xml");
8080
final File bz2File = new File("target/output/pom.xml.bz2");
8181
BZip2Archiver bzip2Archiver = (BZip2Archiver) lookup(Archiver.class, "bzip2");
@@ -111,7 +111,7 @@ void testCreateResourceCollection() throws Exception {
111111
* @throws Exception
112112
*/
113113
@Test
114-
void testBz2IsForcedBehaviour() throws Exception {
114+
void bz2IsForcedBehaviour() throws Exception {
115115
BZip2Archiver bZip2Archiver = (BZip2Archiver) createArchiver("bzip2");
116116

117117
assertTrue(bZip2Archiver.isSupportingForced());
@@ -128,7 +128,7 @@ void testBz2IsForcedBehaviour() throws Exception {
128128

129129
final long firstRunTime = bZip2Archiver.getDestFile().lastModified();
130130

131-
assertFalse(creationTime == firstRunTime);
131+
assertNotSame(creationTime, firstRunTime);
132132

133133
bZip2Archiver = (BZip2Archiver) createArchiver("bzip2");
134134

src/test/java/org/codehaus/plexus/archiver/gzip/GZipArchiverTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
class GZipArchiverTest extends BasePlexusArchiverTest {
5050

5151
@Test
52-
void testCreateArchive() throws Exception {
52+
void createArchive() throws Exception {
5353
ZipArchiver zipArchiver = (ZipArchiver) lookup(Archiver.class, "zip");
5454
zipArchiver.addDirectory(getTestFile("src"));
5555
zipArchiver.setDestFile(getTestFile("target/output/archiveForGzip.zip"));
@@ -63,7 +63,7 @@ void testCreateArchive() throws Exception {
6363
}
6464

6565
@Test
66-
void testCreateEmptyArchive() throws Exception {
66+
void createEmptyArchive() throws Exception {
6767
GZipArchiver archiver = (GZipArchiver) lookup(Archiver.class, "gzip");
6868
archiver.setDestFile(getTestFile("target/output/empty.gz"));
6969
try {
@@ -75,7 +75,7 @@ void testCreateEmptyArchive() throws Exception {
7575
}
7676

7777
@Test
78-
void testCreateResourceCollection() throws Exception {
78+
void createResourceCollection() throws Exception {
7979
final File pomFile = new File("pom.xml");
8080
final File gzFile = new File("target/output/pom.xml.gz");
8181
GZipArchiver gzipArchiver = (GZipArchiver) lookup(Archiver.class, "gzip");
@@ -108,7 +108,7 @@ void testCreateResourceCollection() throws Exception {
108108
* @throws Exception
109109
*/
110110
@Test
111-
void testTarGzIsForcedBehaviour() throws Exception {
111+
void tarGzIsForcedBehaviour() throws Exception {
112112
GZipArchiver gZipArchiver = (GZipArchiver) createArchiver("gzip");
113113

114114
assertTrue(gZipArchiver.isSupportingForced());

src/test/java/org/codehaus/plexus/archiver/jar/BaseJarArchiverTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.codehaus.plexus.archiver.jar;
1818

1919
import java.io.File;
20-
import java.io.IOException;
2120
import java.io.InputStream;
2221
import java.nio.file.Files;
2322
import java.nio.file.Paths;
@@ -28,7 +27,6 @@
2827
import java.util.zip.ZipEntry;
2928
import java.util.zip.ZipFile;
3029

31-
import org.codehaus.plexus.archiver.ArchiverException;
3230
import org.codehaus.plexus.util.IOUtil;
3331
import org.junit.jupiter.api.Test;
3432

@@ -42,7 +40,7 @@ public abstract class BaseJarArchiverTest {
4240
* could create basic JAR file
4341
*/
4442
@Test
45-
void testCreateJar() throws IOException, ArchiverException {
43+
void createJar() throws Exception {
4644
File jarFile = new File("target/output/testJar.jar");
4745
jarFile.delete();
4846

0 commit comments

Comments
 (0)