diff --git a/api/maven-api-model/src/main/mdo/maven.mdo b/api/maven-api-model/src/main/mdo/maven.mdo index 48456cc2dd..19fa213575 100644 --- a/api/maven-api-model/src/main/mdo/maven.mdo +++ b/api/maven-api-model/src/main/mdo/maven.mdo @@ -661,6 +661,18 @@ ]]> + + 4.0.0+ + + + + @@ -684,6 +696,22 @@ + + + 4.0.0+ + + + + + BuildBase @@ -758,6 +786,22 @@ + + + 4.0.0+ + + + + + Build @@ -835,6 +879,22 @@ + + + 4.0.0+ + + + + + CiManagement @@ -1014,6 +1074,22 @@ + + + 4.0.0+ + + + + + Dependency @@ -1228,6 +1304,22 @@ String + + + 4.0.0+ + + + + + Exclusion @@ -1274,6 +1366,22 @@ String + + + 4.0.0+ + + + + + DistributionManagement @@ -1395,6 +1503,22 @@ String + + + 4.0.0+ + + + + + MailingList @@ -1470,6 +1594,22 @@ We could probably have a specific element for a dev mailing list for things like CI, and maybe even a specific element for the user and scm mailing lists. Then leave the more lose structure for any other type of mailing list. + + + 4.0.0+ + + + + + Organization @@ -1489,6 +1629,22 @@ String + + + 4.0.0+ + + + + + PatternSet @@ -1771,6 +1927,20 @@ ]]> + + 4.0.0+ + + + + diff --git a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java index dc1dee8f28..6551f30b96 100644 --- a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java @@ -53,4 +53,12 @@ public class BuildTest { public void testToStringNullSafe() { assertNotNull(new Build().toString()); } + + public void testToStringNotNonsense() { + Build build = new Build(); + + String s = build.toString(); + + assert "Build {BuildBase {PluginConfiguration {PluginContainer {}}}}".equals(s) : s; + } } diff --git a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java index 30ca30feca..c217acd293 100644 --- a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java @@ -53,4 +53,15 @@ public class DeveloperTest { public void testToStringNullSafe() { assertNotNull(new Developer().toString()); } + + public void testToStringNotNonsense() { + Developer dev = new Developer(); + dev.setName("Maven Tester"); + dev.setEmail("tester@acme.localdomain"); + dev.setId("20220118"); + + String s = dev.toString(); + + assert "Developer {id=20220118, Contributor {name=Maven Tester, email=tester@acme.localdomain}}".equals(s) : s; + } } diff --git a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java index d368fe8016..7a44b14ba8 100644 --- a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java @@ -53,4 +53,14 @@ public class IssueManagementTest { public void testToStringNullSafe() { assertNotNull(new IssueManagement().toString()); } + + public void testToStringNotNonsense() { + IssueManagement im = new IssueManagement(); + im.setSystem("Velociraptor"); + im.setUrl("https://velo.localdomain"); + + String s = im.toString(); + + assert "IssueManagement {system=Velociraptor, url=https://velo.localdomain}".equals(s) : s; + } } diff --git a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java index 26959fc0d1..0fc8027dd8 100644 --- a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java @@ -53,4 +53,14 @@ public class LicenseTest { public void testToStringNullSafe() { assertNotNull(new License().toString()); } + + public void testToStringNotNonsense() { + License license = new License(); + license.setName("Unlicense"); + license.setUrl("http://lic.localdomain"); + + String s = license.toString(); + + assert "License {name=Unlicense, url=http://lic.localdomain}".equals(s) : s; + } } diff --git a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java index 91f1974f70..d3874d8a49 100644 --- a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java @@ -18,6 +18,7 @@ */ package org.apache.maven.model; +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.assertTrue; @@ -53,4 +54,13 @@ public class MailingListTest { public void testToStringNullSafe() { assertNotNull(new MailingList().toString()); } + + public void testToStringNotNonsense() { + MailingList list = new MailingList(); + list.setName("modello-dev"); + + String s = list.toString(); + + assertEquals("MailingList {name=modello-dev, archive=null}", s); + } } diff --git a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java index 6c7a13aeb7..1abe01a3d0 100644 --- a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java @@ -18,6 +18,7 @@ */ package org.apache.maven.model; +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.assertTrue; @@ -53,4 +54,32 @@ public class OrganizationTest { public void testToStringNullSafe() { assertNotNull(new Organization().toString()); } + + public void testToStringNotNonsense11() { + Organization org = new Organization(); + org.setName("Testing Maven Unit"); + org.setUrl("https://maven.localdomain"); + + assertEquals("Organization {name=Testing Maven Unit, url=https://maven.localdomain}", org.toString()); + } + + public void testToStringNotNonsense10() { + Organization org = new Organization(); + org.setName("Testing Maven Unit"); + + assertEquals("Organization {name=Testing Maven Unit, url=null}", org.toString()); + } + + public void testToStringNotNonsense01() { + Organization org = new Organization(); + org.setUrl("https://maven.localdomain"); + + assertEquals("Organization {name=null, url=https://maven.localdomain}", org.toString()); + } + + public void testToStringNotNonsense00() { + Organization org = new Organization(); + + assertEquals("Organization {name=null, url=null}", org.toString()); + } } diff --git a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java index e12d56b89e..d7e94a80e9 100644 --- a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java @@ -18,6 +18,7 @@ */ package org.apache.maven.model; +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.assertTrue; @@ -53,4 +54,13 @@ public class ScmTest { public void testToStringNullSafe() { assertNotNull(new Scm().toString()); } + + public void testToStringNotNonsense() { + Scm scm = new Scm(); + scm.setConnection("scm:git:git://git.localdomain/model"); + + String s = scm.toString(); + + assertEquals("Scm {connection=scm:git:git://git.localdomain/model}", s); + } }