Skip to content

Commit a5c08c8

Browse files
committed
Cleanup to remove issues
1 parent 973ec10 commit a5c08c8

File tree

6 files changed

+62
-41
lines changed

6 files changed

+62
-41
lines changed

maven-plugin-testing-harness/pom.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,10 @@ under the License.
3131
<description>The Maven Plugin Testing Harness provides mechanisms to manage tests on Mojo.</description>
3232

3333
<properties>
34+
<versions.junit5>5.13.0</versions.junit5>
3435
<wagonVersion>3.5.3</wagonVersion>
3536
</properties>
3637

37-
<dependencyManagement>
38-
<dependencies>
39-
<dependency>
40-
<groupId>org.junit</groupId>
41-
<artifactId>junit-bom</artifactId>
42-
<version>5.13.0</version>
43-
<type>pom</type>
44-
<scope>import</scope>
45-
</dependency>
46-
</dependencies>
47-
</dependencyManagement>
48-
4938
<dependencies>
5039
<!-- maven -->
5140
<dependency>

maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojo.java

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,51 @@
1919
package org.apache.maven.plugin.testing;
2020

2121
import org.apache.maven.plugin.AbstractMojo;
22-
import org.apache.maven.plugin.MojoExecutionException;
23-
import org.apache.maven.plugin.MojoFailureException;
2422

2523
public class ParametersMojo extends AbstractMojo {
26-
public String plain;
2724

28-
public String withProperty;
25+
private String plain;
2926

30-
public String withDefault;
27+
private String withProperty;
3128

32-
public String withPropertyAndDefault;
29+
private String withDefault;
30+
31+
private String withPropertyAndDefault;
3332

3433
@Override
35-
public void execute() throws MojoExecutionException, MojoFailureException {
34+
public void execute() {
3635
getLog().info("Plain value = " + plain);
3736
}
37+
38+
public String getPlain() {
39+
return plain;
40+
}
41+
42+
public void setPlain(String plain) {
43+
this.plain = plain;
44+
}
45+
46+
public String getWithProperty() {
47+
return withProperty;
48+
}
49+
50+
public void setWithProperty(String withProperty) {
51+
this.withProperty = withProperty;
52+
}
53+
54+
public String getWithDefault() {
55+
return withDefault;
56+
}
57+
58+
public void setWithDefault(String withDefault) {
59+
this.withDefault = withDefault;
60+
}
61+
62+
public String getWithPropertyAndDefault() {
63+
return withPropertyAndDefault;
64+
}
65+
66+
public void setWithPropertyAndDefault(String withPropertyAndDefault) {
67+
this.withPropertyAndDefault = withPropertyAndDefault;
68+
}
3869
}

maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ public void testDefault() throws Exception {
3636

3737
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(project, "parameters");
3838

39-
assertNull(mojo.plain);
40-
assertNull(mojo.withProperty);
41-
assertEquals("default", mojo.withDefault);
42-
assertEquals("default", mojo.withPropertyAndDefault);
39+
assertNull(mojo.getPlain());
40+
assertNull(mojo.getWithProperty());
41+
assertEquals("default", mojo.getWithDefault());
42+
assertEquals("default", mojo.getWithPropertyAndDefault());
4343
}
4444

4545
public void testExplicit() throws Exception {
4646
MavenProject project = readMavenProject(new File("src/test/projects/explicit"));
4747

4848
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(project, "parameters");
4949

50-
assertEquals("explicitValue", mojo.plain);
51-
assertEquals("explicitWithPropertyValue", mojo.withProperty);
52-
assertEquals("explicitWithDefaultValue", mojo.withDefault);
53-
assertEquals("explicitWithPropertyAndDefaultValue", mojo.withPropertyAndDefault);
50+
assertEquals("explicitValue", mojo.getPlain());
51+
assertEquals("explicitWithPropertyValue", mojo.getWithProperty());
52+
assertEquals("explicitWithDefaultValue", mojo.getWithDefault());
53+
assertEquals("explicitWithPropertyAndDefaultValue", mojo.getWithPropertyAndDefault());
5454
}
5555

5656
public void testDefaultWithProperty() throws Exception {
@@ -61,10 +61,10 @@ public void testDefaultWithProperty() throws Exception {
6161
session.getUserProperties().put("property", "propertyValue");
6262
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(session, execution);
6363

64-
assertNull(mojo.plain);
65-
assertEquals("propertyValue", mojo.withProperty);
66-
assertEquals("default", mojo.withDefault);
67-
assertEquals("propertyValue", mojo.withPropertyAndDefault);
64+
assertNull(mojo.getPlain());
65+
assertEquals("propertyValue", mojo.getWithProperty());
66+
assertEquals("default", mojo.getWithDefault());
67+
assertEquals("propertyValue", mojo.getWithPropertyAndDefault());
6868
}
6969

7070
public void testExplicitWithProperty() throws Exception {
@@ -75,10 +75,10 @@ public void testExplicitWithProperty() throws Exception {
7575
session.getUserProperties().put("property", "propertyValue");
7676
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(session, execution);
7777

78-
assertEquals("explicitValue", mojo.plain);
79-
assertEquals("explicitWithPropertyValue", mojo.withProperty);
80-
assertEquals("explicitWithDefaultValue", mojo.withDefault);
81-
assertEquals("explicitWithPropertyAndDefaultValue", mojo.withPropertyAndDefault);
78+
assertEquals("explicitValue", mojo.getPlain());
79+
assertEquals("explicitWithPropertyValue", mojo.getWithProperty());
80+
assertEquals("explicitWithDefaultValue", mojo.getWithDefault());
81+
assertEquals("explicitWithPropertyAndDefaultValue", mojo.getWithPropertyAndDefault());
8282
}
8383

8484
protected MavenProject readMavenProject(File basedir) throws ProjectBuildingException, Exception {

maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/junit5/Junit5Test.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ void simpleMojo(ParametersMojo mojo) {
5656
@MojoParameter(name = "plain", value = "plainValue")
5757
@MojoParameter(name = "withDefault", value = "withDefaultValue")
5858
void simpleMojoWithParameters(ParametersMojo mojo) {
59-
assertEquals("plainValue", mojo.plain);
60-
assertEquals("withDefaultValue", mojo.withDefault);
59+
assertEquals("plainValue", mojo.getPlain());
60+
assertEquals("withDefaultValue", mojo.getWithDefault());
6161
assertDoesNotThrow(mojo::execute);
6262
}
6363

6464
@Test
6565
@InjectMojo(goal = "test:test-plugin:0.0.1-SNAPSHOT:parameters", pom = POM)
6666
@MojoParameter(name = "plain", value = "plainValue")
6767
void simpleMojoWithParameter(ParametersMojo mojo) {
68-
assertEquals("plainValue", mojo.plain);
68+
assertEquals("plainValue", mojo.getPlain());
6969
assertDoesNotThrow(mojo::execute);
7070
}
7171
}

maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/resources/TestResourcesTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
import org.junit.Test;
2222

2323
public class TestResourcesTest {
24-
public TestResources resources = new TestResources();
24+
25+
private final TestResources resources = new TestResources();
2526

2627
@Test(expected = IllegalStateException.class)
2728
public void testNoRuleAnnotation() throws Exception {

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ under the License.
4949
<url>https://github.com/apache/maven-plugin-testing/tree/${project.scm.tag}</url>
5050
</scm>
5151
<issueManagement>
52-
<system>jira</system>
53-
<url>https://issues.apache.org/jira/browse/MPLUGINTESTING</url>
52+
<system>GitHub</system>
53+
<url>https://github.com/apache/maven-plugin-testing/issues</url>
5454
</issueManagement>
5555
<ciManagement>
5656
<system>Jenkins</system>

0 commit comments

Comments
 (0)