diff --git a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java index f6191f5..5165f15 100644 --- a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java +++ b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java @@ -84,17 +84,17 @@ public XmlaOlap4jConcurrentMemoryCache( throws IllegalArgumentException { for (Entry entry : props.entrySet()) { - if (Property.Size.name().equalsIgnoreCase( + if (Property.SIZE.name().equalsIgnoreCase( entry.getKey().toString())) { this.setCacheSize( Integer.parseInt(entry.getValue().toString())); - } else if (Property.Timeout.name().equalsIgnoreCase( + } else if (Property.TIMEOUT.name().equalsIgnoreCase( entry.getKey().toString())) { this.setCacheTimeout( Integer.parseInt(entry.getValue().toString())); - } else if (Property.Mode.name().equalsIgnoreCase( + } else if (Property.MODE.name().equalsIgnoreCase( entry.getKey().toString())) { this.setCacheMode( diff --git a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java index 85d365a..e8580f0 100644 --- a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java +++ b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java @@ -24,16 +24,16 @@ *

All parameters are optional. * *

@@ -63,13 +63,13 @@ public static enum Property { * property will assign a random name to the cache space, thus creating * a unique space. */ - Name("Name of a cache to create or to share."), + NAME("Name of a cache to create or to share."), /** * The number of entries to maintain in cache under * the given cache name. */ - Size( + SIZE( "Maximum number of SOAP requests which will be cached under the " + "given cache name."), @@ -77,7 +77,7 @@ public static enum Property { * The number of seconds to maintain * entries in cache before expiration. */ - Timeout( + TIMEOUT( "Maximum TTL of SOAP requests which will be cached under the given " + "cache name."), @@ -86,7 +86,7 @@ public static enum Property { * LIFO (last in first out), FIFO (first in first out), * LFU (least frequently used) and MFU (most frequently used). */ - Mode("Eviction mode to set to the given cache name."); + MODE("Eviction mode to set to the given cache name."); /** * Creates a property. @@ -149,13 +149,13 @@ public String setParameters( // Make sure there's a name for the cache. Generate a // random one if needed. if (props.containsKey( - XmlaOlap4jNamedMemoryCache.Property.Name.name())) + XmlaOlap4jNamedMemoryCache.Property.NAME.name())) { refId = (String)props.get( - XmlaOlap4jNamedMemoryCache.Property.Name.name()); + XmlaOlap4jNamedMemoryCache.Property.NAME.name()); } else { refId = String.valueOf(UUID.randomUUID()); - props.put(XmlaOlap4jNamedMemoryCache.Property.Name.name(), refId); + props.put(XmlaOlap4jNamedMemoryCache.Property.NAME.name(), refId); } @@ -164,11 +164,11 @@ public String setParameters( // Create a cache for this URL if it is not created yet if (!caches.containsKey( props.get( - XmlaOlap4jNamedMemoryCache.Property.Name.name()))) + XmlaOlap4jNamedMemoryCache.Property.NAME.name()))) { caches.put( (String) props.get( - XmlaOlap4jNamedMemoryCache.Property.Name.name()), + XmlaOlap4jNamedMemoryCache.Property.NAME.name()), new XmlaOlap4jConcurrentMemoryCache(props)); } } diff --git a/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java b/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java index 4b55008..6b55721 100644 --- a/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java +++ b/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java @@ -47,16 +47,16 @@ public void testCacheConfig() throws Exception XmlaOlap4jDriver.Property.Cache.name(), "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Name.name(), + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), "testCacheConfig"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Mode.name(), + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), "LFU"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "30"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "50"); proxy.setCache(driverParameters, cacheProperties); @@ -82,16 +82,16 @@ public void testCacheModeError() throws Exception { XmlaOlap4jDriver.Property.Cache.name(), "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Name.name(), + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), "testCacheModeError"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Mode.name(), + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), "ERRONOUS VALUE MWAHAHAHAHA"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "30"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "50"); try { @@ -125,16 +125,16 @@ public void testCacheTimeoutError() throws Exception XmlaOlap4jDriver.Property.Cache.name(), "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Name.name(), + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), "testCacheTimeoutError"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Mode.name(), + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), "LFU"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "EEE"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "50"); try { @@ -142,7 +142,7 @@ public void testCacheTimeoutError() throws Exception } catch (OlapException t) { try { cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "-30"); proxy.setCache(driverParameters, cacheProperties); } catch (OlapException t2) { @@ -175,16 +175,16 @@ public void testCacheSizeError() throws Exception XmlaOlap4jDriver.Property.Cache.name(), "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Name.name(), + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), "testCacheSizeError"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Mode.name(), + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), "LFU"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "600"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "EEE"); try { @@ -192,7 +192,7 @@ public void testCacheSizeError() throws Exception } catch (OlapException t) { try { cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "-30"); proxy.setCache(driverParameters, cacheProperties); } catch (OlapException t2) { @@ -224,16 +224,16 @@ public void testCacheNameError() throws Exception XmlaOlap4jDriver.Property.Cache.name(), "Class which doesn't exist"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Name.name(), + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), "testCacheNameError"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Mode.name(), + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), "LFU"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "600"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "50"); try { @@ -271,16 +271,16 @@ public void testCacheSharing() throws Exception XmlaOlap4jDriver.Property.Cache.name(), "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Name.name(), + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), "testCacheSharing"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Mode.name(), + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), "LFU"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "600"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "50"); try { @@ -299,16 +299,16 @@ public void testCacheSharing() throws Exception XmlaOlap4jDriver.Property.Cache.name(), "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Name.name(), + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), "testCacheSharing"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Mode.name(), + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), "Erronous value which won't trigger an exception since a shared cache should be used."); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Timeout.name(), + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), "Erronous value which won't trigger an exception since a shared cache should be used."); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.Size.name(), + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), "Erronous value which won't trigger an exception since a shared cache should be used."); try {