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
59692cd9
Commit
59692cd9
authored
Apr 07, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish formatting
parent
57896654
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
EhCacheCacheConfiguration.java
...k/boot/autoconfigure/cache/EhCacheCacheConfiguration.java
+1
-1
JCacheCacheConfiguration.java
...rk/boot/autoconfigure/cache/JCacheCacheConfiguration.java
+8
-4
CacheAutoConfigurationTests.java
...boot/autoconfigure/cache/CacheAutoConfigurationTests.java
+6
-5
CommandLineIT.java
...c/it/java/org/springframework/boot/cli/CommandLineIT.java
+2
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/EhCacheCacheConfiguration.java
View file @
59692cd9
...
...
@@ -37,7 +37,7 @@ import org.springframework.core.io.Resource;
* @since 1.3.0
*/
@Configuration
@ConditionalOnClass
({
Cache
.
class
,
EhCacheCacheManager
.
class
})
@ConditionalOnClass
({
Cache
.
class
,
EhCacheCacheManager
.
class
})
@ConditionalOnMissingBean
(
CacheManager
.
class
)
@Conditional
({
CacheCondition
.
class
,
EhCacheCacheConfiguration
.
ConfigAvailableCondition
.
class
})
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java
View file @
59692cd9
...
...
@@ -20,6 +20,7 @@ import java.io.IOException;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Properties
;
import
javax.cache.CacheManager
;
import
javax.cache.Caching
;
import
javax.cache.configuration.MutableConfiguration
;
...
...
@@ -51,7 +52,7 @@ import org.springframework.util.StringUtils;
* @since 1.3.0
*/
@Configuration
@ConditionalOnClass
({
Caching
.
class
,
JCacheCacheManager
.
class
})
@ConditionalOnClass
({
Caching
.
class
,
JCacheCacheManager
.
class
})
@ConditionalOnMissingBean
(
org
.
springframework
.
cache
.
CacheManager
.
class
)
@Conditional
({
CacheCondition
.
class
,
JCacheCacheConfiguration
.
JCacheAvailableCondition
.
class
})
...
...
@@ -85,7 +86,8 @@ class JCacheCacheConfiguration {
Resource
configLocation
=
this
.
cacheProperties
.
resolveConfigLocation
();
if
(
configLocation
!=
null
)
{
return
cachingProvider
.
getCacheManager
(
configLocation
.
getURI
(),
cachingProvider
.
getDefaultClassLoader
(),
createCacheManagerProperties
(
configLocation
));
cachingProvider
.
getDefaultClassLoader
(),
createCacheManagerProperties
(
configLocation
));
}
return
cachingProvider
.
getCacheManager
();
}
...
...
@@ -97,10 +99,12 @@ class JCacheCacheConfiguration {
return
Caching
.
getCachingProvider
();
}
private
Properties
createCacheManagerProperties
(
Resource
configLocation
)
throws
IOException
{
private
Properties
createCacheManagerProperties
(
Resource
configLocation
)
throws
IOException
{
Properties
properties
=
new
Properties
();
// Hazelcast does not use the URI as a mean to specify a custom config.
properties
.
setProperty
(
"hazelcast.config.location"
,
configLocation
.
getURI
().
toString
());
properties
.
setProperty
(
"hazelcast.config.location"
,
configLocation
.
getURI
()
.
toString
());
return
properties
;
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java
View file @
59692cd9
...
...
@@ -269,9 +269,9 @@ public class CacheAutoConfigurationTests {
public
void
jCacheCacheWithWrongConfig
()
{
String
cachingProviderFqn
=
MockCachingProvider
.
class
.
getName
();
String
configLocation
=
"org/springframework/boot/autoconfigure/cache/does-not-exist.xml"
;
thrown
.
expect
(
BeanCreationException
.
class
);
thrown
.
expectMessage
(
"spring.cache.config"
);
thrown
.
expectMessage
(
configLocation
);
th
is
.
th
rown
.
expect
(
BeanCreationException
.
class
);
th
is
.
th
rown
.
expectMessage
(
"spring.cache.config"
);
th
is
.
th
rown
.
expectMessage
(
configLocation
);
load
(
JCacheCustomConfiguration
.
class
,
"spring.cache.type=jcache"
,
"spring.cache.jcache.provider="
+
cachingProviderFqn
,
"spring.cache.config="
+
configLocation
);
...
...
@@ -367,11 +367,12 @@ public class CacheAutoConfigurationTests {
try
{
load
(
DefaultCacheConfiguration
.
class
,
"spring.cache.type=jcache"
,
"spring.cache.jcache.provider="
+
cachingProviderFqn
,
"spring.cache.config="
+
configLocation
);
"spring.cache.config="
+
configLocation
);
cacheManager
=
validateCacheManager
(
JCacheCacheManager
.
class
);
Resource
configResource
=
new
ClassPathResource
(
configLocation
);
assertThat
(
cacheManager
.
getCacheManager
().
getURI
(),
is
(
configResource
.
getURI
()));
assertThat
(
cacheManager
.
getCacheManager
().
getURI
(),
is
(
configResource
.
getURI
()));
}
finally
{
if
(
cacheManager
!=
null
)
{
...
...
spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java
View file @
59692cd9
...
...
@@ -42,7 +42,8 @@ public class CommandLineIT {
InterruptedException
{
Invocation
cli
=
this
.
cli
.
invoke
(
"hint"
);
assertThat
(
cli
.
await
(),
equalTo
(
0
));
assertThat
(
"Unexpected error: \n"
+
cli
.
getErrorOutput
(),
cli
.
getErrorOutput
().
length
(),
equalTo
(
0
));
assertThat
(
"Unexpected error: \n"
+
cli
.
getErrorOutput
(),
cli
.
getErrorOutput
()
.
length
(),
equalTo
(
0
));
assertThat
(
cli
.
getStandardOutputLines
().
size
(),
equalTo
(
10
));
}
...
...
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