svn commit: r929393 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache: CacheLineTable.java test/UtilCacheTests.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r929393 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache: CacheLineTable.java test/UtilCacheTests.java

doogie-3
Author: doogie
Date: Wed Mar 31 06:07:48 2010
New Revision: 929393

URL: http://svn.apache.org/viewvc?rev=929393&view=rev
Log:
Prefix the fileStore path with ofbiz.home.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java?rev=929393&r1=929392&r2=929393&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java Wed Mar 31 06:07:48 2010
@@ -63,7 +63,12 @@ public class CacheLineTable<K, V> implem
                     if (CacheLineTable.jdbmMgr == null) {
                         try {
                             Debug.logImportant("Creating file system cache store for cache with name: " + cacheName, module);
-                            CacheLineTable.jdbmMgr = new JdbmRecordManager(fileStore);
+                            String ofbizHome = System.getProperty("ofbiz.home");
+                            if (ofbizHome == null) {
+                                Debug.logError("No ofbiz.home property set in environment", module);
+                            } else {
+                                CacheLineTable.jdbmMgr = new JdbmRecordManager(ofbizHome + "/" + fileStore);
+                            }
                         } catch (IOException e) {
                             Debug.logError(e, "Error creating file system cache store for cache with name: " + cacheName, module);
                         }

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java?rev=929393&r1=929392&r2=929393&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/test/UtilCacheTests.java Wed Mar 31 06:07:48 2010
@@ -195,9 +195,9 @@ public class UtilCacheTests extends Gene
         assertUtilCacheSettings(UtilCache.createUtilCache(name, 7, 17000, false), 7, null, 17000L, Boolean.FALSE, null);
         assertUtilCacheSettings(UtilCache.createUtilCache(name, 8, 18000, true), 8, null, 18000L, Boolean.TRUE, null);
         assertUtilCacheSettings(UtilCache.createUtilCache(name, 9, 5, 19000, false, false), 9, 5, 19000L, Boolean.FALSE, null);
-        //assertUtilCacheSettings(UtilCache.createUtilCache(name, 10, 6, 20000, false, true), 10, 6, 20000L, Boolean.FALSE, null);
+        assertUtilCacheSettings(UtilCache.createUtilCache(name, 10, 6, 20000, false, true), 10, 6, 20000L, Boolean.FALSE, null);
         assertUtilCacheSettings(UtilCache.createUtilCache(name, 11, 7, 21000, false, false, "a", "b"), 11, 7, 21000L, Boolean.FALSE, Boolean.FALSE);
-        //assertUtilCacheSettings(UtilCache.createUtilCache(name, 12, 8, 22000, false, true, "c", "d"), 12, 8, 22000L, Boolean.FALSE, Boolean.TRUE);
+        assertUtilCacheSettings(UtilCache.createUtilCache(name, 12, 8, 22000, false, true, "c", "d"), 12, 8, 22000L, Boolean.FALSE, Boolean.TRUE);
     }
 
     public <K, V> void assertKey(String label, UtilCache<K, V> cache, K key, V value, V other, int size, Map<K, V> map) {