You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/02/16 15:52:11 UTC
svn commit: r1245005 -
/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
Author: ggregory
Date: Thu Feb 16 14:52:10 2012
New Revision: 1245005
URL: http://svn.apache.org/viewvc?rev=1245005&view=rev
Log:
@Igore tests for a lineSeparator much bigger than DEFAULT_BUFFER_SIZE. See http://mail-archives.apache.org/mod_mbox/commons-dev/201202.mbox/%3C4F3C85D7.5060706@snafu.de%3E"
Modified:
commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java?rev=1245005&r1=1245004&r2=1245005&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java Thu Feb 16 14:52:10 2012
@@ -30,6 +30,7 @@ import java.util.Random;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.EncoderException;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -1217,5 +1218,22 @@ public class Base64Test {
}
return buf.toString();
}
+
+ /**
+ * Tests a lineSeparator much bigger than DEFAULT_BUFFER_SIZE.
+ *
+ * @see <a href="http://mail-archives.apache.org/mod_mbox/commons-dev/201202.mbox/%3C4F3C85D7.5060706@snafu.de%3E">dev@commons.apache.org</a>
+ */
+ @Test
+ @Ignore
+ public void testHugeLineSeparator() {
+ final int BaseNCodec_DEFAULT_BUFFER_SIZE = 8192;
+ final int Base64_BYTES_PER_ENCODED_BLOCK = 4;
+ byte[] baLineSeparator = new byte[BaseNCodec_DEFAULT_BUFFER_SIZE * 4 - 3];
+ Base64 b64 = new Base64(Base64_BYTES_PER_ENCODED_BLOCK, baLineSeparator);
+ String strOriginal = "Hello World";
+ String strDecoded = new String(b64.decode(b64.encode(StringUtils.getBytesUtf8(strOriginal))));
+ assertTrue("testDEFAULT_BUFFER_SIZE", strOriginal.equals(strDecoded));
+ }
}