Index: trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java	(revision 10650)
+++ trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java	(revision 10652)
@@ -2,7 +2,13 @@
 package org.openstreetmap.josm.data.cache;
 
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.logging.Logger;
 
+import org.apache.commons.jcs.access.CacheAccess;
+import org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheAttributes;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -31,3 +37,23 @@
         Logger.getLogger("org.apache.commons.jcs").warning("{switch:0}");
     }
+
+    @Test
+    public void testUseBigDiskFile() throws IOException {
+        if (JCSCacheManager.USE_BLOCK_CACHE.get()) {
+            // test only when using block cache
+            File cacheFile = new File("foobar/testUseBigDiskFile_BLOCK_v2.data");
+            if (!cacheFile.exists()) {
+                cacheFile.createNewFile();
+            }
+            try (FileOutputStream fileOutputStream = new FileOutputStream(cacheFile, false)) {
+                fileOutputStream.getChannel().truncate(0);
+                fileOutputStream.write(new byte[1024*1024*10]); // create 10MB empty file
+            }
+
+            CacheAccess<Object, Object> cache = JCSCacheManager.getCache("testUseBigDiskFile", 1, 100, "foobar");
+            assertEquals("BlockDiskCache use file size to calculate its size", 10*1024,
+                    ((BlockDiskCacheAttributes)cache.getCacheControl().getAuxCaches()[0].getAuxiliaryCacheAttributes()).getMaxKeySize());
+        }
+    }
+
 }
