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
23 changes: 11 additions & 12 deletions src/test/java/org/apache/maven/plugins/ejb/EjbMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ public void testClientJarDefaultInclusionsExclusions() throws Exception {
* @throws Exception if any exception occurs
*/
public void testClientJarInclusions() throws Exception {
final List<String> inclusions = new LinkedList<String>();
final List<String> inclusions = new LinkedList<>();
inclusions.add("**/*Include.class");

final MavenProjectResourcesStub project = createTestProject("client-includes");
final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<String>(), null);
final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<>(), null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -262,11 +262,11 @@ public void testClientJarInclusions() throws Exception {
*/
public void testClientJarExclusions() throws Exception {

final List<String> exclusions = new LinkedList<String>();
final List<String> exclusions = new LinkedList<>();
exclusions.add("**/*Exclude.class");

final MavenProjectResourcesStub project = createTestProject("client-excludes");
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<String>(), exclusions, null);
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<>(), exclusions, null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -302,12 +302,11 @@ public void testClientJarExclusions() throws Exception {
* @throws Exception if any exception occurs
*/
public void testMainJarExclusions() throws Exception {
final List<String> exclusions = new LinkedList<String>();
final List<String> exclusions = new LinkedList<>();
exclusions.add("**/*Exclude.class");

final MavenProjectResourcesStub project = createTestProject("main-excludes");
final EjbMojo mojo =
lookupMojoWithSettings(project, new LinkedList<String>(), new LinkedList<String>(), exclusions);
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<>(), new LinkedList<>(), exclusions);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -343,12 +342,12 @@ public void testMainJarExclusions() throws Exception {
* @throws Exception if any exception occurs
*/
public void testClientJarInclusionsWithSubPackage() throws Exception {
final List<String> inclusions = new LinkedList<String>();
final List<String> inclusions = new LinkedList<>();
inclusions.add("org/sample/ejb/*.class");

final MavenProjectResourcesStub project = createTestProject("client-includes-subpackage");

final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<String>(), null);
final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<>(), null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -385,11 +384,11 @@ public void testClientJarInclusionsWithSubPackage() throws Exception {
*/
public void testClientJarExclusionsWithEmptyPackage() throws Exception {

final LinkedList<String> exclusions = new LinkedList<String>();
final LinkedList<String> exclusions = new LinkedList<>();
exclusions.add("org/sample/ejb/**");

final MavenProjectResourcesStub project = createTestProject("client-excludes-emptypackage");
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<String>(), exclusions, null);
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<>(), exclusions, null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -562,7 +561,7 @@ protected EjbMojo lookupMojoWithSettings(
}

protected EjbMojo lookupMojoWithDefaultSettings(final MavenProject project) throws Exception {
return lookupMojoWithSettings(project, new LinkedList<String>(), new LinkedList<String>(), null);
return lookupMojoWithSettings(project, new LinkedList<>(), new LinkedList<>(), null);
}

protected void assertJarCreation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public MavenProjectBuildStub(String key) throws Exception {
super(key);

this.build = new Build();
this.resourcesFileList = new ArrayList<String>();
this.sourceFileList = new ArrayList<String>();
this.rootFileList = new ArrayList<String>();
this.directoryList = new ArrayList<String>();
this.targetClassesList = new ArrayList<String>();
this.dataMap = new HashMap<String, String>();
this.resourcesFileList = new ArrayList<>();
this.sourceFileList = new ArrayList<>();
this.rootFileList = new ArrayList<>();
this.directoryList = new ArrayList<>();
this.targetClassesList = new ArrayList<>();
this.dataMap = new HashMap<>();
setupBuild();

model.setBuild(build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ public Properties getProperties() {
}

public List<Profile> getProfiles() {
return new LinkedList<Profile>();
return new LinkedList<>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public class JarContentChecker {
private Map<File, Boolean> directoryMap;

public JarContentChecker() {
fileMap = new HashMap<File, Boolean>();
directoryMap = new HashMap<File, Boolean>();
fileMap = new HashMap<>();
directoryMap = new HashMap<>();
}

public void addDirectory(File dir) {
Expand Down