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:52 UTC

[logging-chainsaw] branch master updated: reformat

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 b089f95  reformat
b089f95 is described below

commit b089f95a1f29870d8ecbcfddee37c5c2f217ef27
Author: Christian Grobmeier <cg...@grobmeier.de>
AuthorDate: Tue Oct 24 15:47:47 2023 +0200

    reformat
---
 .../java/org/apache/log4j/xml/XMLDecoderTest.java  | 38 +++++++++++-----------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java b/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java
index ea7dac5..cfe2518 100644
--- a/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java
+++ b/src/test/java/org/apache/log4j/xml/XMLDecoderTest.java
@@ -24,6 +24,7 @@ import java.io.InputStreamReader;
 import java.nio.CharBuffer;
 import java.util.Vector;
 import java.net.URL;
+
 import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent;
 import org.junit.Test;
 
@@ -31,24 +32,23 @@ import static junit.framework.TestCase.assertEquals;
 
 /**
  * Tests for XMLDecoder.
- *
  */
 public class XMLDecoderTest {
 
-  public String getStringFromResource(final String resourceName,
-                                      final int maxSize) throws Exception {
-      InputStream is = XMLDecoderTest.class.getResourceAsStream(resourceName);
-      if (is == null) {
-          throw new FileNotFoundException(resourceName);
-      }
-      InputStreamReader reader = new InputStreamReader(is, "UTF-8");
-      CharBuffer cb = CharBuffer.allocate(maxSize);
+    public String getStringFromResource(final String resourceName,
+                                        final int maxSize) throws Exception {
+        InputStream is = XMLDecoderTest.class.getResourceAsStream(resourceName);
+        if (is == null) {
+            throw new FileNotFoundException(resourceName);
+        }
+        InputStreamReader reader = new InputStreamReader(is, "UTF-8");
+        CharBuffer cb = CharBuffer.allocate(maxSize);
 
-      while (reader.read(cb) != -1);
+        while (reader.read(cb) != -1) ;
 
-      cb.flip();
-      return cb.toString();
-  }
+        cb.flip();
+        return cb.toString();
+    }
 
     @Test
     public void testDecodeEventsString1() throws Exception {
@@ -59,12 +59,12 @@ public class XMLDecoderTest {
     }
 
     @Test
-  public void testDecodeEventsString2() throws Exception {
-      String xmlStr = getStringFromResource("xsltLayout.1.xml", 10000);
-      XMLDecoder decoder = new XMLDecoder();
-      Vector<ChainsawLoggingEvent> events = decoder.decodeEvents(xmlStr);
-      assertEquals(15, events.size());
-  }
+    public void testDecodeEventsString2() throws Exception {
+        String xmlStr = getStringFromResource("xsltLayout.1.xml", 10000);
+        XMLDecoder decoder = new XMLDecoder();
+        Vector<ChainsawLoggingEvent> events = decoder.decodeEvents(xmlStr);
+        assertEquals(15, events.size());
+    }
 
     @Test
     public void testDecodeEventsURL1() throws Exception {