-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNG-6776] Inconsistent list of parameters for MojoDescriptor (testcase)
- Loading branch information
1 parent
e3aa406
commit 54abc10
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/MojoDescriptorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.apache.maven.plugin.descriptor; | ||
|
||
import org.junit.Test; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class MojoDescriptorTest | ||
{ | ||
@Test | ||
public void getParameterMap() throws DuplicateParameterException | ||
{ | ||
MojoDescriptor mojoDescriptor = new MojoDescriptor(); | ||
Parameter param1 = new Parameter(); | ||
param1.setName( "param1" ); | ||
param1.setDefaultValue( "value1" ); | ||
mojoDescriptor.addParameter( param1 ); | ||
|
||
List<Parameter> parameters = mojoDescriptor.getParameters(); | ||
assertEquals( 1, parameters.size() ); | ||
|
||
Map<String, Parameter> parameterMap = mojoDescriptor.getParameterMap(); | ||
assertEquals( parameters.size(), parameterMap.size() ); | ||
|
||
Parameter param2 = new Parameter(); | ||
param2.setName( "param2" ); | ||
param2.setDefaultValue( "value2" ); | ||
mojoDescriptor.addParameter( param2 ); | ||
|
||
assertEquals( 2, parameters.size() ); | ||
assertEquals( parameters.size(), parameterMap.size() ); | ||
} | ||
|
||
} |