This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git
The following commit(s) were added to refs/heads/master by this push: new 30af0c0 Silence logs in test (#96) 30af0c0 is described below commit 30af0c02195e0665f0e423a2428332259ebc5a04 Author: Elliotte Rusty Harold <elh...@users.noreply.github.com> AuthorDate: Sun Dec 8 19:37:40 2024 +0000 Silence logs in test (#96) * Silence log messages in tests --- .../java/org/apache/maven/plugins/changes/ChangesXMLTest.java | 8 +++----- .../maven/plugins/changes/jira/JqlQueryBuilderTestCase.java | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/changes/ChangesXMLTest.java b/src/test/java/org/apache/maven/plugins/changes/ChangesXMLTest.java index 0c06f8a..d8f820b 100644 --- a/src/test/java/org/apache/maven/plugins/changes/ChangesXMLTest.java +++ b/src/test/java/org/apache/maven/plugins/changes/ChangesXMLTest.java @@ -21,7 +21,7 @@ package org.apache.maven.plugins.changes; import java.io.File; import java.util.List; -import org.apache.maven.plugin.logging.SystemStreamLog; +import org.apache.maven.plugin.testing.SilentLog; import org.apache.maven.plugins.changes.model.Action; import org.apache.maven.plugins.changes.model.Release; import org.junit.Test; @@ -45,7 +45,7 @@ public class ChangesXMLTest { @Test public void testParseChangesFile() { File changesFile = new File(getBasedir() + "/src/test/unit/changes.xml"); - ChangesXML changesXML = new ChangesXML(changesFile, new SystemStreamLog()); + ChangesXML changesXML = new ChangesXML(changesFile, new SilentLog()); assertNotNull(changesXML.getChangesDocument()); assertEquals("Changes report Project", changesXML.getTitle()); @@ -80,12 +80,10 @@ public class ChangesXMLTest { File changesFile = new File(getBasedir() + "/src/test/unit/invalid-changes.xml"); try { - new ChangesXML(changesFile, new SystemStreamLog()); + new ChangesXML(changesFile, new SilentLog()); fail("Should have thrown a ChangesXMLRuntimeException due to the invalid changes.xml file"); } catch (ChangesXMLRuntimeException e) { assertEquals("An error occurred when parsing the changes.xml file", e.getMessage()); - } catch (Throwable e) { - fail("Wrong type of Throwable object was thrown, expected ChangesXMLRuntimeException"); } } } diff --git a/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java b/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java index e306b86..64959c0 100644 --- a/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java +++ b/src/test/java/org/apache/maven/plugins/changes/jira/JqlQueryBuilderTestCase.java @@ -22,7 +22,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import junit.framework.TestCase; -import org.apache.maven.plugin.logging.SystemStreamLog; +import org.apache.maven.plugin.testing.SilentLog; /** * Test class for {@link JqlQueryBuilder} @@ -35,7 +35,7 @@ public class JqlQueryBuilderTestCase extends TestCase { private static final String ENCODING = "UTF-8"; public void testEmptyQuery() { - String actual = new JqlQueryBuilder(new SystemStreamLog()).build(); + String actual = createBuilder().build(); String expected = ""; assertEquals(expected, actual); } @@ -147,6 +147,6 @@ public class JqlQueryBuilderTestCase extends TestCase { } private JqlQueryBuilder createBuilder() { - return new JqlQueryBuilder(new SystemStreamLog()); + return new JqlQueryBuilder(new SilentLog()); } }