This is an automated email from the ASF dual-hosted git repository.
sparsick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 32c0713 chore: migrate junit3/4 to junit 5 (#479)
32c0713 is described below
commit 32c0713d4766569205f041b26409085e0b0bca14
Author: Sandra Parsick <[email protected]>
AuthorDate: Sun Nov 9 12:09:31 2025 +0000
chore: migrate junit3/4 to junit 5 (#479)
- also updated xmlunit from 1.x to 2.x
---
pom.xml | 11 +-
.../apache/maven/plugins/ear/EarModuleTest.java | 6 +-
.../org/apache/maven/plugins/ear/EnvEntryTest.java | 45 ++++---
.../maven/plugins/ear/it/AbstractEarPluginIT.java | 118 ++++++++---------
.../org/apache/maven/plugins/ear/it/EarMojoIT.java | 139 ++++++++++++++++++---
.../plugins/ear/util/ArtifactRepositoryTest.java | 6 +-
.../ear/util/ArtifactTypeMappingServiceTest.java | 20 ++-
.../plugins/ear/util/EarMavenArchiverTest.java | 4 +-
.../maven/plugins/ear/util/JavaEEVersionTest.java | 27 +++-
9 files changed, 263 insertions(+), 113 deletions(-)
diff --git a/pom.xml b/pom.xml
index 09d2acf..4e2bec2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -186,15 +186,14 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- <version>1.6</version>
+ <groupId>org.xmlunit</groupId>
+ <artifactId>xmlunit-core</artifactId>
+ <version>2.10.4</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.13.2</version>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/test/java/org/apache/maven/plugins/ear/EarModuleTest.java
b/src/test/java/org/apache/maven/plugins/ear/EarModuleTest.java
index ff60a93..2625ea1 100644
--- a/src/test/java/org/apache/maven/plugins/ear/EarModuleTest.java
+++ b/src/test/java/org/apache/maven/plugins/ear/EarModuleTest.java
@@ -18,10 +18,10 @@
*/
package org.apache.maven.plugins.ear;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Ear module test case.
diff --git a/src/test/java/org/apache/maven/plugins/ear/EnvEntryTest.java
b/src/test/java/org/apache/maven/plugins/ear/EnvEntryTest.java
index d9d6dab..d62961a 100644
--- a/src/test/java/org/apache/maven/plugins/ear/EnvEntryTest.java
+++ b/src/test/java/org/apache/maven/plugins/ear/EnvEntryTest.java
@@ -18,10 +18,11 @@
*/
package org.apache.maven.plugins.ear;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* @author Stephane Nicoll
@@ -50,24 +51,32 @@ public class EnvEntryTest {
assertEnvEntry(envEntry, null, NAME, null, VALUE, LOOKUP_NAME);
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void createWithoutName() {
- new EnvEntry(DESCRIPTION, null, TYPE, VALUE, LOOKUP_NAME);
+ assertThrows(IllegalArgumentException.class, () -> {
+ new EnvEntry(DESCRIPTION, null, TYPE, VALUE, LOOKUP_NAME);
+ });
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void createWithEmptyName() {
- new EnvEntry(DESCRIPTION, "", TYPE, VALUE, LOOKUP_NAME);
+ assertThrows(IllegalArgumentException.class, () -> {
+ new EnvEntry(DESCRIPTION, "", TYPE, VALUE, LOOKUP_NAME);
+ });
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void createWithNullTypeAndNoValue() {
- new EnvEntry(DESCRIPTION, NAME, null, null, LOOKUP_NAME);
+ assertThrows(IllegalArgumentException.class, () -> {
+ new EnvEntry(DESCRIPTION, NAME, null, null, LOOKUP_NAME);
+ });
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void createWithEmptyTypeAndNoValue() {
- new EnvEntry(DESCRIPTION, NAME, "", null, LOOKUP_NAME);
+ assertThrows(IllegalArgumentException.class, () -> {
+ new EnvEntry(DESCRIPTION, NAME, "", null, LOOKUP_NAME);
+ });
}
@Test
@@ -77,12 +86,12 @@ public class EnvEntryTest {
private void assertEnvEntry(
EnvEntry actual, String description, String name, String type,
String value, String lookupName) {
- assertNotNull("Env entry could not be null", actual);
- assertNotNull("ToString could not be null", actual.toString());
- assertEquals("Wrong env entry description for [" + actual + "]",
description, actual.getDescription());
- assertEquals("Wrong env entry name for [" + actual + "]", name,
actual.getName());
- assertEquals("Wrong env entry type for [" + actual + "]", type,
actual.getType());
- assertEquals("Wrong env entry value for [" + actual + "]", value,
actual.getValue());
- assertEquals("Wrong env entry value for [" + actual + "]", lookupName,
actual.getLookupName());
+ assertNotNull(actual, "Env entry could not be null");
+ assertNotNull(actual.toString(), "ToString could not be null");
+ assertEquals(description, actual.getDescription(), "Wrong env entry
description for [" + actual + "]");
+ assertEquals(name, actual.getName(), "Wrong env entry name for [" +
actual + "]");
+ assertEquals(type, actual.getType(), "Wrong env entry type for [" +
actual + "]");
+ assertEquals(value, actual.getValue(), "Wrong env entry value for [" +
actual + "]");
+ assertEquals(lookupName, actual.getLookupName(), "Wrong env entry
value for [" + actual + "]");
}
}
diff --git
a/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java
b/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java
index 49da914..3f077a9 100644
--- a/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java
+++ b/src/test/java/org/apache/maven/plugins/ear/it/AbstractEarPluginIT.java
@@ -34,23 +34,29 @@ import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
-import junit.framework.TestCase;
import org.apache.maven.plugins.ear.util.ResourceEntityResolver;
import org.apache.maven.shared.verifier.VerificationException;
import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
-import org.custommonkey.xmlunit.Diff;
-import org.custommonkey.xmlunit.XMLAssert;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
+import org.xmlunit.builder.DiffBuilder;
+import org.xmlunit.diff.Diff;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* Base class for ear test cases.
*
* @author <a href="[email protected]">Stephane Nicoll</a>
*/
-public abstract class AbstractEarPluginIT extends TestCase {
+public abstract class AbstractEarPluginIT {
private static final String FINAL_NAME_PREFIX = "maven-ear-plugin-test-";
@@ -208,15 +214,11 @@ public abstract class AbstractEarPluginIT extends
TestCase {
}
protected void assertEarArchive(final File baseDir, final String
projectName) {
- assertTrue(
- "EAR archive does not exist",
- getEarArchive(baseDir, projectName).exists());
+ assertTrue(getEarArchive(baseDir, projectName).exists(), "EAR archive
does not exist");
}
protected void assertEarDirectory(final File baseDir, final String
projectName) {
- assertTrue(
- "EAR archive directory does not exist",
- getEarDirectory(baseDir, projectName).exists());
+ assertTrue(getEarDirectory(baseDir, projectName).exists(), "EAR
archive directory does not exist");
}
protected File getEarModuleDirectory(final File baseDir, final String
earModuleName) {
@@ -246,7 +248,7 @@ public abstract class AbstractEarPluginIT extends TestCase {
final boolean[] artifactsDirectory) {
// sanity check
assertEquals(
- "Wrong parameter, artifacts mismatch directory flags",
artifactNames.length, artifactsDirectory.length);
+ artifactNames.length, artifactsDirectory.length, "Wrong
parameter, artifacts mismatch directory flags");
File dir = getEarDirectory(baseDir, projectName);
@@ -259,17 +261,17 @@ public abstract class AbstractEarPluginIT extends
TestCase {
}
final List<File> actualFiles = buildArchiveContentFiles(dir,
expectedDirectories);
- assertEquals("Artifacts mismatch " + actualFiles,
artifactNames.length, actualFiles.size());
+ assertEquals(artifactNames.length, actualFiles.size(), "Artifacts
mismatch " + actualFiles);
for (int i = 0; i < artifactNames.length; i++) {
String artifactName = artifactNames[i];
final boolean isDirectory = artifactsDirectory[i];
File expectedFile = new File(dir, artifactName);
assertEquals(
- "Artifact[" + artifactName + "] not in the right form
(exploded/archive",
isDirectory,
- expectedFile.isDirectory());
- assertTrue("Artifact[" + artifactName + "] not found in ear
archive", actualFiles.contains(expectedFile));
+ expectedFile.isDirectory(),
+ "Artifact[" + artifactName + "] not in the right form
(exploded/archive");
+ assertTrue(actualFiles.contains(expectedFile), "Artifact[" +
artifactName + "] not found in ear archive");
}
}
@@ -300,29 +302,29 @@ public abstract class AbstractEarPluginIT extends
TestCase {
final String[][] excludedEntries)
throws IOException {
assertTrue(
- "Wrong parameter, artifacts mismatch directory flags",
artifacts.length <= artifactsDirectory.length);
+ artifacts.length <= artifactsDirectory.length, "Wrong
parameter, artifacts mismatch directory flags");
if (includedEntries != null) {
assertTrue(
- "Rows of includedEntries parameter should match items of
artifacts parameter",
- artifacts.length <= includedEntries.length);
+ artifacts.length <= includedEntries.length,
+ "Rows of includedEntries parameter should match items of
artifacts parameter");
}
if (excludedEntries != null) {
assertTrue(
- "Rows of excludedEntries parameter should match items of
artifacts parameter",
- artifacts.length <= excludedEntries.length);
+ artifacts.length <= excludedEntries.length,
+ "Rows of excludedEntries parameter should match items of
artifacts parameter");
}
final File earDirectory =
getEarDirectory(getEarModuleDirectory(baseDir, earModuleName), projectName);
for (int i = 0; i != artifacts.length; ++i) {
final String artifactName = artifacts[i];
final File module = new File(earDirectory, artifactName);
- assertTrue("Artifact [" + artifactName + "] should exist in EAR",
module.exists());
+ assertTrue(module.exists(), "Artifact [" + artifactName + "]
should exist in EAR");
final boolean artifactDirectory = artifactsDirectory[i];
assertEquals(
- "Artifact [" + artifactName + "] should be a " +
(artifactDirectory ? "directory" : "file"),
artifactDirectory,
- module.isDirectory());
+ module.isDirectory(),
+ "Artifact [" + artifactName + "] should be a " +
(artifactDirectory ? "directory" : "file"));
if (includedEntries == null && excludedEntries == null) {
continue;
@@ -344,8 +346,8 @@ public abstract class AbstractEarPluginIT extends TestCase {
}
final File inclusion = new File(artifactName,
includedEntry);
assertTrue(
- "Entry [" + includedEntry + "] should exist in
artifact [" + artifactName + "] of EAR",
- inclusion.exists());
+ inclusion.exists(),
+ "Entry [" + includedEntry + "] should exist in
artifact [" + artifactName + "] of EAR");
}
}
if (excludedEntriesDefined) {
@@ -355,9 +357,9 @@ public abstract class AbstractEarPluginIT extends TestCase {
}
final File exclusion = new File(artifactName,
excludedEntry);
assertFalse(
+ exclusion.exists(),
"Entry [" + excludedEntry + "] should not
exist in artifact [" + artifactName
- + "] of EAR",
- exclusion.exists());
+ + "] of EAR");
}
}
} else {
@@ -369,9 +371,9 @@ public abstract class AbstractEarPluginIT extends TestCase {
}
final ZipEntry inclusion =
moduleJar.getEntry(includedEntry);
assertNotNull(
+ inclusion,
"Entry [" + includedEntry + "] should
exist in artifact [" + artifactName
- + "] of EAR",
- inclusion);
+ + "] of EAR");
}
}
if (excludedEntriesDefined) {
@@ -381,9 +383,9 @@ public abstract class AbstractEarPluginIT extends TestCase {
}
final ZipEntry exclusion =
moduleJar.getEntry(excludedEntry);
assertNull(
+ exclusion,
"Entry [" + excludedEntry + "] should not
exist in artifact [" + artifactName
- + "] of EAR",
- exclusion);
+ + "] of EAR");
}
}
}
@@ -457,15 +459,15 @@ public abstract class AbstractEarPluginIT extends
TestCase {
final File[] expectedDeploymentDescriptors =
getDeploymentDescriptors(new File(baseDir, "expected-META-INF"));
if (expectedDeploymentDescriptors == null) {
- assertNull("No deployment descriptor was expected",
actualDeploymentDescriptors);
+ assertNull(actualDeploymentDescriptors, "No deployment descriptor
was expected");
} else {
- assertNotNull("Missing deployment descriptor",
actualDeploymentDescriptors);
+ assertNotNull(actualDeploymentDescriptors, "Missing deployment
descriptor");
// Make sure we have the same number of files
assertEquals(
- "Number of Deployment descriptor(s) mismatch",
expectedDeploymentDescriptors.length,
- actualDeploymentDescriptors.length);
+ actualDeploymentDescriptors.length,
+ "Number of Deployment descriptor(s) mismatch");
// Sort the files so that we have the same behavior here
Arrays.sort(expectedDeploymentDescriptors);
@@ -476,9 +478,9 @@ public abstract class AbstractEarPluginIT extends TestCase {
File actualDeploymentDescriptor =
actualDeploymentDescriptors[i];
assertEquals(
- "File name mismatch",
expectedDeploymentDescriptor.getName(),
- actualDeploymentDescriptor.getName());
+ actualDeploymentDescriptor.getName(),
+ "File name mismatch");
try {
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
@@ -488,13 +490,11 @@ public abstract class AbstractEarPluginIT extends
TestCase {
docBuilder.setEntityResolver(new ResourceEntityResolver());
docBuilder.setErrorHandler(new DefaultHandler());
- final Diff myDiff = new Diff(
- docBuilder.parse(expectedDeploymentDescriptor),
- docBuilder.parse(actualDeploymentDescriptor));
- XMLAssert.assertXMLEqual(
- "Wrong deployment descriptor generated for[" +
expectedDeploymentDescriptor.getName() + "]",
- myDiff,
- true);
+ final Diff myDiff =
DiffBuilder.compare(docBuilder.parse(expectedDeploymentDescriptor))
+
.withTest(docBuilder.parse(actualDeploymentDescriptor))
+ .ignoreComments()
+ .build();
+ assertFalse(myDiff.hasDifferences(), myDiff.toString());
} catch (SAXException | ParserConfigurationException e) {
e.printStackTrace();
fail("Could not assert deployment descriptor " +
e.getMessage());
@@ -536,15 +536,15 @@ public abstract class AbstractEarPluginIT extends
TestCase {
return;
}
- assertNotNull("artifactsDirectory should be provided if artifacts is
provided", artifactsDirectory);
+ assertNotNull(artifactsDirectory, "artifactsDirectory should be
provided if artifacts is provided");
assertTrue(
- "Size of artifactsDirectory should match size of artifacts
parameter",
- artifacts.length <= artifactsDirectory.length);
+ artifacts.length <= artifactsDirectory.length,
+ "Size of artifactsDirectory should match size of artifacts
parameter");
assertNotNull(
- "expectedClassPathElements should be provided if artifacts is
provided", expectedClassPathElements);
+ expectedClassPathElements, "expectedClassPathElements should
be provided if artifacts is provided");
assertTrue(
- "Rows of expectedClassPathElements parameter should match
items of artifacts parameter",
- artifacts.length <= expectedClassPathElements.length);
+ artifacts.length <= expectedClassPathElements.length,
+ "Rows of expectedClassPathElements parameter should match
items of artifacts parameter");
final File earFile = getEarArchive(baseDir, projectName);
for (int i = 0; i != artifacts.length; ++i) {
@@ -552,13 +552,13 @@ public abstract class AbstractEarPluginIT extends
TestCase {
final String[] classPathElements = getClassPathElements(earFile,
moduleArtifact, artifactsDirectory[i]);
if (expectedClassPathElements[i] == null) {
assertNull(
- "Class-Path entry should not exist in module [" +
moduleArtifact + "] manifest",
- classPathElements);
+ classPathElements,
+ "Class-Path entry should not exist in module [" +
moduleArtifact + "] manifest");
} else {
- Assert.assertArrayEquals(
- "Wrong elements of Class-Path entry of module [" +
moduleArtifact + "] manifest",
+ Assertions.assertArrayEquals(
expectedClassPathElements[i],
- classPathElements);
+ classPathElements,
+ "Wrong elements of Class-Path entry of module [" +
moduleArtifact + "] manifest");
}
}
}
@@ -576,11 +576,11 @@ public abstract class AbstractEarPluginIT extends
TestCase {
final String classPath;
try (JarFile earJarFile = new JarFile(earFile)) {
final ZipEntry moduleEntry = earJarFile.getEntry(artifact);
- assertNotNull("Artifact [" + artifact + "] should exist in EAR",
moduleEntry);
+ assertNotNull(moduleEntry, "Artifact [" + artifact + "] should
exist in EAR");
if (directory) {
final String manifestEntryName = artifact +
"/META-INF/MANIFEST.MF";
final ZipEntry manifestEntry =
earJarFile.getEntry(manifestEntryName);
- assertNotNull(manifestEntryName + " manifest file should exist
in EAR", manifestEntry);
+ assertNotNull(manifestEntry, manifestEntryName + " manifest
file should exist in EAR");
try (InputStream manifestInputStream =
earJarFile.getInputStream(manifestEntry)) {
final Manifest manifest = new
Manifest(manifestInputStream);
classPath =
manifest.getMainAttributes().getValue("Class-Path");
@@ -589,7 +589,7 @@ public abstract class AbstractEarPluginIT extends TestCase {
try (InputStream moduleInputStream =
earJarFile.getInputStream(moduleEntry);
JarInputStream moduleJarInputStream = new
JarInputStream(moduleInputStream)) {
final Manifest manifest =
moduleJarInputStream.getManifest();
- assertNotNull("Artifact [" + artifact + "] of EAR should
have manifest", manifest);
+ assertNotNull(manifest, "Artifact [" + artifact + "] of
EAR should have manifest");
classPath =
manifest.getMainAttributes().getValue("Class-Path");
}
}
diff --git a/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java
b/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java
index 278d10a..506b65a 100644
--- a/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java
+++ b/src/test/java/org/apache/maven/plugins/ear/it/EarMojoIT.java
@@ -25,6 +25,11 @@ import java.util.jar.JarFile;
import java.util.jar.Manifest;
import org.codehaus.plexus.util.FileUtils;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* @author <a href="[email protected]">Stephane Nicoll</a>
@@ -34,6 +39,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a single EJB and no configuration.
*/
+ @Test
public void testProject001() throws Exception {
doTestProject("project-001", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -41,6 +47,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a customized artifact location and a customized
artifact name.
*/
+ @Test
public void testProject002() throws Exception {
doTestProject("project-002", new String[]
{"APP-INF/lib/eartest-ejb-sample-one-1.0.jar", "ejb-sample-two.jar"});
}
@@ -48,6 +55,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a default bundle directory for {@code java} modules.
*/
+ @Test
public void testProject003() throws Exception {
doTestProject("project-003", new String[] {
"eartest-ejb-sample-one-1.0.jar",
@@ -59,6 +67,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a default bundle directory for _java_ modules and a
custom location overriding the default.
*/
+ @Test
public void testProject004() throws Exception {
doTestProject("project-004", new String[] {
"eartest-ejb-sample-one-1.0.jar",
@@ -70,6 +79,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a custom URI.
*/
+ @Test
public void testProject005() throws Exception {
doTestProject("project-005", new String[]
{"eartest-ejb-sample-one-1.0.jar", "libs/another-name.jar"});
}
@@ -77,6 +87,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with an excluded module.
*/
+ @Test
public void testProject006() throws Exception {
doTestProject("project-006", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-jar-sample-two-1.0.jar"});
}
@@ -84,6 +95,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a classified artifact and no extra configuration.
*/
+ @Test
public void testProject007() throws Exception {
doTestProject("project-007", new String[]
{"eartest-ejb-sample-one-1.0-classified.jar"});
}
@@ -91,6 +103,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for J2EE 1.3.
*/
+ @Test
public void testProject008() throws Exception {
doTestProject("project-008", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -98,6 +111,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for J2EE 1.4.
*/
+ @Test
public void testProject009() throws Exception {
doTestProject("project-009", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -105,6 +119,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for Java EE 5.
*/
+ @Test
public void testProject010() throws Exception {
doTestProject("project-010", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -112,6 +127,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and make sure that deployment descriptor default settings
are applied.
*/
+ @Test
public void testProject011() throws Exception {
doTestProject("project-011", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -119,6 +135,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and make sure that EAR resources are bundled within the
EAR.
*/
+ @Test
public void testProject012() throws Exception {
doTestProject("project-012", new String[] {"README.txt",
"LICENSE.txt", "eartest-ejb-sample-one-1.0.jar"});
}
@@ -126,6 +143,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and make sure that EAR resources in a customized
resources directory are bundled within the EAR.
*/
+ @Test
public void testProject013() throws Exception {
doTestProject("project-013", new String[] {"README.txt",
"LICENSE.txt", "eartest-ejb-sample-one-1.0.jar"});
}
@@ -133,6 +151,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and makes sure that EAR resources are bundled within the
EAR using includes and excludes.
*/
+ @Test
public void testProject014() throws Exception {
doTestProject("project-014", new String[] {"LICENSE.txt",
"eartest-ejb-sample-one-1.0.jar"});
}
@@ -140,17 +159,19 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and makes sure that default manifest is taken into
account.
*/
+ @Test
public void testProject015() throws Exception {
final File baseDir = doTestProject("project-015", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
final File expectedManifest = new File(baseDir,
"src/main/application/META-INF/MANIFEST.MF");
final File actualManifest = new File(getEarDirectory(baseDir,
"project-015"), "META-INF/MANIFEST.MF");
- assertTrue("Manifest was not copied", actualManifest.exists());
+ assertTrue(actualManifest.exists(), "Manifest was not copied");
assertTrue(FileUtils.contentEquals(expectedManifest, actualManifest));
}
/**
* Builds an EAR and makes sure that custom manifest is taken into account.
*/
+ @Test
public void testProject016() throws Exception {
final File baseDir = doTestProject("project-016", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
@@ -162,13 +183,14 @@ public class EarMojoIT extends AbstractEarPluginIT {
FileInputStream in = new FileInputStream(sourceManifestFile)) {
Manifest manifestFromCreatedEARFile = jarFile.getManifest();
Manifest sourceManifest = new Manifest(in);
- assertEquals("There are differences in the manifest.",
sourceManifest, manifestFromCreatedEARFile);
+ assertEquals(sourceManifest, manifestFromCreatedEARFile, "There
are differences in the manifest.");
}
}
/**
* Builds an EAR and makes sure that custom application.xml is taken into
account.
*/
+ @Test
public void testProject017() throws Exception {
doTestProject("project-017", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -176,15 +198,17 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a custom final name.
*/
+ @Test
public void testProject018() throws Exception {
final File baseDir = executeMojo("project-018");
final File expectedFile = new File(baseDir,
"target/my-custom-file.ear");
- assertTrue("EAR archive not found", expectedFile.exists());
+ assertTrue(expectedFile.exists(), "EAR archive not found");
}
/**
* Builds an EAR with unpacked archives using the unpackTypes.
*/
+ @Test
public void testProject019() throws Exception {
doTestProject(
"project-019",
@@ -197,6 +221,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with unpacked archives using the unpack module attribute.
*/
+ @Test
public void testProject020() throws Exception {
doTestProject(
"project-020",
@@ -209,6 +234,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with unpacked archives using both unpackTypes and the
unpack module attribute.
*/
+ @Test
public void testProject021() throws Exception {
doTestProject(
"project-021",
@@ -225,15 +251,17 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a classifier.
*/
+ @Test
public void testProject022() throws Exception {
final File baseDir = executeMojo("project-022");
final File expectedFile = new File(baseDir,
"target/maven-ear-plugin-test-project-022-99.0-myclassifier.ear");
- assertTrue("EAR archive not found", expectedFile.exists());
+ assertTrue(expectedFile.exists(), "EAR archive not found");
}
/**
* Builds an EAR and make sure that a single classified dependency is
detected without specifying the classifier.
*/
+ @Test
public void testProject023() throws Exception {
doTestProject(
"project-023",
@@ -244,6 +272,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and make sure that a single classified dependency is
detected when specifying the classifier.
*/
+ @Test
public void testProject024() throws Exception {
doTestProject(
"project-024",
@@ -255,6 +284,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR and make sure that a classified dependency with multiple
candidates is detected when specifying the
* classifier.
*/
+ @Test
public void testProject025() throws Exception {
doTestProject(
"project-025",
@@ -266,17 +296,17 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR and make sure that the build fails if a unclassifed
module configuration with multiple candidates is
* specified.
*/
+ @Test
public void testProject026() throws Exception {
final File baseDir = executeMojo("project-026", false, true);
// Stupido, checks that the ear archive is not there
- assertFalse(
- "Execution should have failed",
- getEarArchive(baseDir, "project-026").exists());
+ assertFalse(getEarArchive(baseDir, "project-026").exists(), "Execution
should have failed");
}
/**
* Builds an EAR and make sure that provided dependencies are not included
in the EAR.
*/
+ @Test
public void testProject027() throws Exception {
doTestProject("project-027", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -284,6 +314,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and make sure that test dependencies are not included in
the EAR.
*/
+ @Test
public void testProject028() throws Exception {
doTestProject("project-028", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -291,6 +322,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and make sure that system dependencies are not included
in the EAR.
*/
+ @Test
public void testProject029() throws Exception {
doTestProject("project-029", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -299,6 +331,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR and make sure that ejb-client dependencies are detected
and not added by default in the generated
* application.xml.
*/
+ @Test
public void testProject030() throws Exception {
doTestProject(
"project-030",
@@ -309,6 +342,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR with a JBoss 4 configuration specifying the security
domain and the unauthenticated-principal to
* use.
*/
+ @Test
public void testProject031() throws Exception {
doTestProject("project-031", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -316,6 +350,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 3.2 configuration specifying the jmx-name to
use.
*/
+ @Test
public void testProject032() throws Exception {
doTestProject("project-032", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -323,6 +358,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 4 configuration and JBoss specific modules.
*/
+ @Test
public void testProject033() throws Exception {
doTestProject("project-033", new String[] {
"eartest-ejb-sample-one-1.0.jar",
@@ -335,6 +371,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with custom security settings.
*/
+ @Test
public void testProject034() throws Exception {
doTestProject("project-034", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -342,6 +379,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a full filename mapping and make sure that custom
locations are not overridden.
*/
+ @Test
public void testProject035() throws Exception {
doTestProject("project-035", new String[] {
"foo/eartest-ejb-sample-one-1.0.jar",
@@ -356,6 +394,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR with a full filename mapping and make sure that groupIds
with dots are replaced by dashes in
* filenames.
*/
+ @Test
public void testProject036() throws Exception {
doTestProject("project-036", new String[] {
"foo/eartest-ejb-sample-one-1.0.jar",
@@ -372,6 +411,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR and make sure that ejb-client dependencies are detected
and added in the generated application.xml
* if includeInApplicationXml is set.
*/
+ @Test
public void testProject037() throws Exception {
doTestProject(
"project-037",
@@ -382,6 +422,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR and make sure that a non-classified dependency with
multiple candidates is detected when specifying
* the mainArtifactId as classifier.
*/
+ @Test
public void testProject038() throws Exception {
doTestProject(
"project-038",
@@ -392,6 +433,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 4 configuration specifying specifying the
loader repository to use.
*/
+ @Test
public void testProject039() throws Exception {
doTestProject("project-039", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -399,6 +441,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for Java EE 5
and an alternative deployment descriptor.
*/
+ @Test
public void testProject040() throws Exception {
doTestProject("project-040", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -406,6 +449,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 4.2 configuration specifying the module
order to use.
*/
+ @Test
public void testProject041() throws Exception {
doTestProject("project-041", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -413,6 +457,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 4.2 configuration specifying a datasource to
add.
*/
+ @Test
public void testProject042() throws Exception {
doTestProject("project-042", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -420,16 +465,18 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a custom descriptor location
(generatedDescriptorLocation setting).
*/
+ @Test
public void testProject043() throws Exception {
final File baseDir = doTestProject("project-043", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
final File expectedApplicationXml = new File(baseDir,
"target/custom-descriptor-dir/application.xml");
- assertTrue("Application.xml file not found",
expectedApplicationXml.exists());
- assertFalse("Application.xml file should not be empty",
expectedApplicationXml.length() == 0);
+ assertTrue(expectedApplicationXml.exists(), "Application.xml file not
found");
+ assertFalse(expectedApplicationXml.length() == 0, "Application.xml
file should not be empty");
}
/**
* Builds an EAR with a custom library-directory.
*/
+ @Test
public void testProject044() throws Exception {
doTestProject(
"project-044",
@@ -439,45 +486,49 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR and filter the content of the sources directory.
*/
+ @Test
public void testProject045() throws Exception {
final File baseDir =
doTestProject("project-045", new String[] {"README.txt",
"eartest-ejb-sample-one-1.0.jar"});
final File actualReadme = new File(getEarDirectory(baseDir,
"project-045"), "README.txt");
final String content = new
String(Files.readAllBytes(actualReadme.toPath()), "UTF-8");
- assertTrue("application name and version was not filtered properly",
content.contains("my-app 99.0"));
- assertTrue("Escaping did not work properly", content.contains("will
not be filtered ${application.name}."));
+ assertTrue(content.contains("my-app 99.0"), "application name and
version was not filtered properly");
+ assertTrue(content.contains("will not be filtered
${application.name}."), "Escaping did not work properly");
}
/**
* Builds an EAR and filter the content of the sources directory using a
custom filter file.
*/
+ @Test
public void testProject046() throws Exception {
final File baseDir =
doTestProject("project-046", new String[] {"README.txt",
"eartest-ejb-sample-one-1.0.jar"});
final File actualReadme = new File(getEarDirectory(baseDir,
"project-046"), "README.txt");
final String content = new
String(Files.readAllBytes(actualReadme.toPath()), "UTF-8");
- assertTrue("application name and version was not filtered properly",
content.contains("my-app 99.0"));
- assertTrue("application build was not filtered properly",
content.contains("(Build 2)"));
+ assertTrue(content.contains("my-app 99.0"), "application name and
version was not filtered properly");
+ assertTrue(content.contains("(Build 2)"), "application build was not
filtered properly");
assertTrue(
- "Unknown property should not have been filtered",
- content.contains("will not be filtered
${application.unknown}."));
+ content.contains("will not be filtered
${application.unknown}."),
+ "Unknown property should not have been filtered");
}
/**
* Builds an EAR and filter the content with a list of extensions.
*/
+ @Test
public void testProject047() throws Exception {
final File baseDir =
doTestProject("project-047", new String[] {"README.txt",
"eartest-ejb-sample-one-1.0.jar"});
final File actualReadme = new File(getEarDirectory(baseDir,
"project-047"), "README.txt");
final String content = new
String(Files.readAllBytes(actualReadme.toPath()), "UTF-8");
- assertTrue("application name and version should not have been
filtered", !content.contains("my-app 99.0"));
- assertTrue("original properties not found",
content.contains("${application.name} ${project.version}"));
+ assertTrue(!content.contains("my-app 99.0"), "application name and
version should not have been filtered");
+ assertTrue(content.contains("${application.name} ${project.version}"),
"original properties not found");
}
/**
* Builds an EAR with a JBoss 5 configuration containing library directory.
*/
+ @Test
public void testProject048() throws Exception {
doTestProject("project-048", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -485,6 +536,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 4.2 configuration containing a library
directory.
*/
+ @Test
public void testProject049() throws Exception {
doTestProject("project-049", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -492,6 +544,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 5 configuration containing a loader
repository configuration definition.
*/
+ @Test
public void testProject050() throws Exception {
doTestProject("project-050", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -499,6 +552,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 5 configuration containing a loader
repository class definition.
*/
+ @Test
public void testProject051() throws Exception {
doTestProject("project-051", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -506,6 +560,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 5 configuration containing a configuration
parser class definition.
*/
+ @Test
public void testProject052() throws Exception {
doTestProject("project-052", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -513,6 +568,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a JBoss 5 configuration containing only the loader
repo configuration
*/
+ @Test
public void testProject053() throws Exception {
doTestProject("project-053", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -520,6 +576,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for Java EE 5
and no application.xml
*/
+ @Test
public void testProject054() throws Exception {
doTestProject("project-054", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -527,6 +584,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with jar dependencies added in application.xml.
*/
+ @Test
public void testProject055() throws Exception {
doTestProject("project-055", new String[] {
"eartest-jar-sample-one-1.0.jar",
@@ -538,6 +596,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for J2EE 1.4 and
an alternative deployment descriptor.
*/
+ @Test
public void testProject056() throws Exception {
doTestProject("project-056", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -545,6 +604,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a complete JBoss 4.2 configuration and validate it
matches the DTD (MEAR-104).
*/
+ @Test
public void testProject057() throws Exception {
doTestProject("project-057", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -552,6 +612,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for Java EE 6.
*/
+ @Test
public void testProject058() throws Exception {
doTestProject("project-058", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -559,6 +620,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with no display name entry at all.
*/
+ @Test
public void testProject059() throws Exception {
doTestProject("project-059", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -566,6 +628,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with ejb-client packaged for J2EE 1.3 (MEAR-85)
*/
+ @Test
public void testProject060() throws Exception {
doTestProject(
"project-060",
@@ -575,6 +638,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with ejb-client packaged for J2EE 1.4 (MEAR-85)
*/
+ @Test
public void testProject061() throws Exception {
doTestProject(
"project-061",
@@ -584,6 +648,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with ejb-client packaged for JavaEE 5 (MEAR-85)
*/
+ @Test
public void testProject062() throws Exception {
doTestProject(
"project-062",
@@ -593,6 +658,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with ejb-client packaged for JavaEE 6 (MEAR-85)
*/
+ @Test
public void testProject063() throws Exception {
doTestProject("project-063", new String[]
{"lib/eartest-ejb-sample-two-1.0-client.jar"});
}
@@ -600,6 +666,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with ejb-client packaged for JavaEE 5 and still put it in
the root (MEAR-85)
*/
+ @Test
public void testProject064() throws Exception {
doTestProject(
"project-064",
@@ -609,6 +676,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a custom moduleId.
*/
+ @Test
public void testProject065() throws Exception {
doTestProject("project-065", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -616,6 +684,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with generateModuleId enabled.
*/
+ @Test
public void testProject066() throws Exception {
doTestProject("project-066", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -623,6 +692,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with generateModuleId enabled and a custom module.
*/
+ @Test
public void testProject067() throws Exception {
doTestProject("project-067", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -630,6 +700,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with the no-version file name mapping.
*/
+ @Test
public void testProject068() throws Exception {
doTestProject("project-068", new String[]
{"eartest-ejb-sample-one.jar", "eartest-ejb-sample-two.jar"});
}
@@ -637,6 +708,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with a custom library-directory and JavaEE 6.
*/
+ @Test
public void testProject069() throws Exception {
doTestProject(
"project-069",
@@ -646,6 +718,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with application-name and initialize-in-order tags.
*/
+ @Test
public void testProject070() throws Exception {
doTestProject("project-070", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-jar-sample-one-1.0.jar"});
}
@@ -653,6 +726,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with application-name and initialize-in-order tags for
unsupported version.
*/
+ @Test
public void testProject071() throws Exception {
doTestProject("project-071", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-jar-sample-one-1.0.jar"});
}
@@ -660,6 +734,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with an application client module (app-client).
*/
+ @Test
public void testProject072() throws Exception {
doTestProject(
"project-072",
@@ -669,6 +744,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with an application client module (app-client) and a
default bundle directory for _java_ modules.
*/
+ @Test
public void testProject073() throws Exception {
doTestProject("project-073", new String[] {
"eartest-ejb-sample-one-1.0.jar",
@@ -682,6 +758,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR with custom env entries settings and J2EE 1.3. Not
supported by the specification so this should be
* ignored.
*/
+ @Test
public void testProject074() throws Exception {
doTestProject("project-074", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -690,6 +767,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR with custom env entries settings and J2EE 1.4. Not
supported by the specification so this should be
* ignored.
*/
+ @Test
public void testProject075() throws Exception {
doTestProject("project-075", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -698,6 +776,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR with custom env entries settings and JavaEE 5. Not
supported by the specification so this should be
* ignored.
*/
+ @Test
public void testProject076() throws Exception {
doTestProject("project-076", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -705,6 +784,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with custom env entries settings and JavaEE 6.
*/
+ @Test
public void testProject077() throws Exception {
doTestProject("project-077", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -712,6 +792,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with the no version for ejb file name mapping.
*/
+ @Test
public void testProject078() throws Exception {
doTestProject("project-078", new String[] {"ejb-sample-one.jar",
"war-sample-one.war", "jar-sample-two.jar"});
}
@@ -719,6 +800,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with the 'default' library directory mode. Uses the value
of the defaultLibBundleDir.
*/
+ @Test
public void testProject079() throws Exception {
doTestProject(
"project-079",
@@ -728,6 +810,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with the 'empty' library directory mode. Generate an
empty library-directory element.
*/
+ @Test
public void testProject080() throws Exception {
doTestProject(
"project-080",
@@ -737,6 +820,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with the 'none' library directory mode. Does not generate
an library-directory element.
*/
+ @Test
public void testProject081() throws Exception {
doTestProject(
"project-081",
@@ -746,6 +830,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for JavaEE 7.
*/
+ @Test
public void testProject082() throws Exception {
doTestProject("project-082", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -754,6 +839,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds an EAR with a library directory and custom env entries. The
library-directory element must come first
* (MEAR-158).
*/
+ @Test
public void testProject083() throws Exception {
doTestProject("project-083", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -761,6 +847,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Support of an application id (MEAR-174).
*/
+ @Test
public void testProject084() throws Exception {
doTestProject("project-084", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -768,6 +855,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with custom ejbRef entries settings and JavaEE 6.
*/
+ @Test
public void testProject085() throws Exception {
doTestProject("project-085", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -775,6 +863,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with custom ejbRef entries plus lookup-name entry.
*/
+ @Test
public void testProject086() throws Exception {
doTestProject("project-086", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -782,6 +871,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with resource-ref entries.
*/
+ @Test
public void testProject087() throws Exception {
doTestProject("project-087", new String[]
{"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
}
@@ -790,6 +880,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Builds WAR and EAR as part of multi-module project twice so that the
2nd build is guaranteed to be performed when
* target directories and files exist.
*/
+ @Test
public void testProject088() throws Exception {
final String warModule = "eartest-war-sample-two-1.0.war";
final String ejbModule = "eartest-ejb-sample-one-1.0.jar";
@@ -830,6 +921,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* <li>skipClassPathModification option is turned off</li>
* </ul>
*/
+ @Test
public void testProject089() throws Exception {
final String warModule = "eartest-war-sample-three-1.0.war";
final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
@@ -855,6 +947,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* <li>skipClassPathModification option is turned on</li>
* </ul>
*/
+ @Test
public void testProject090() throws Exception {
final String warModule = "eartest-war-sample-three-1.0.war";
final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
@@ -879,6 +972,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* <li>unpacking of EJB JARs is turned on</li>
* </ul>
*/
+ @Test
public void testProject091() throws Exception {
final String warModule = "eartest-war-sample-three-1.0.war";
final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
@@ -909,6 +1003,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* <li>JAR with provided scope is removed from modules and from Class-Path
entries</li>
* </ul>
*/
+ @Test
public void testProject092() throws Exception {
final String projectName = "project-092";
final String earModuleName = "ear";
@@ -997,6 +1092,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* then movement of JARs and modification of manifest Class-Path entry is
performed only for WAR module and not for
* SAR, HAR and RAR modules.
*/
+ @Test
public void testProject093() throws Exception {
final String projectName = "project-093";
final String earModuleName = "ear";
@@ -1079,6 +1175,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* <li>provided JAR is removed from the manifest Class-Path entry of EJB
module</li>
* </ul>
*/
+ @Test
public void testProject094() throws Exception {
final String projectName = "project-094";
final String earModuleName = "ear";
@@ -1150,6 +1247,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Ensures that test JAR dependency of WAR is handled as regular JAR in
terms of packaging and manifest modification
* when skinnyWars option is turned on.
*/
+ @Test
public void testProject095() throws Exception {
final String warModule = "eartest-war-sample-two-1.0.war";
final String jarSampleTwoLibrary =
"lib/eartest-jar-sample-two-1.0.jar";
@@ -1170,6 +1268,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Ensures that test JAR dependency representing Java module is described
in deployment descriptor
* if includeInApplicationXml property of module is {@code true}.
*/
+ @Test
public void testProject096() throws Exception {
final String warModule = "eartest-war-sample-two-1.0.war";
final String jarSampleTwoLibrary = "eartest-jar-sample-two-1.0.jar";
@@ -1199,6 +1298,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* Ensures that artifacts with JBoss-sar, JBoss-har and JBoss-par types
are packaged in EAR and
* described in deployment descriptor when respective types are configured
for EAR modules.
*/
+ @Test
public void testProject097() throws Exception {
final String warModule = "eartest-war-sample-three-1.0.war";
final String sarSampleTwo = "eartest-sar-sample-two-1.0.sar";
@@ -1219,6 +1319,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
* <li>EAR module is removed from WARs and RARs (from modules which
include their dependencies)</li>
* </ul>
*/
+ @Test
public void testProject098() throws Exception {
final String projectName = "project-098";
final String earModuleName = "ear";
@@ -1298,6 +1399,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for JakartaEE 9.
*/
+ @Test
public void testProject099() throws Exception {
doTestProject("project-099", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -1305,6 +1407,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for JakartaEE 10.
*/
+ @Test
public void testProject100() throws Exception {
doTestProject("project-100", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
@@ -1312,6 +1415,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Ensure that {@code defaultLibBundleDir} with dot at beginning don't
remove artifacts during second execution.
*/
+ @Test
public void testProject101() throws Exception {
String[] expectedArtifacts = new String[] {
"eartest-jar-sample-one-1.0.jar",
@@ -1326,6 +1430,7 @@ public class EarMojoIT extends AbstractEarPluginIT {
/**
* Builds an EAR with deployment descriptor configuration for JakartaEE 11.
*/
+ @Test
public void testProject102() throws Exception {
doTestProject("project-102", new String[]
{"eartest-ejb-sample-one-1.0.jar"});
}
diff --git
a/src/test/java/org/apache/maven/plugins/ear/util/ArtifactRepositoryTest.java
b/src/test/java/org/apache/maven/plugins/ear/util/ArtifactRepositoryTest.java
index 2e706b0..f24839b 100644
---
a/src/test/java/org/apache/maven/plugins/ear/util/ArtifactRepositoryTest.java
+++
b/src/test/java/org/apache/maven/plugins/ear/util/ArtifactRepositoryTest.java
@@ -23,10 +23,10 @@ import java.util.Set;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugins.ear.AbstractEarTestBase;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
/**
* @author <a href="[email protected]">Stephane Nicoll</a>
diff --git
a/src/test/java/org/apache/maven/plugins/ear/util/ArtifactTypeMappingServiceTest.java
b/src/test/java/org/apache/maven/plugins/ear/util/ArtifactTypeMappingServiceTest.java
index 0ad4a70..4f3bc48 100644
---
a/src/test/java/org/apache/maven/plugins/ear/util/ArtifactTypeMappingServiceTest.java
+++
b/src/test/java/org/apache/maven/plugins/ear/util/ArtifactTypeMappingServiceTest.java
@@ -18,37 +18,46 @@
*/
package org.apache.maven.plugins.ear.util;
-import junit.framework.TestCase;
import org.apache.maven.plugins.ear.EarModuleFactory;
import org.apache.maven.plugins.ear.EarPluginException;
import org.apache.maven.plugins.ear.UnknownArtifactTypeException;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* Tests for the {@link ArtifactTypeMappingService}
*
* @author <a href="[email protected]">Stephane Nicoll</a>
*/
-public class ArtifactTypeMappingServiceTest extends TestCase {
+public class ArtifactTypeMappingServiceTest {
+ @Test
public void testDefaultConfiguration() {
ArtifactTypeMappingService service = getDefaultService();
for (String type : EarModuleFactory.getStandardArtifactTypes()) {
- assertTrue("Standard type could not be found",
service.isMappedToType(type, type));
+ assertTrue(service.isMappedToType(type, type), "Standard type
could not be found");
}
}
+ @Test
public void testIsMappedToTypeForUnknownType() {
ArtifactTypeMappingService service = getDefaultService();
assertFalse(service.isMappedToType("rar", "MyKoolCustomType"));
}
+ @Test
public void testIsMappedToTypeForKnownType() {
ArtifactTypeMappingService service = getServiceWithRarMappingToMyRar();
assertTrue(service.isMappedToType("rar", "MyRar"));
}
+ @Test
public void testGetStandardTypeForUknonwnType() {
try {
ArtifactTypeMappingService service = getDefaultService();
@@ -59,6 +68,7 @@ public class ArtifactTypeMappingServiceTest extends TestCase {
}
}
+ @Test
public void testGetStandardTypeForKnownType() {
try {
ArtifactTypeMappingService service =
getServiceWithRarMappingToMyRar();
@@ -68,6 +78,7 @@ public class ArtifactTypeMappingServiceTest extends TestCase {
}
}
+ @Test
public void testConfigWithSameCustomType() {
try {
XmlPlexusConfiguration rootConfig = new
XmlPlexusConfiguration("dummy");
@@ -93,6 +104,7 @@ public class ArtifactTypeMappingServiceTest extends TestCase
{
}
}
+ @Test
public void testConfigWithUnknownStandardType() {
try {
XmlPlexusConfiguration rootConfig = new
XmlPlexusConfiguration("dummy");
@@ -113,6 +125,7 @@ public class ArtifactTypeMappingServiceTest extends
TestCase {
}
}
+ @Test
public void testConfigWithNoType() {
try {
XmlPlexusConfiguration rootConfig = new
XmlPlexusConfiguration("dummy");
@@ -132,6 +145,7 @@ public class ArtifactTypeMappingServiceTest extends
TestCase {
}
}
+ @Test
public void testConfigWithNoMapping() {
try {
XmlPlexusConfiguration rootConfig = new
XmlPlexusConfiguration("dummy");
diff --git
a/src/test/java/org/apache/maven/plugins/ear/util/EarMavenArchiverTest.java
b/src/test/java/org/apache/maven/plugins/ear/util/EarMavenArchiverTest.java
index 9f3e446..63db0fa 100644
--- a/src/test/java/org/apache/maven/plugins/ear/util/EarMavenArchiverTest.java
+++ b/src/test/java/org/apache/maven/plugins/ear/util/EarMavenArchiverTest.java
@@ -24,9 +24,9 @@ import java.util.List;
import org.apache.maven.plugins.ear.AbstractEarTestBase;
import org.apache.maven.plugins.ear.EarModule;
import org.apache.maven.plugins.ear.EjbModule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author <a href="[email protected]">Stephane Nicoll</a>
diff --git
a/src/test/java/org/apache/maven/plugins/ear/util/JavaEEVersionTest.java
b/src/test/java/org/apache/maven/plugins/ear/util/JavaEEVersionTest.java
index 4d68bde..752754e 100644
--- a/src/test/java/org/apache/maven/plugins/ear/util/JavaEEVersionTest.java
+++ b/src/test/java/org/apache/maven/plugins/ear/util/JavaEEVersionTest.java
@@ -18,77 +18,99 @@
*/
package org.apache.maven.plugins.ear.util;
-import junit.framework.TestCase;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* @author Stephane Nicoll
*/
-public class JavaEEVersionTest extends TestCase {
+public class JavaEEVersionTest {
+ @Test
public void testGtSameVersion() {
assertFalse(JavaEEVersion.FIVE.gt(JavaEEVersion.FIVE));
}
+ @Test
public void testGtNextVersion() {
assertFalse(JavaEEVersion.FIVE.gt(JavaEEVersion.SIX));
}
+ @Test
public void testGtPreviousVersion() {
assertTrue(JavaEEVersion.FIVE.gt(JavaEEVersion.ONE_DOT_FOUR));
}
+ @Test
public void testGeSameVersion() {
assertTrue(JavaEEVersion.FIVE.ge(JavaEEVersion.FIVE));
}
+ @Test
public void testGePreviousVersion() {
assertTrue(JavaEEVersion.FIVE.ge(JavaEEVersion.ONE_DOT_FOUR));
}
+ @Test
public void testGeNextVersion() {
assertFalse(JavaEEVersion.FIVE.ge(JavaEEVersion.SIX));
}
+ @Test
public void testLtSameVersion() {
assertFalse(JavaEEVersion.FIVE.lt(JavaEEVersion.FIVE));
}
+ @Test
public void testLtPreviousVersion() {
assertFalse(JavaEEVersion.FIVE.lt(JavaEEVersion.ONE_DOT_FOUR));
}
+ @Test
public void testLtNextVersion() {
assertTrue(JavaEEVersion.FIVE.lt(JavaEEVersion.SIX));
}
+ @Test
public void testLeSameVersion() {
assertTrue(JavaEEVersion.FIVE.le(JavaEEVersion.FIVE));
}
+ @Test
public void testLePreviousVersion() {
assertFalse(JavaEEVersion.FIVE.le(JavaEEVersion.ONE_DOT_FOUR));
}
+ @Test
public void testLeNextVersion() {
assertTrue(JavaEEVersion.FIVE.le(JavaEEVersion.SIX));
}
+ @Test
public void testEqSameVersion() {
assertTrue(JavaEEVersion.FIVE.eq(JavaEEVersion.FIVE));
}
+ @Test
public void testEqAnotherVersion() {
assertFalse(JavaEEVersion.FIVE.eq(JavaEEVersion.ONE_DOT_THREE));
}
+ @Test
public void testGetVersion() {
assertEquals("5", JavaEEVersion.FIVE.getVersion());
}
+ @Test
public void testGetJavaEEVersionValid() throws InvalidJavaEEVersion {
assertEquals(JavaEEVersion.SIX, JavaEEVersion.getJavaEEVersion("6"));
}
+ @Test
public void testGetJavaEEVersionInvalid() {
try {
JavaEEVersion.getJavaEEVersion("2.4");
@@ -98,6 +120,7 @@ public class JavaEEVersionTest extends TestCase {
}
}
+ @Test
public void testGetJavaEEVersionNull() throws InvalidJavaEEVersion {
try {
JavaEEVersion.getJavaEEVersion(null);