summaryrefslogtreecommitdiff
path: root/test/java
diff options
context:
space:
mode:
authorluccioman <luccioman@users.noreply.github.com>2017-06-14 19:02:08 +0200
committerluccioman <luccioman@users.noreply.github.com>2017-06-14 19:02:08 +0200
commit28b451a0b375801c8bfaee6777978e56f13fb6a5 (patch)
treedbc77667939f79b072e5eee6713301e683f68f2c /test/java
parenta7394b479b4a2ecb9bd0c9696355e5d1008b8742 (diff)
Made Cache compression level and lock timeout user configurable
Diffstat (limited to 'test/java')
-rw-r--r--test/java/net/yacy/crawler/data/CacheTest.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/java/net/yacy/crawler/data/CacheTest.java b/test/java/net/yacy/crawler/data/CacheTest.java
index bb71b5e84..8c8fe5d96 100644
--- a/test/java/net/yacy/crawler/data/CacheTest.java
+++ b/test/java/net/yacy/crawler/data/CacheTest.java
@@ -34,6 +34,7 @@ import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.logging.LogManager;
+import java.util.zip.Deflater;
import org.apache.http.HttpStatus;
import org.junit.After;
@@ -68,7 +69,7 @@ public class CacheTest {
Cache.init(new File(System.getProperty("java.io.tmpdir") + File.separator + "testCache"), "peerSalt",
Math.max(Math.max(TEXT_CONTENT.getBytes(StandardCharsets.UTF_8).length * 10,
Cache.DEFAULT_COMPRESSOR_BUFFER_SIZE * 2), Cache.DEFAULT_BACKEND_BUFFER_SIZE * 2),
- 2000);
+ 2000, Deflater.BEST_COMPRESSION);
Cache.clear();
}
@@ -497,9 +498,11 @@ public class CacheTest {
final long sleepTime = 0;
/* Maximum waiting time (in ms) for acquiring a synchronization lock */
final long lockTimeout = 2000;
+ /* The backend compression level */
+ final int compressionLevel = Deflater.BEST_COMPRESSION;
Cache.init(new File(System.getProperty("java.io.tmpdir") + File.separator + "yacyTestCache"), "peerSalt",
- cacheMaxSize, lockTimeout);
+ cacheMaxSize, lockTimeout, compressionLevel);
Cache.clear();
System.out.println("Cache initialized with a maximum size of " + cacheMaxSize + " bytes.");