Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ void setup() {
"123.at.start.is.invalid",
"digit.at.123start.is.invalid"
})
void testInvalidModuleNames(String value) {
void invalidModuleNames(String value) {
assertThat(MavenArchiver.isValidModuleName(value)).isFalse();
}

@ParameterizedTest
@ValueSource(strings = {"a", "a.b", "a_b", "trailing0.digits123.are456.ok789", "UTF8.chars.are.okay.äëïöüẍ", "ℤ€ℕ"})
void testValidModuleNames(String value) {
void validModuleNames(String value) {
assertThat(MavenArchiver.isValidModuleName(value)).isTrue();
}

@Test
void testMultiClassPath() throws Exception {
void multiClassPath() throws Exception {
final File tempFile = File.createTempFile("maven-archiver-test-", ".jar");

try {
Expand Down Expand Up @@ -153,7 +153,7 @@ void testMultiClassPath() throws Exception {
}

@Test
void testRecreation() throws Exception {
void recreation() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -193,7 +193,7 @@ void testRecreation() throws Exception {
}

@Test
void testNotGenerateImplementationVersionForMANIFESTMF() throws Exception {
void notGenerateImplementationVersionForMANIFESTMF() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand All @@ -214,7 +214,7 @@ void testNotGenerateImplementationVersionForMANIFESTMF() throws Exception {
}

@Test
void testGenerateImplementationVersionForMANIFESTMF() throws Exception {
void generateImplementationVersionForMANIFESTMF() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -246,7 +246,7 @@ private MavenArchiver getMavenArchiver(JarArchiver jarArchiver) {
}

@Test
void testDashesInClassPathMSHARED134() {
void dashesInClassPathMSHARED134() {
File jarFile = new File("target/test/dummyWithDashes.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand All @@ -272,7 +272,7 @@ void testDashesInClassPathMSHARED134() {
}

@Test
void testDashesInClassPathMSHARED182() throws IOException {
void dashesInClassPathMSHARED182() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
MavenArchiver archiver = getMavenArchiver(jarArchiver);
Expand Down Expand Up @@ -300,7 +300,7 @@ void testDashesInClassPathMSHARED182() throws IOException {
}

@Test
void testCarriageReturnInManifestEntry() throws Exception {
void carriageReturnInManifestEntry() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -329,7 +329,7 @@ void testCarriageReturnInManifestEntry() throws Exception {
}

@Test
void testDeprecatedCreateArchiveAPI() throws Exception {
void deprecatedCreateArchiveAPI() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -359,7 +359,7 @@ void testDeprecatedCreateArchiveAPI() throws Exception {
}

@Test
void testMinimalManifestEntries() throws Exception {
void minimalManifestEntries() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand All @@ -381,7 +381,7 @@ void testMinimalManifestEntries() throws Exception {
}

@Test
void testManifestEntries() throws Exception {
void manifestEntries() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -454,7 +454,7 @@ void testManifestEntries() throws Exception {
}

@Test
void testManifestWithInvalidAutomaticModuleNameThrowsOnCreateArchive() throws Exception {
void manifestWithInvalidAutomaticModuleNameThrowsOnCreateArchive() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand All @@ -479,7 +479,7 @@ void testManifestWithInvalidAutomaticModuleNameThrowsOnCreateArchive() throws Ex
* Automatic-Module-Name attribute at all, but that the archive will be created.
*/
@Test
void testManifestWithEmptyAutomaticModuleName() throws Exception {
void manifestWithEmptyAutomaticModuleName() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand All @@ -505,7 +505,7 @@ void testManifestWithEmptyAutomaticModuleName() throws Exception {
// Test to make sure that manifest sections are present in the manifest prior to the archive has been created.
//
@Test
void testManifestSections() throws Exception {
void manifestSections() throws Exception {
MavenArchiver archiver = new MavenArchiver();

Project project = getDummyProject();
Expand Down Expand Up @@ -534,7 +534,7 @@ void testManifestSections() throws Exception {
}

@Test
void testDefaultClassPathValue() throws Exception {
void defaultClassPathValue() throws Exception {
Project project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand All @@ -561,7 +561,7 @@ void testDefaultClassPathValue() throws Exception {
}

@Test
void testDefaultClassPathValueWithSnapshot() throws Exception {
void defaultClassPathValueWithSnapshot() throws Exception {
Project project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -589,7 +589,7 @@ void testDefaultClassPathValueWithSnapshot() throws Exception {
}

@Test
void testMavenRepoClassPathValue() throws Exception {
void mavenRepoClassPathValue() throws Exception {
Project project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -831,7 +831,7 @@ void shouldCreateArchiveWithSimpleClassPathLayoutUsingDefaults() throws Exceptio
}

@Test
void testMavenRepoClassPathValueWithSnapshot() throws Exception {
void mavenRepoClassPathValueWithSnapshot() throws Exception {
Project project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -867,7 +867,7 @@ void testMavenRepoClassPathValueWithSnapshot() throws Exception {
}

@Test
void testCustomClassPathValue() throws Exception {
void customClassPathValue() throws Exception {
Project project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -906,7 +906,7 @@ void testCustomClassPathValue() throws Exception {
}

@Test
void testCustomClassPathValueWithSnapshotResolvedVersion() throws Exception {
void customClassPathValueWithSnapshotResolvedVersion() throws Exception {
Project project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -944,7 +944,7 @@ void testCustomClassPathValueWithSnapshotResolvedVersion() throws Exception {
}

@Test
void testCustomClassPathValueWithSnapshotForcingBaseVersion() throws Exception {
void customClassPathValueWithSnapshotForcingBaseVersion() throws Exception {
Project project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -980,7 +980,7 @@ void testCustomClassPathValueWithSnapshotForcingBaseVersion() throws Exception {
}

@Test
void testDefaultPomProperties() throws Exception {
void defaultPomProperties() throws Exception {
Project project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -1013,7 +1013,7 @@ void testDefaultPomProperties() throws Exception {
}

@Test
void testCustomPomProperties() throws Exception {
void customPomProperties() throws Exception {
Project project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -1235,7 +1235,7 @@ private Manifest getJarFileManifest(File jarFile) throws IOException {
}

@Test
void testParseOutputTimestamp() {
void parseOutputTimestamp() {
assertThat(MavenArchiver.parseBuildOutputTimestamp(null)).isEmpty();
assertThat(MavenArchiver.parseBuildOutputTimestamp("")).isEmpty();
assertThat(MavenArchiver.parseBuildOutputTimestamp(".")).isEmpty();
Expand Down Expand Up @@ -1275,7 +1275,7 @@ void testParseOutputTimestamp() {
@ParameterizedTest
@NullAndEmptySource
@ValueSource(strings = {".", " ", "_", "-", "T", "/", "!", "!", "*", "ñ"})
void testEmptyParseOutputTimestampInstant(String value) {
void emptyParseOutputTimestampInstant(String value) {
// Empty optional if null or 1 char
assertThat(MavenArchiver.parseBuildOutputTimestamp(value)).isEmpty();
}
Expand All @@ -1292,7 +1292,7 @@ void testEmptyParseOutputTimestampInstant(String value) {
"1980-01-01T00:00:02Z,315532802",
"2099-12-31T23:59:59Z,4102444799"
})
void testParseOutputTimestampInstant(String value, long expected) {
void parseOutputTimestampInstant(String value, long expected) {
assertThat(MavenArchiver.parseBuildOutputTimestamp(value)).contains(Instant.ofEpochSecond(expected));
}

Expand All @@ -1307,7 +1307,7 @@ void testParseOutputTimestampInstant(String value, long expected) {
"Tue, 3 Jun 2008 11:05:30 GMT",
"2011-12-03T10:15:30+01:00[Europe/Paris]"
})
void testThrownParseOutputTimestampInstant(String outputTimestamp) {
void thrownParseOutputTimestampInstant(String outputTimestamp) {
// Invalid parsing
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> MavenArchiver.parseBuildOutputTimestamp(outputTimestamp))
Expand All @@ -1322,7 +1322,7 @@ void testThrownParseOutputTimestampInstant(String outputTimestamp) {
"1988-02-22T20:37:42+06,572539062"
})
@EnabledForJreRange(min = JRE.JAVA_9)
void testShortOffset(String value, long expected) {
void shortOffset(String value, long expected) {
assertThat(MavenArchiver.parseBuildOutputTimestamp(value)).contains(Instant.ofEpochSecond(expected));
}

Expand Down Expand Up @@ -1411,7 +1411,7 @@ private long testReproducibleJarEntryTime(String name, String timestamp) throws
* @throws Exception
*/
@Test
void testReproducibleJar19700101() throws Exception {
void reproducibleJar19700101() throws Exception {
long entryTime = testReproducibleJarEntryTime("1970", "10");
assertThat(entryTime).isGreaterThanOrEqualTo(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.maven.shared.archiver;

import java.io.IOException;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Expand All @@ -41,7 +40,7 @@ class PomPropertiesUtilTest {
Path tempDirectory;

@Test
void testCreatePomProperties() throws IOException {
void createPomProperties() throws Exception {
Path pomPropertiesFile = tempDirectory.resolve("bar.properties");
util.createPomProperties("org.foo", "bar", "2.1.5", new JarArchiver(), null, pomPropertiesFile);

Expand All @@ -61,7 +60,7 @@ void testCreatePomProperties() throws IOException {
}

@Test
void testUnicodeEscape() throws IOException {
void unicodeEscape() throws Exception {
Path pomPropertiesFile = tempDirectory.resolve("bar.properties");
util.createPomProperties("org.foo", "こんにちは", "2.1.5", new JarArchiver(), null, pomPropertiesFile);

Expand All @@ -81,7 +80,7 @@ void testUnicodeEscape() throws IOException {
}

@Test
void testWhitespaceEscape() throws IOException {
void whitespaceEscape() throws Exception {
Path pomPropertiesFile = tempDirectory.resolve("bar.properties");
Path customPomPropertiesFile = tempDirectory.resolve("custom.properties");
try (Writer out = Files.newBufferedWriter(customPomPropertiesFile, StandardCharsets.ISO_8859_1)) {
Expand Down