Skip to content

Commit 66cf3bd

Browse files
committed
Minor clean up.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/codec/trunk@130223 13f79535-47bb-0310-9956-ffa450edef68
1 parent b872234 commit 66cf3bd

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/test/org/apache/commons/codec/binary/Base64Test.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
import junit.framework.TestCase;
6565

6666
/**
67-
* @version $Revision: 1.9 $ $Date: 2003/11/03 07:23:33 $
67+
* @version $Revision: 1.10 $ $Date: 2003/11/03 17:58:57 $
6868
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
6969
* @author <a href="mailto:rwaldhoff@apache.org">Rodney Waldhoff</a>
7070
* @author Tim O'Brien
@@ -116,7 +116,7 @@ public void testDecodePadOnly() {
116116
public void testEncodeDecodeSmall() {
117117
for(int i=0;i<12;i++) {
118118
byte[] data = new byte[i];
119-
_random.nextBytes(data);
119+
this.getRandom().nextBytes(data);
120120
byte[] enc = Base64.encodeBase64(data);
121121
assertTrue("\"" + (new String(enc)) + "\" is Base64 data.",Base64.isArrayByteBase64(enc) );
122122
byte[] data2 = Base64.decodeBase64(enc);
@@ -127,8 +127,8 @@ public void testEncodeDecodeSmall() {
127127
// encode/decode a large random array
128128
public void testEncodeDecodeRandom() {
129129
for(int i=1;i<5;i++) {
130-
byte[] data = new byte[_random.nextInt(10000)+1];
131-
_random.nextBytes(data);
130+
byte[] data = new byte[this.getRandom().nextInt(10000)+1];
131+
this.getRandom().nextBytes(data);
132132
byte[] enc = Base64.encodeBase64(data);
133133
assertTrue(Base64.isArrayByteBase64(enc));
134134
byte[] data2 = Base64.decodeBase64(enc);
@@ -493,4 +493,11 @@ private String toString(byte[] data) {
493493

494494
private Random _random = new Random();
495495

496+
/**
497+
* @return Returns the _random.
498+
*/
499+
public Random getRandom() {
500+
return this._random;
501+
}
502+
496503
}

0 commit comments

Comments
 (0)