Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
b86241ca
Commit
b86241ca
authored
Jul 19, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to Ehcache 3.1.1
Closes gh-6418
parent
a6f443a9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
7 deletions
+64
-7
pom.xml
spring-boot-autoconfigure/pom.xml
+5
-0
CacheAutoConfigurationTests.java
...boot/autoconfigure/cache/CacheAutoConfigurationTests.java
+32
-6
ehcache3.xml
spring-boot-autoconfigure/src/test/resources/ehcache3.xml
+26
-0
pom.xml
spring-boot-dependencies/pom.xml
+1
-1
No files found.
spring-boot-autoconfigure/pom.xml
View file @
b86241ca
...
...
@@ -250,6 +250,11 @@
<artifactId>
undertow-websockets-jsr
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.ehcache
</groupId>
<artifactId>
ehcache
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.freemarker
</groupId>
<artifactId>
freemarker
</artifactId>
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java
View file @
b86241ca
...
...
@@ -41,6 +41,7 @@ import com.hazelcast.cache.HazelcastCachingProvider;
import
com.hazelcast.core.HazelcastInstance
;
import
com.hazelcast.spring.cache.HazelcastCacheManager
;
import
net.sf.ehcache.Status
;
import
org.ehcache.jsr107.EhcacheCachingProvider
;
import
org.infinispan.configuration.cache.ConfigurationBuilder
;
import
org.infinispan.jcache.embedded.JCachingProvider
;
import
org.infinispan.spring.provider.SpringEmbeddedCacheManager
;
...
...
@@ -372,7 +373,7 @@ public class CacheAutoConfigurationTests {
}
@Test
public
void
eh
C
acheCacheWithCaches
()
{
public
void
eh
c
acheCacheWithCaches
()
{
load
(
DefaultCacheConfiguration
.
class
,
"spring.cache.type=ehcache"
);
EhCacheCacheManager
cacheManager
=
validateCacheManager
(
EhCacheCacheManager
.
class
);
...
...
@@ -382,13 +383,13 @@ public class CacheAutoConfigurationTests {
}
@Test
public
void
eh
C
acheCacheWithCustomizers
()
{
public
void
eh
c
acheCacheWithCustomizers
()
{
testCustomizers
(
DefaultCacheAndCustomizersConfiguration
.
class
,
"ehcache"
,
"allCacheManagerCustomizer"
,
"eh
C
acheCacheManagerCustomizer"
);
"allCacheManagerCustomizer"
,
"eh
c
acheCacheManagerCustomizer"
);
}
@Test
public
void
eh
C
acheCacheWithConfig
()
{
public
void
eh
c
acheCacheWithConfig
()
{
load
(
DefaultCacheConfiguration
.
class
,
"spring.cache.type=ehcache"
,
"spring.cache.ehcache.config=cache/ehcache-override.xml"
);
EhCacheCacheManager
cacheManager
=
validateCacheManager
(
...
...
@@ -398,7 +399,7 @@ public class CacheAutoConfigurationTests {
}
@Test
public
void
eh
C
acheCacheWithExistingCacheManager
()
{
public
void
eh
c
acheCacheWithExistingCacheManager
()
{
load
(
EhCacheCustomCacheManager
.
class
,
"spring.cache.type=ehcache"
);
EhCacheCacheManager
cacheManager
=
validateCacheManager
(
EhCacheCacheManager
.
class
);
...
...
@@ -406,6 +407,31 @@ public class CacheAutoConfigurationTests {
.
isEqualTo
(
this
.
context
.
getBean
(
"customEhCacheCacheManager"
));
}
@Test
public
void
ehcache3AsJCacheWithCaches
()
{
String
cachingProviderFqn
=
EhcacheCachingProvider
.
class
.
getName
();
load
(
DefaultCacheConfiguration
.
class
,
"spring.cache.type=jcache"
,
"spring.cache.jcache.provider="
+
cachingProviderFqn
,
"spring.cache.cacheNames[0]=foo"
,
"spring.cache.cacheNames[1]=bar"
);
JCacheCacheManager
cacheManager
=
validateCacheManager
(
JCacheCacheManager
.
class
);
assertThat
(
cacheManager
.
getCacheNames
()).
containsOnly
(
"foo"
,
"bar"
);
}
@Test
public
void
ehcache3AsJCacheWithConfig
()
throws
IOException
{
String
cachingProviderFqn
=
EhcacheCachingProvider
.
class
.
getName
();
String
configLocation
=
"ehcache3.xml"
;
load
(
DefaultCacheConfiguration
.
class
,
"spring.cache.type=jcache"
,
"spring.cache.jcache.provider="
+
cachingProviderFqn
,
"spring.cache.jcache.config="
+
configLocation
);
JCacheCacheManager
cacheManager
=
validateCacheManager
(
JCacheCacheManager
.
class
);
Resource
configResource
=
new
ClassPathResource
(
configLocation
);
assertThat
(
cacheManager
.
getCacheManager
().
getURI
())
.
isEqualTo
(
configResource
.
getURI
());
assertThat
(
cacheManager
.
getCacheNames
()).
containsOnly
(
"foo"
,
"bar"
);
}
@Test
public
void
hazelcastCacheExplicit
()
{
load
(
DefaultCacheConfiguration
.
class
,
"spring.cache.type=hazelcast"
);
...
...
@@ -1036,7 +1062,7 @@ public class CacheAutoConfigurationTests {
}
@Bean
public
CacheManagerCustomizer
<
EhCacheCacheManager
>
eh
C
acheCacheManagerCustomizer
()
{
public
CacheManagerCustomizer
<
EhCacheCacheManager
>
eh
c
acheCacheManagerCustomizer
()
{
return
new
CacheManagerTestCustomizer
<
EhCacheCacheManager
>()
{
};
}
...
...
spring-boot-autoconfigure/src/test/resources/ehcache3.xml
0 → 100644
View file @
b86241ca
<config
xmlns:xsi=
'http://www.w3.org/2001/XMLSchema-instance'
xmlns=
'http://www.ehcache.org/v3'
xmlns:jsr107=
'http://www.ehcache.org/v3/jsr107'
xsi:schemaLocation=
"
http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.1.xsd
http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.1.xsd"
>
<cache-template
name=
"example"
>
<heap
unit=
"entries"
>
200
</heap>
</cache-template>
<cache
alias=
"foo"
uses-template=
"example"
>
<expiry>
<ttl
unit=
"seconds"
>
600
</ttl>
</expiry>
<jsr107:mbeans
enable-statistics=
"true"
/>
</cache>
<cache
alias=
"bar"
uses-template=
"example"
>
<expiry>
<ttl
unit=
"seconds"
>
400
</ttl>
</expiry>
</cache>
</config>
\ No newline at end of file
spring-boot-dependencies/pom.xml
View file @
b86241ca
...
...
@@ -69,7 +69,7 @@
<dom4j.version>
1.6.1
</dom4j.version>
<dropwizard-metrics.version>
3.1.2
</dropwizard-metrics.version>
<ehcache.version>
2.10.2.2.21
</ehcache.version>
<ehcache3.version>
3.1.
0
</ehcache3.version>
<ehcache3.version>
3.1.
1
</ehcache3.version>
<embedded-mongo.version>
1.50.5
</embedded-mongo.version>
<flyway.version>
3.2.1
</flyway.version>
<freemarker.version>
2.3.24-incubating
</freemarker.version>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment