You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/06/14 00:05:59 UTC
logging-log4j2 git commit: Reuse Apache Commons IO code for tests.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 2b7311512 -> 1663bf58d
Reuse Apache Commons IO code for tests.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/1663bf58
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1663bf58
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1663bf58
Branch: refs/heads/master
Commit: 1663bf58d00541b105fe2b9ef77a97389151a3d5
Parents: 2b73115
Author: Gary Gregory <ga...@gmail.com>
Authored: Sat Jun 13 15:05:56 2015 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sat Jun 13 15:05:56 2015 -0700
----------------------------------------------------------------------
log4j-1.2-api/pom.xml | 5 +++++
.../java/org/apache/log4j/util/SerializationTestHelper.java | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1663bf58/log4j-1.2-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/pom.xml b/log4j-1.2-api/pom.xml
index 68cce22..5226e24 100644
--- a/log4j-1.2-api/pom.xml
+++ b/log4j-1.2-api/pom.xml
@@ -75,6 +75,11 @@
<version>1.7</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1663bf58/log4j-1.2-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java b/log4j-1.2-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java
index 93f7760..7d82a05 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java
@@ -26,6 +26,8 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import org.apache.commons.io.FileUtils;
+
import static org.junit.Assert.*;
@@ -111,10 +113,8 @@ public class SerializationTestHelper {
if (witnessFile.exists()) {
int skipIndex = 0;
- final byte[] expected = new byte[actual.length];
- final FileInputStream is = new FileInputStream(witnessFile);
- final int bytesRead = is.read(expected);
- is.close();
+ final byte[] expected = FileUtils.readFileToByteArray(witnessFile);
+ final int bytesRead = expected.length;
if (bytesRead < endCompare) {
assertEquals(bytesRead, actual.length);