svn merge -c 1507165 from trunk for HADOOP-9773. TestLightWeightCache should not set size limit to zero when esting it.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1507167 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2013-07-26 01:00:54 +00:00
parent b11cceb25c
commit ca8723f488
2 changed files with 7 additions and 3 deletions

View File

@ -377,6 +377,9 @@ Release 2.1.0-beta - 2013-07-02
HADOOP-9759. Add support for NativeCodeLoader#getLibraryName on Windows.
(Chuan Liu via cnauroth)
HADOOP-9773. TestLightWeightCache should not set size limit to zero when
testing it. (szetszwo)
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
HADOOP-8924. Hadoop Common creating package-info.java must not depend on

View File

@ -27,9 +27,10 @@ import org.junit.Test;
/** Testing {@link LightWeightCache} */
public class TestLightWeightCache {
private static final long starttime = Time.now();
private static final Random ran = new Random(starttime);
private static final long seed = starttime;
private static final Random ran = new Random(seed);
static {
println("Start time = " + new Date(starttime) + ", seed=" + starttime);
println("Start time = " + new Date(starttime) + ", seed=" + seed);
}
private static void print(Object s) {
@ -65,7 +66,7 @@ public class TestLightWeightCache {
final int dataSize = 1 << 16;
for(int i = 0; i < 10; i++) {
final int modulus = ran.nextInt(1024) + 1;
final int sizeLimit = ran.nextInt(modulus);
final int sizeLimit = ran.nextInt(modulus) + 1;
checkSizeLimit(sizeLimit, dataSize, modulus);
}
}