You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2026/07/01 12:47:26 UTC
(maven-shared-utils) 01/02: Add failing test: Xpp3Dom default value should not be null
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch fix/xpp3dom-value-null
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit 3c95941c5d89ac0822c4993fc47de2855b092afe
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Wed Jul 1 08:44:22 2026 -0400
Add failing test: Xpp3Dom default value should not be null
---
.../java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java b/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java
index d64e9c4..a0a6b56 100644
--- a/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/xml/pull/Xpp3DomTest.java
@@ -27,6 +27,7 @@ import org.junit.jupiter.api.Test;
import static org.apache.maven.shared.utils.xml.Xpp3Dom.mergeXpp3Dom;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -42,6 +43,13 @@ public class Xpp3DomTest {
return t1s1;
}
+ @Test
+ public void defaultValueIsNotNull() {
+ // getValue() is annotated @NonNull but the one-arg constructor
+ // did not initialize value, violating the contract.
+ assertNotNull(new Xpp3Dom("test").getValue());
+ }
+
@Test
public void mergePrecedenceSelfClosed() throws XmlPullParserException {
Xpp3Dom parentConfig = build("<configuration><items><item/></items></configuration>");