You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/04/12 18:33:51 UTC

[11/17] logging-log4j2 git commit: LOG4J2-1343 fix bug in test

LOG4J2-1343 fix bug in test


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/141bdd2a
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/141bdd2a
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/141bdd2a

Branch: refs/heads/master
Commit: 141bdd2abc28b5546e395e21a7364edbcb8776b0
Parents: 884830f
Author: rpopma <rp...@apache.org>
Authored: Tue Apr 12 02:45:15 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Tue Apr 12 02:45:15 2016 +0900

----------------------------------------------------------------------
 .../core/appender/RandomAccessFileManagerTest.java     | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/141bdd2a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
index b048e8a..ac95668 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
@@ -47,9 +47,8 @@ public class RandomAccessFileManagerTest {
         final File file = folder.newFile();
         try (final RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
             final OutputStream os = NullOutputStream.NULL_OUTPUT_STREAM;
-            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os, false,
+            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os,
                     RandomAccessFileManager.DEFAULT_BUFFER_SIZE, null, null, true);
-            manager.setByteBufferDestination(manager.createByteBufferDestination(false));
 
             final int size = RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3;
             final byte[] data = new byte[size];
@@ -69,9 +68,8 @@ public class RandomAccessFileManagerTest {
         final File file = folder.newFile();
         try (final RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
             final OutputStream os = NullOutputStream.NULL_OUTPUT_STREAM;
-            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os, false,
+            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os,
                     RandomAccessFileManager.DEFAULT_BUFFER_SIZE, null, null, true);
-            manager.setByteBufferDestination(manager.createByteBufferDestination(false));
 
             final int size = RandomAccessFileManager.DEFAULT_BUFFER_SIZE * 3 + 1;
             final byte[] data = new byte[size];
@@ -91,7 +89,7 @@ public class RandomAccessFileManagerTest {
             final int bufferSize = 4 * 1024;
             assertNotEquals(bufferSize, RandomAccessFileManager.DEFAULT_BUFFER_SIZE);
 
-            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os, false,
+            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os,
                     bufferSize, null, null, true);
 
             // check the resulting buffer size is what was requested
@@ -104,9 +102,8 @@ public class RandomAccessFileManagerTest {
         try (final RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
             final OutputStream os = NullOutputStream.NULL_OUTPUT_STREAM;
             final int bufferSize = 1;
-            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os, false,
+            final RandomAccessFileManager manager = new RandomAccessFileManager(raf, file.getName(), os,
                     bufferSize, null, null, true);
-            manager.setByteBufferDestination(manager.createByteBufferDestination(false));
 
             final int size = bufferSize * 3 + 1;
             final byte[] data = new byte[size];
@@ -135,7 +132,7 @@ public class RandomAccessFileManagerTest {
 
         final RandomAccessFileManager manager = RandomAccessFileManager.getFileManager(
                 file.getAbsolutePath(), isAppend, true, RandomAccessFileManager.DEFAULT_BUFFER_SIZE, null, null);
-        manager.write(bytes, 0, bytes.length, false);
+        manager.write(bytes, 0, bytes.length, true);
         final int expected = bytes.length * 2;
         assertEquals("appended, not overwritten", expected, file.length());
     }