Skip to content

Commit 8b8d277

Browse files
1 parent 481a9c2 commit 8b8d277

40 files changed

+225
-228
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ bin
77
*.iml
88
*.iws
99
.idea
10-
11-
12-
10+
.DS_Store

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
import static org.junit.jupiter.api.Assertions.assertEquals;
1010

11-
public class AbstractArchiverTest {
11+
class AbstractArchiverTest {
1212

1313
private AbstractArchiver archiver;
1414

1515
@BeforeEach
16-
public void setUp() throws Exception {
16+
void setUp() throws Exception {
1717
this.archiver = new AbstractArchiver() {
1818

1919
@Override
@@ -34,7 +34,7 @@ protected void close() throws IOException {
3434
}
3535

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

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

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

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

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

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

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

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

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

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

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

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

+13-14
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
*
3737
* @author <a href="mailto:[email protected]">Markus KARG</a>
3838
*/
39-
public class AbstractUnArchiverTest {
39+
class AbstractUnArchiverTest {
4040
private AbstractUnArchiver abstractUnArchiver;
4141

4242
@BeforeEach
43-
public void setUp() {
43+
void setUp() {
4444
this.abstractUnArchiver = new AbstractUnArchiver() {
4545
@Override
4646
protected void execute(final String path, final File outputDirectory) throws ArchiverException {
@@ -55,13 +55,12 @@ protected void execute() throws ArchiverException {
5555
}
5656

5757
@AfterEach
58-
public void tearDown() {
58+
void tearDown() {
5959
this.abstractUnArchiver = null;
6060
}
6161

6262
@Test
63-
public void shouldThrowExceptionBecauseRewrittenPathIsOutOfDirectory(@TempDir File targetFolder)
64-
throws ArchiverException {
63+
void shouldThrowExceptionBecauseRewrittenPathIsOutOfDirectory(@TempDir File targetFolder) throws ArchiverException {
6564
// given
6665

6766
// The prefix includes the target directory name to make sure we catch cases when the paths
@@ -82,7 +81,7 @@ public void shouldThrowExceptionBecauseRewrittenPathIsOutOfDirectory(@TempDir Fi
8281
}
8382

8483
@Test
85-
public void shouldExtractWhenFileOnDiskDoesNotExist(@TempDir File temporaryFolder) throws IOException {
84+
void shouldExtractWhenFileOnDiskDoesNotExist(@TempDir File temporaryFolder) throws IOException {
8685
// given
8786
File file = new File(temporaryFolder, "whatever.txt"); // does not create the file!
8887
String entryname = file.getName();
@@ -96,7 +95,7 @@ public void shouldExtractWhenFileOnDiskDoesNotExist(@TempDir File temporaryFolde
9695
}
9796

9897
@Test
99-
public void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive(@TempDir File temporaryFolder) throws IOException {
98+
void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive(@TempDir File temporaryFolder) throws IOException {
10099
// given
101100
File file = new File(temporaryFolder, "whatever.txt");
102101
file.createNewFile();
@@ -112,8 +111,8 @@ public void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive(@TempDir File t
112111
}
113112

114113
@Test
115-
public void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive_andWarnAboutDifferentCasing(
116-
@TempDir File temporaryFolder) throws IOException {
114+
void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive_andWarnAboutDifferentCasing(@TempDir File temporaryFolder)
115+
throws IOException {
117116
// given
118117
File file = new File(temporaryFolder, "whatever.txt");
119118
file.createNewFile();
@@ -127,7 +126,7 @@ public void shouldExtractWhenFileOnDiskIsNewerThanEntryInArchive_andWarnAboutDif
127126
}
128127

129128
@Test
130-
public void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDisk(@TempDir File temporaryFolder) throws IOException {
129+
void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDisk(@TempDir File temporaryFolder) throws IOException {
131130
// given
132131
File file = new File(temporaryFolder, "whatever.txt");
133132
file.createNewFile();
@@ -143,8 +142,8 @@ public void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDisk(@TempDir File t
143142
}
144143

145144
@Test
146-
public void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDiskAndWarnAboutDifferentCasing(
147-
@TempDir File temporaryFolder) throws IOException {
145+
void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDiskAndWarnAboutDifferentCasing(@TempDir File temporaryFolder)
146+
throws IOException {
148147
// given
149148
File file = new File(temporaryFolder, "whatever.txt");
150149
file.createNewFile();
@@ -161,7 +160,7 @@ public void shouldExtractWhenEntryInArchiveIsNewerThanFileOnDiskAndWarnAboutDiff
161160
}
162161

163162
@Test
164-
public void shouldNotWarnAboutDifferentCasingForDirectoryEntries(@TempDir File temporaryFolder) throws IOException {
163+
void shouldNotWarnAboutDifferentCasingForDirectoryEntries(@TempDir File temporaryFolder) throws IOException {
165164
// given
166165
File file = new File(temporaryFolder, "whatever.txt");
167166
file.createNewFile();
@@ -176,7 +175,7 @@ public void shouldNotWarnAboutDifferentCasingForDirectoryEntries(@TempDir File t
176175
}
177176

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

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
/**
1212
* @author Jason van Zyl
1313
*/
14-
public class DotDirectiveArchiveFinalizerTest extends TestSupport {
14+
class DotDirectiveArchiveFinalizerTest extends TestSupport {
1515

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

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

4242
@Test
43-
public void testDefaultDotDirectiveBehaviour() throws Exception {
43+
void testDefaultDotDirectiveBehaviour() 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

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* @author Erik Engstrom
2222
*/
23-
public class DuplicateFilesTest extends TestSupport {
23+
class DuplicateFilesTest extends TestSupport {
2424

2525
private static final File file1 = getTestFile("src/test/resources/group-writable/foo.txt");
2626

@@ -29,7 +29,7 @@ public class DuplicateFilesTest extends TestSupport {
2929
private static final File destination = getTestFile("target/output/duplicateFiles");
3030

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

@@ -53,14 +53,14 @@ public void testZipArchiver() throws Exception {
5353
}
5454

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

6262
@Test
63-
public void testTarArchiver() throws Exception {
63+
void testTarArchiver() throws Exception {
6464
TarArchiver archiver = (TarArchiver) lookup(Archiver.class, "tar");
6565
archiver.setLongfile(TarLongFileMode.posix);
6666
archiver.setDuplicateBehavior(Archiver.DUPLICATES_SKIP);

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@
3434
/**
3535
* @author Daniel Krisher
3636
*/
37-
public class EmptyDirectoryTest extends TestSupport {
37+
class EmptyDirectoryTest extends TestSupport {
3838

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

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

5050
@Test
51-
public void testTarArchiver() throws Exception {
51+
void testTarArchiver() 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

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,34 @@
2020
/**
2121
* @author Kristian Rosenvold
2222
*/
23-
public class SymlinkTest extends TestSupport {
23+
class SymlinkTest extends TestSupport {
2424

2525
@Test
2626
@DisabledOnOs(OS.WINDOWS)
27-
public void testSymlinkDir() throws IOException {
27+
void testSymlinkDir() throws IOException {
2828
File dummyContent = getTestFile("src/test/resources/symlinks/src/symDir");
2929
assertTrue(dummyContent.isDirectory());
3030
assertTrue(Files.isSymbolicLink(dummyContent.toPath()));
3131
}
3232

3333
@Test
3434
@DisabledOnOs(OS.WINDOWS)
35-
public void testSymlinkDirWithSlash() throws IOException {
35+
void testSymlinkDirWithSlash() throws IOException {
3636
File dummyContent = getTestFile("src/test/resources/symlinks/src/symDir/");
3737
assertTrue(dummyContent.isDirectory());
3838
assertTrue(Files.isSymbolicLink(dummyContent.toPath()));
3939
}
4040

4141
@Test
4242
@DisabledOnOs(OS.WINDOWS)
43-
public void testSymlinkFile() {
43+
void testSymlinkFile() {
4444
File dummyContent = getTestFile("src/test/resources/symlinks/src/symR");
4545
assertFalse(dummyContent.isDirectory());
4646
assertTrue(Files.isSymbolicLink(dummyContent.toPath()));
4747
}
4848

4949
@Test
50-
public void testSymlinkTar() throws Exception {
50+
void testSymlinkTar() throws Exception {
5151
TarArchiver archiver = (TarArchiver) lookup(Archiver.class, "tar");
5252
archiver.setLongfile(TarLongFileMode.posix);
5353

@@ -65,7 +65,7 @@ public void testSymlinkTar() throws Exception {
6565
}
6666

6767
@Test
68-
public void testSymlinkZip() throws Exception {
68+
void testSymlinkZip() throws Exception {
6969
ZipArchiver archiver = (ZipArchiver) lookup(Archiver.class, "zip");
7070

7171
File dummyContent = getTestFile("src/test/resources/symlinks/src");
@@ -85,7 +85,7 @@ public void testSymlinkZip() throws Exception {
8585

8686
@Test
8787
@DisabledOnOs(OS.WINDOWS)
88-
public void testSymlinkDirArchiver() throws Exception {
88+
void testSymlinkDirArchiver() throws Exception {
8989
DirectoryArchiver archiver = (DirectoryArchiver) lookup(Archiver.class, "dir");
9090

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

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
/**
4747
* @author Emmanuel Venisse
4848
*/
49-
public class BZip2ArchiverTest extends BasePlexusArchiverTest {
49+
class BZip2ArchiverTest extends BasePlexusArchiverTest {
5050

5151
@Test
52-
public void testCreateArchive() throws Exception {
52+
void testCreateArchive() 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 @@ public void testCreateArchive() throws Exception {
6363
}
6464

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

7777
@Test
78-
public void testCreateResourceCollection() throws Exception {
78+
void testCreateResourceCollection() 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 @@ public void testCreateResourceCollection() throws Exception {
111111
* @throws Exception
112112
*/
113113
@Test
114-
public void testBz2IsForcedBehaviour() throws Exception {
114+
void testBz2IsForcedBehaviour() throws Exception {
115115
BZip2Archiver bZip2Archiver = (BZip2Archiver) createArchiver("bzip2");
116116

117117
assertTrue(bZip2Archiver.isSupportingForced());

0 commit comments

Comments
 (0)