You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gr...@apache.org on 2023/10/24 13:47:09 UTC
[logging-chainsaw] branch master updated: upgraded to Junit 4 standards
This is an automated email from the ASF dual-hosted git repository.
grobmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-chainsaw.git
The following commit(s) were added to refs/heads/master by this push:
new 5082459 upgraded to Junit 4 standards
5082459 is described below
commit 50824599b97021df292c9d75ec0a8c262ceb3739
Author: Christian Grobmeier <cg...@grobmeier.de>
AuthorDate: Tue Oct 24 15:47:03 2023 +0200
upgraded to Junit 4 standards
---
pom.xml | 2 +-
.../java/org/apache/log4j/xml/XMLDecoderTest.java | 19 ++++++++-----------
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/pom.xml b/pom.xml
index 6ff9336..04a6968 100644
--- a/pom.xml
+++ b/pom.xml
@@ -168,7 +168,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java b/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java
index 54f1ff4..ea7dac5 100644
--- a/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java
+++ b/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java
@@ -25,21 +25,15 @@ import java.nio.CharBuffer;
import java.util.Vector;
import java.net.URL;
import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent;
+import org.junit.Test;
+
+import static junit.framework.TestCase.assertEquals;
/**
* Tests for XMLDecoder.
*
*/
-public class XMLDecoderTest extends TestCase {
-
-
- /**
- * Constructor for XMLDecoderTest.
- * @param arg0 test name.
- */
- public XMLDecoderTest(String arg0) {
- super(arg0);
- }
+public class XMLDecoderTest {
public String getStringFromResource(final String resourceName,
final int maxSize) throws Exception {
@@ -56,6 +50,7 @@ public class XMLDecoderTest extends TestCase {
return cb.toString();
}
+ @Test
public void testDecodeEventsString1() throws Exception {
String xmlStr = getStringFromResource("xmlLayout.1.xml", 10000);
XMLDecoder decoder = new XMLDecoder();
@@ -63,6 +58,7 @@ public class XMLDecoderTest extends TestCase {
assertEquals(17, events.size());
}
+ @Test
public void testDecodeEventsString2() throws Exception {
String xmlStr = getStringFromResource("xsltLayout.1.xml", 10000);
XMLDecoder decoder = new XMLDecoder();
@@ -70,6 +66,7 @@ public class XMLDecoderTest extends TestCase {
assertEquals(15, events.size());
}
+ @Test
public void testDecodeEventsURL1() throws Exception {
URL resource = XMLDecoderTest.class.getResource("xmlLayout.1.xml");
XMLDecoder decoder = new XMLDecoder();
@@ -77,11 +74,11 @@ public class XMLDecoderTest extends TestCase {
assertEquals(17, events.size());
}
+ @Test
public void testDecodeEventsURL2() throws Exception {
URL resource = XMLDecoderTest.class.getResource("xsltLayout.1.xml");
XMLDecoder decoder = new XMLDecoder();
Vector<ChainsawLoggingEvent> events = decoder.decode(resource);
assertEquals(15, events.size());
}
-
}