1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -119,7 +119,7 @@ public void testCacheManagerFromConfigFile() throws Exception {
119
119
assertTrue ("Correct number of caches loaded" , cm .getCacheNames ().length == 1 );
120
120
Cache myCache1 = cm .getCache ("myCache1" );
121
121
assertFalse ("myCache1 is not eternal" , myCache1 .getCacheConfiguration ().isEternal ());
122
- assertTrue ("myCache1.maxElements == 300" , myCache1 .getCacheConfiguration ().getMaxElementsInMemory () == 300 );
122
+ assertTrue ("myCache1.maxElements == 300" , myCache1 .getCacheConfiguration ().getMaxEntriesLocalHeap () == 300 );
123
123
}
124
124
finally {
125
125
cacheManagerFb .destroy ();
@@ -162,10 +162,10 @@ private void doTestEhCacheFactoryBean(boolean useCacheManagerFb) throws Exceptio
162
162
CacheConfiguration config = cache .getCacheConfiguration ();
163
163
assertEquals ("myCache1" , cache .getName ());
164
164
if (useCacheManagerFb ){
165
- assertEquals ("myCache1.maxElements" , 300 , config .getMaxElementsInMemory ());
165
+ assertEquals ("myCache1.maxElements" , 300 , config .getMaxEntriesLocalHeap ());
166
166
}
167
167
else {
168
- assertEquals ("myCache1.maxElements" , 10000 , config .getMaxElementsInMemory ());
168
+ assertEquals ("myCache1.maxElements" , 10000 , config .getMaxEntriesLocalHeap ());
169
169
}
170
170
171
171
// Cache region is not defined. Should create one with default properties.
@@ -178,7 +178,7 @@ private void doTestEhCacheFactoryBean(boolean useCacheManagerFb) throws Exceptio
178
178
cache = (Cache ) cacheFb .getObject ();
179
179
config = cache .getCacheConfiguration ();
180
180
assertEquals ("undefinedCache" , cache .getName ());
181
- assertTrue ("default maxElements is correct" , config .getMaxElementsInMemory () == 10000 );
181
+ assertTrue ("default maxElements is correct" , config .getMaxEntriesLocalHeap () == 10000 );
182
182
assertFalse ("default eternal is correct" , config .isEternal ());
183
183
assertTrue ("default timeToLive is correct" , config .getTimeToLiveSeconds () == 120 );
184
184
assertTrue ("default timeToIdle is correct" , config .getTimeToIdleSeconds () == 120 );
@@ -190,7 +190,7 @@ private void doTestEhCacheFactoryBean(boolean useCacheManagerFb) throws Exceptio
190
190
cacheFb .setCacheManager (cacheManagerFb .getObject ());
191
191
}
192
192
cacheFb .setBeanName ("undefinedCache2" );
193
- cacheFb .setMaxElementsInMemory (5 );
193
+ cacheFb .setMaxEntriesLocalHeap (5 );
194
194
cacheFb .setTimeToLive (8 );
195
195
cacheFb .setTimeToIdle (7 );
196
196
cacheFb .setDiskExpiryThreadIntervalSeconds (10 );
@@ -199,7 +199,7 @@ private void doTestEhCacheFactoryBean(boolean useCacheManagerFb) throws Exceptio
199
199
config = cache .getCacheConfiguration ();
200
200
201
201
assertEquals ("undefinedCache2" , cache .getName ());
202
- assertTrue ("overridden maxElements is correct" , config .getMaxElementsInMemory () == 5 );
202
+ assertTrue ("overridden maxElements is correct" , config .getMaxEntriesLocalHeap () == 5 );
203
203
assertTrue ("default timeToLive is correct" , config .getTimeToLiveSeconds () == 8 );
204
204
assertTrue ("default timeToIdle is correct" , config .getTimeToIdleSeconds () == 7 );
205
205
assertTrue ("overridden diskExpiryThreadIntervalSeconds is correct" , config .getDiskExpiryThreadIntervalSeconds () == 10 );
@@ -253,7 +253,7 @@ public Object createEntry(Object key) throws Exception {
253
253
cacheFb .afterPropertiesSet ();
254
254
Ehcache myCache1 = cm .getEhcache ("myCache1" );
255
255
assertTrue (myCache1 instanceof SelfPopulatingCache );
256
- assertEquals ("myKey1" , myCache1 .get ("myKey1" ).getValue ());
256
+ assertEquals ("myKey1" , myCache1 .get ("myKey1" ).getObjectValue ());
257
257
}
258
258
finally {
259
259
cacheManagerFb .destroy ();
@@ -282,7 +282,7 @@ public void updateEntryValue(Object key, Object value) throws Exception {
282
282
cacheFb .afterPropertiesSet ();
283
283
Ehcache myCache1 = cm .getEhcache ("myCache1" );
284
284
assertTrue (myCache1 instanceof UpdatingSelfPopulatingCache );
285
- assertEquals ("myKey1" , myCache1 .get ("myKey1" ).getValue ());
285
+ assertEquals ("myKey1" , myCache1 .get ("myKey1" ).getObjectValue ());
286
286
}
287
287
finally {
288
288
cacheManagerFb .destroy ();
0 commit comments