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
01c9d726
Commit
01c9d726
authored
Apr 06, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
d1a48733
Changes
31
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
164 additions
and
177 deletions
+164
-177
InfoEndpoint.java
...g/springframework/boot/actuate/endpoint/InfoEndpoint.java
+2
-1
RabbitAutoConfiguration.java
...work/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
+2
-2
ActiveMQProperties.java
...k/boot/autoconfigure/jms/activemq/ActiveMQProperties.java
+2
-2
ImportAutoConfiguration.java
...work/boot/autoconfigure/test/ImportAutoConfiguration.java
+1
-1
package-info.java
...springframework/boot/autoconfigure/test/package-info.java
+1
-1
VelocityAutoConfiguration.java
...oot/autoconfigure/velocity/VelocityAutoConfiguration.java
+1
-1
VelocityProperties.java
...ework/boot/autoconfigure/velocity/VelocityProperties.java
+2
-2
VelocityTemplateAvailabilityProvider.java
...figure/velocity/VelocityTemplateAvailabilityProvider.java
+2
-2
RabbitAutoConfigurationTests.java
...boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
+2
-2
SampleDataGemFireApplication.java
...ava/sample/data/gemfire/SampleDataGemFireApplication.java
+38
-48
Gemstone.java
...re/src/main/java/sample/data/gemfire/domain/Gemstone.java
+13
-16
GemstoneServiceImpl.java
...java/sample/data/gemfire/service/GemstoneServiceImpl.java
+20
-40
IllegalGemstoneException.java
...sample/data/gemfire/service/IllegalGemstoneException.java
+30
-0
SampleDataGemFireApplicationTests.java
...ample/data/gemfire/SampleDataGemFireApplicationTests.java
+22
-34
ConfigFileApplicationContextInitializer.java
...rk/boot/test/ConfigFileApplicationContextInitializer.java
+1
-1
EnvironmentTestUtils.java
...a/org/springframework/boot/test/EnvironmentTestUtils.java
+1
-1
IntegrationTest.java
...n/java/org/springframework/boot/test/IntegrationTest.java
+1
-1
IntegrationTestPropertiesListener.java
...ramework/boot/test/IntegrationTestPropertiesListener.java
+1
-1
MergedContextConfigurationProperties.java
...ework/boot/test/MergedContextConfigurationProperties.java
+1
-1
OutputCapture.java
...ain/java/org/springframework/boot/test/OutputCapture.java
+1
-1
SpringApplicationConfiguration.java
...ngframework/boot/test/SpringApplicationConfiguration.java
+1
-1
SpringApplicationContextLoader.java
...ngframework/boot/test/SpringApplicationContextLoader.java
+3
-4
SpringBootMockServletContext.java
...ringframework/boot/test/SpringBootMockServletContext.java
+1
-1
TestRestTemplate.java
.../java/org/springframework/boot/test/TestRestTemplate.java
+1
-1
WebAppIntegrationTestContextBootstrapper.java
...k/boot/test/WebAppIntegrationTestContextBootstrapper.java
+1
-1
WebIntegrationTest.java
...ava/org/springframework/boot/test/WebIntegrationTest.java
+1
-1
ConfigFileApplicationListener.java
...rk/boot/context/config/ConfigFileApplicationListener.java
+2
-2
ConfigurationProperties.java
...work/boot/context/properties/ConfigurationProperties.java
+2
-2
SpringNamingStrategy.java
...ramework/boot/orm/jpa/hibernate/SpringNamingStrategy.java
+2
-2
EmbeddedVelocityViewResolver.java
...b/servlet/view/velocity/EmbeddedVelocityViewResolver.java
+2
-2
ConfigFileApplicationListenerTests.java
...ot/context/config/ConfigFileApplicationListenerTests.java
+4
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InfoEndpoint.java
View file @
01c9d726
...
@@ -60,7 +60,8 @@ public class InfoEndpoint extends AbstractEndpoint<Info> {
...
@@ -60,7 +60,8 @@ public class InfoEndpoint extends AbstractEndpoint<Info> {
/**
/**
* Return additional information to include in the output.
* Return additional information to include in the output.
* @return additional information
* @return additional information
* @deprecated define an additional {@link InfoContributor} bean instead.
* @deprecated as of 1.4 in favor of defining an additional {@link InfoContributor}
* bean.
*/
*/
@Deprecated
@Deprecated
protected
Map
<
String
,
Object
>
getAdditionalInfo
()
{
protected
Map
<
String
,
Object
>
getAdditionalInfo
()
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
View file @
01c9d726
...
@@ -181,8 +181,8 @@ public class RabbitAutoConfiguration {
...
@@ -181,8 +181,8 @@ public class RabbitAutoConfiguration {
}
}
private
boolean
determineMandatoryFlag
()
{
private
boolean
determineMandatoryFlag
()
{
Boolean
flag
=
this
.
properties
.
getTemplate
().
getMandatory
();
Boolean
mandatory
=
this
.
properties
.
getTemplate
().
getMandatory
();
return
(
flag
!=
null
?
flag
:
this
.
properties
.
isPublisherReturns
());
return
(
mandatory
!=
null
?
mandatory
:
this
.
properties
.
isPublisherReturns
());
}
}
private
RetryTemplate
createRetryTemplate
(
RabbitProperties
.
Retry
properties
)
{
private
RetryTemplate
createRetryTemplate
(
RabbitProperties
.
Retry
properties
)
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java
View file @
01c9d726
...
@@ -71,7 +71,7 @@ public class ActiveMQProperties {
...
@@ -71,7 +71,7 @@ public class ActiveMQProperties {
/**
/**
* Get if pooling is enabled.
* Get if pooling is enabled.
* @return if pooling is enabled
* @return if pooling is enabled
* @deprecated
since
1.4 in favor of "spring.activemq.pool.enabled"
* @deprecated
as of
1.4 in favor of "spring.activemq.pool.enabled"
*/
*/
@Deprecated
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"spring.activemq.pool.enabled"
)
@DeprecatedConfigurationProperty
(
replacement
=
"spring.activemq.pool.enabled"
)
...
@@ -82,7 +82,7 @@ public class ActiveMQProperties {
...
@@ -82,7 +82,7 @@ public class ActiveMQProperties {
/**
/**
* Set if pooling is enabled.
* Set if pooling is enabled.
* @param pooled the pooling enabled value
* @param pooled the pooling enabled value
* @deprecated
since
1.4 in favor of "spring.activemq.pool.enabled"
* @deprecated
as of
1.4 in favor of "spring.activemq.pool.enabled"
*/
*/
@Deprecated
@Deprecated
public
void
setPooled
(
boolean
pooled
)
{
public
void
setPooled
(
boolean
pooled
)
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/test/ImportAutoConfiguration.java
View file @
01c9d726
...
@@ -33,7 +33,7 @@ import org.springframework.core.annotation.AliasFor;
...
@@ -33,7 +33,7 @@ import org.springframework.core.annotation.AliasFor;
*
*
* @author Phillip Webb
* @author Phillip Webb
* @since 1.3.0
* @since 1.3.0
* @deprecated
since 1.4.0
in favor of
* @deprecated
as of 1.4
in favor of
* {@link org.springframework.boot.autoconfigure.ImportAutoConfiguration}
* {@link org.springframework.boot.autoconfigure.ImportAutoConfiguration}
*/
*/
@Target
(
ElementType
.
TYPE
)
@Target
(
ElementType
.
TYPE
)
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/test/package-info.java
View file @
01c9d726
...
@@ -16,6 +16,6 @@
...
@@ -16,6 +16,6 @@
/**
/**
* Test utilities related to auto-configuration.
* Test utilities related to auto-configuration.
* @deprecated
in 1.4.0
in favor of the {@code spring-boot-test-autoconfigure} module
* @deprecated
as of 1.4
in favor of the {@code spring-boot-test-autoconfigure} module
*/
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
test
;
package
org
.
springframework
.
boot
.
autoconfigure
.
test
;
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/velocity/VelocityAutoConfiguration.java
View file @
01c9d726
...
@@ -55,7 +55,7 @@ import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
...
@@ -55,7 +55,7 @@ import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
* @author Andy Wilkinson
* @author Andy Wilkinson
* @author Brian Clozel
* @author Brian Clozel
* @since 1.1.0
* @since 1.1.0
* @deprecated
In 1.4.0
following the deprecation of Velocity support in Spring Framework
* @deprecated
as of 1.4
following the deprecation of Velocity support in Spring Framework
* 4.3
* 4.3
*/
*/
@Configuration
@Configuration
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/velocity/VelocityProperties.java
View file @
01c9d726
/*
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -28,7 +28,7 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
...
@@ -28,7 +28,7 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @since 1.1.0
* @since 1.1.0
* @deprecated
In 1.4.0
following the deprecation of Velocity support in Spring Framework
* @deprecated
as of 1.4
following the deprecation of Velocity support in Spring Framework
* 4.3
* 4.3
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/velocity/VelocityTemplateAvailabilityProvider.java
View file @
01c9d726
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -29,7 +29,7 @@ import org.springframework.util.ClassUtils;
...
@@ -29,7 +29,7 @@ import org.springframework.util.ClassUtils;
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @since 1.1.0
* @since 1.1.0
* @deprecated
In 1.4.0
following the deprecation of Velocity support in Spring Framework
* @deprecated
as of 1.4
following the deprecation of Velocity support in Spring Framework
* 4.3
* 4.3
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
View file @
01c9d726
...
@@ -384,8 +384,8 @@ public class RabbitAutoConfigurationTests {
...
@@ -384,8 +384,8 @@ public class RabbitAutoConfigurationTests {
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
private
boolean
getMandatory
(
RabbitTemplate
rabbitTemplate
)
{
private
boolean
getMandatory
(
RabbitTemplate
rabbitTemplate
)
{
ValueExpression
<
Boolean
>
expression
=
(
ValueExpression
<
Boolean
>)
ValueExpression
<
Boolean
>
expression
=
(
ValueExpression
<
Boolean
>)
new
DirectFieldAccessor
(
new
DirectFieldAccessor
(
rabbitTemplate
).
getPropertyValue
(
"mandatoryExpression"
);
rabbitTemplate
).
getPropertyValue
(
"mandatoryExpression"
);
return
expression
.
getValue
();
return
expression
.
getValue
();
}
}
...
...
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java
View file @
01c9d726
...
@@ -47,71 +47,61 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
...
@@ -47,71 +47,61 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableConfigurationProperties
(
SampleDataGemFireProperties
.
class
)
@EnableConfigurationProperties
(
SampleDataGemFireProperties
.
class
)
public
class
SampleDataGemFireApplication
{
public
class
SampleDataGemFireApplication
{
pr
otected
static
final
String
GEMSTONES_REGION_NAME
=
"Gemstones"
;
pr
ivate
static
final
String
GEMSTONES_REGION_NAME
=
"Gemstones"
;
private
final
SampleDataGemFireProperties
applicationP
roperties
;
private
final
SampleDataGemFireProperties
p
roperties
;
public
SampleDataGemFireApplication
(
SampleDataGemFireProperties
applicationProperties
)
{
public
SampleDataGemFireApplication
(
this
.
applicationProperties
=
applicationProperties
;
SampleDataGemFireProperties
applicationProperties
)
{
this
.
properties
=
applicationProperties
;
}
}
public
static
void
main
(
final
String
[]
args
)
{
SpringApplication
.
run
(
SampleDataGemFireApplication
.
class
,
args
);
}
@Bean
@Bean
CacheFactoryBean
gemfireCache
()
{
public
CacheFactoryBean
gemfireCache
()
{
CacheFactoryBean
gemfireCache
=
new
CacheFactoryBean
();
CacheFactoryBean
cache
=
new
CacheFactoryBean
();
cache
.
setClose
(
true
);
gemfireCache
.
setClose
(
true
);
cache
.
setProperties
(
getCacheProperties
());
gemfireCache
.
setProperties
(
gemfireProperties
());
return
cache
;
return
gemfireCache
;
}
}
private
Properties
gemfireProperties
()
{
private
Properties
getCacheProperties
()
{
Properties
gemfireProperties
=
new
Properties
();
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"name"
,
gemfireProperties
.
setProperty
(
"name"
,
SampleDataGemFireApplication
.
class
.
getSimpleName
());
SampleDataGemFireApplication
.
class
.
getSimpleName
());
gemfireProperties
.
setProperty
(
"mcast-port"
,
"0"
);
properties
.
setProperty
(
"mcast-port"
,
"0"
);
gemfireProperties
.
setProperty
(
"locators"
,
""
);
properties
.
setProperty
(
"locators"
,
""
);
gemfireProperties
.
setProperty
(
"log-level"
,
this
.
applicationProperties
.
getLogLevel
());
properties
.
setProperty
(
"log-level"
,
this
.
properties
.
getLogLevel
());
return
properties
;
return
gemfireProperties
;
}
}
@Bean
(
name
=
GEMSTONES_REGION_NAME
)
@Bean
(
name
=
GEMSTONES_REGION_NAME
)
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>
gemstonesRegion
(
Cache
gemfireCache
,
public
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>
gemstonesRegion
(
Cache
cache
,
RegionAttributes
<
Long
,
Gemstone
>
gemstonesRegionAttributes
)
{
RegionAttributes
<
Long
,
Gemstone
>
attributes
)
{
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>
region
=
new
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>();
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>
gemstonesRegion
=
region
.
setAttributes
(
attributes
);
new
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>();
region
.
setClose
(
false
);
region
.
setCache
(
cache
);
gemstonesRegion
.
setAttributes
(
gemstonesRegionAttributes
);
region
.
setName
(
GEMSTONES_REGION_NAME
);
gemstonesRegion
.
setClose
(
false
);
region
.
setPersistent
(
false
);
gemstonesRegion
.
setCache
(
gemfireCache
);
return
region
;
gemstonesRegion
.
setName
(
GEMSTONES_REGION_NAME
);
gemstonesRegion
.
setPersistent
(
false
);
return
gemstonesRegion
;
}
}
@Bean
@Bean
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
({
"unchecked"
,
"deprecation"
})
RegionAttributesFactoryBean
gemstonesRegionAttributes
()
{
public
RegionAttributesFactoryBean
gemstonesRegionAttributes
()
{
RegionAttributesFactoryBean
gemstonesRegionAttributes
=
RegionAttributesFactoryBean
attributes
=
new
RegionAttributesFactoryBean
();
new
RegionAttributesFactoryBean
();
attributes
.
setKeyConstraint
(
Long
.
class
);
attributes
.
setValueConstraint
(
Gemstone
.
class
);
gemstonesRegionAttributes
.
setKeyConstraint
(
Long
.
class
);
return
attributes
;
gemstonesRegionAttributes
.
setValueConstraint
(
Gemstone
.
class
);
return
gemstonesRegionAttributes
;
}
}
@Bean
@Bean
GemfireTransactionManager
gemfireTransactionManager
(
Cache
gemfireCache
)
{
public
GemfireTransactionManager
gemfireTransactionManager
(
Cache
gemfireCache
)
{
return
new
GemfireTransactionManager
(
gemfireCache
);
return
new
GemfireTransactionManager
(
gemfireCache
);
}
}
public
static
void
main
(
final
String
[]
args
)
{
SpringApplication
.
run
(
SampleDataGemFireApplication
.
class
,
args
);
}
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/domain/Gemstone.java
View file @
01c9d726
...
@@ -18,6 +18,7 @@ package sample.data.gemfire.domain;
...
@@ -18,6 +18,7 @@ package sample.data.gemfire.domain;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
org.springframework.core.style.ToStringCreator
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.gemfire.mapping.Region
;
import
org.springframework.data.gemfire.mapping.Region
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -39,11 +40,11 @@ public class Gemstone implements Serializable {
...
@@ -39,11 +40,11 @@ public class Gemstone implements Serializable {
public
Gemstone
()
{
public
Gemstone
()
{
}
}
public
Gemstone
(
final
Long
id
)
{
public
Gemstone
(
Long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
Gemstone
(
final
Long
id
,
final
String
name
)
{
public
Gemstone
(
Long
id
,
String
name
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
name
=
name
;
this
.
name
=
name
;
}
}
...
@@ -52,7 +53,7 @@ public class Gemstone implements Serializable {
...
@@ -52,7 +53,7 @@ public class Gemstone implements Serializable {
return
this
.
id
;
return
this
.
id
;
}
}
public
void
setId
(
final
Long
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
...
@@ -60,36 +61,32 @@ public class Gemstone implements Serializable {
...
@@ -60,36 +61,32 @@ public class Gemstone implements Serializable {
return
this
.
name
;
return
this
.
name
;
}
}
public
void
setName
(
final
String
name
)
{
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
}
}
@Override
@Override
public
boolean
equals
(
final
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
this
)
{
if
(
obj
==
this
)
{
return
true
;
return
true
;
}
}
if
(
obj
==
null
||
!
obj
.
getClass
().
equals
(
getClass
()))
{
if
(!(
obj
instanceof
Gemstone
))
{
return
false
;
return
false
;
}
}
return
ObjectUtils
.
nullSafeEquals
(
this
.
getName
(),
((
Gemstone
)
obj
).
getName
());
Gemstone
that
=
(
Gemstone
)
obj
;
return
ObjectUtils
.
nullSafeEquals
(
this
.
getName
(),
that
.
getName
());
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
hashValue
=
17
;
return
ObjectUtils
.
nullSafeHashCode
(
getName
());
hashValue
=
37
*
hashValue
+
ObjectUtils
.
nullSafeHashCode
(
getName
());
return
hashValue
;
}
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
String
.
format
(
"{ @type = %1$s, id = %2$d, name = %3$s }"
,
ToStringCreator
creator
=
new
ToStringCreator
(
this
);
getClass
().
getName
(),
getId
(),
getName
());
creator
.
append
(
"id"
,
this
.
id
);
creator
.
append
(
"name"
,
this
.
name
);
return
creator
.
toString
();
}
}
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/GemstoneServiceImpl.java
View file @
01c9d726
...
@@ -16,15 +16,14 @@
...
@@ -16,15 +16,14 @@
package
sample
.
data
.
gemfire
.
service
;
package
sample
.
data
.
gemfire
.
service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
sample.data.gemfire.domain.Gemstone
;
import
sample.data.gemfire.domain.Gemstone
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
...
@@ -39,14 +38,18 @@ import org.springframework.util.Assert;
...
@@ -39,14 +38,18 @@ import org.springframework.util.Assert;
@Service
(
"gemstoneService"
)
@Service
(
"gemstoneService"
)
public
class
GemstoneServiceImpl
implements
GemstoneService
{
public
class
GemstoneServiceImpl
implements
GemstoneService
{
protected
static
final
List
<
String
>
APPROVED_GEMS
=
new
ArrayList
<
String
>(
protected
static
final
List
<
String
>
APPROVED_GEMS
;
Arrays
.
asList
(
"ALEXANDRITE"
,
"AQUAMARINE"
,
"DIAMOND"
,
"OPAL"
,
"PEARL"
,
"RUBY"
,
"SAPPHIRE"
,
"SPINEL"
,
"TOPAZ"
));
private
final
GemstoneRepository
gemstoneRepository
;
static
{
APPROVED_GEMS
=
Collections
.
unmodifiableList
(
Arrays
.
asList
(
"ALEXANDRITE,AQUAMARINE,DIAMOND,OPAL,PEARL,"
+
"RUBY,SAPPHIRE,SPINEL,TOPAZ"
.
split
(
","
)));
}
private
final
GemstoneRepository
repository
;
public
GemstoneServiceImpl
(
GemstoneRepository
gemstoneRepository
)
{
public
GemstoneServiceImpl
(
GemstoneRepository
gemstoneRepository
)
{
this
.
gemstoneR
epository
=
gemstoneRepository
;
this
.
r
epository
=
gemstoneRepository
;
}
}
@PostConstruct
@PostConstruct
...
@@ -56,20 +59,16 @@ public class GemstoneServiceImpl implements GemstoneService {
...
@@ -56,20 +59,16 @@ public class GemstoneServiceImpl implements GemstoneService {
/**
/**
* Returns a count of the number of Gemstones in the GemFire Cache.
* Returns a count of the number of Gemstones in the GemFire Cache.
* <p/>
*
* @return a long value indicating the number of Gemstones in the GemFire Cache.
* @return a long value indicating the number of Gemstones in the GemFire Cache.
*/
*/
@Override
@Override
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
long
count
()
{
public
long
count
()
{
return
this
.
gemstoneR
epository
.
count
();
return
this
.
r
epository
.
count
();
}
}
/**
/**
* Gets a Gemstone by ID.
* Gets a Gemstone by ID.
* <p/>
*
* @param id a long value indicating the identifier of the Gemstone.
* @param id a long value indicating the identifier of the Gemstone.
* @return a Gemstone with ID, or null if no Gemstone exists with ID.
* @return a Gemstone with ID, or null if no Gemstone exists with ID.
* @see sample.data.gemfire.domain.Gemstone
* @see sample.data.gemfire.domain.Gemstone
...
@@ -77,13 +76,11 @@ public class GemstoneServiceImpl implements GemstoneService {
...
@@ -77,13 +76,11 @@ public class GemstoneServiceImpl implements GemstoneService {
@Override
@Override
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
Gemstone
get
(
Long
id
)
{
public
Gemstone
get
(
Long
id
)
{
return
this
.
gemstoneR
epository
.
findOne
(
id
);
return
this
.
r
epository
.
findOne
(
id
);
}
}
/**
/**
* Gets a Gemstone by name.
* Gets a Gemstone by name.
* <p/>
*
* @param name a String value indicating the name of the Gemstone.
* @param name a String value indicating the name of the Gemstone.
* @return a Gemstone with name, or null if no Gemstone exists with name.
* @return a Gemstone with name, or null if no Gemstone exists with name.
* @see sample.data.gemfire.domain.Gemstone
* @see sample.data.gemfire.domain.Gemstone
...
@@ -91,13 +88,11 @@ public class GemstoneServiceImpl implements GemstoneService {
...
@@ -91,13 +88,11 @@ public class GemstoneServiceImpl implements GemstoneService {
@Override
@Override
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
Gemstone
get
(
String
name
)
{
public
Gemstone
get
(
String
name
)
{
return
this
.
gemstoneR
epository
.
findByName
(
name
);
return
this
.
r
epository
.
findByName
(
name
);
}
}
/**
/**
* Return a listing of Gemstones currently stored in the GemFire Cache.
* Return a listing of Gemstones currently stored in the GemFire Cache.
* <p/>
*
* @return an Iterable object to iterate over the list of Gemstones currently stored
* @return an Iterable object to iterate over the list of Gemstones currently stored
* in the GemFire Cache.
* in the GemFire Cache.
* @see java.lang.Iterable
* @see java.lang.Iterable
...
@@ -106,13 +101,11 @@ public class GemstoneServiceImpl implements GemstoneService {
...
@@ -106,13 +101,11 @@ public class GemstoneServiceImpl implements GemstoneService {
@Override
@Override
@Transactional
(
readOnly
=
true
)
@Transactional
(
readOnly
=
true
)
public
Iterable
<
Gemstone
>
list
()
{
public
Iterable
<
Gemstone
>
list
()
{
return
this
.
gemstoneR
epository
.
findAll
();
return
this
.
r
epository
.
findAll
();
}
}
/**
/**
* Saves the specified Gemstone to the GemFire Cache.
* Saves the specified Gemstone to the GemFire Cache.
* <p/>
*
* @param gemstone the Gemstone to save in the GemFire Cache.
* @param gemstone the Gemstone to save in the GemFire Cache.
* @return the saved Gemstone.
* @return the saved Gemstone.
* @see sample.data.gemfire.domain.Gemstone
* @see sample.data.gemfire.domain.Gemstone
...
@@ -122,17 +115,13 @@ public class GemstoneServiceImpl implements GemstoneService {
...
@@ -122,17 +115,13 @@ public class GemstoneServiceImpl implements GemstoneService {
public
Gemstone
save
(
Gemstone
gemstone
)
{
public
Gemstone
save
(
Gemstone
gemstone
)
{
Assert
.
notNull
(
gemstone
,
"The Gemstone to save must not be null!"
);
Assert
.
notNull
(
gemstone
,
"The Gemstone to save must not be null!"
);
Assert
.
notNull
(
gemstone
.
getName
(),
"The name of the Gemstone must be specified!"
);
Assert
.
notNull
(
gemstone
.
getName
(),
"The name of the Gemstone must be specified!"
);
// NOTE deliberately (& naively) validate the Gemstone after mutating data access
// NOTE deliberately (& naively) validate the Gemstone after mutating data access in
// in GemFire rather than before to demonstrate transactions in GemFire.
// GemFire rather than before to demonstrate transactions in GemFire.
Gemstone
savedGemstone
=
validate
(
this
.
repository
.
save
(
gemstone
));
Gemstone
savedGemstone
=
validate
(
this
.
gemstoneRepository
.
save
(
gemstone
));
Assert
.
state
(
savedGemstone
.
equals
(
get
(
gemstone
.
getId
())),
String
.
format
(
"Failed to find Gemstone (%1$s) in "
Assert
.
state
(
savedGemstone
.
equals
(
get
(
gemstone
.
getId
())),
String
.
format
(
+
"GemFire's Cache Region 'Gemstones'!"
,
gemstone
));
"Failed to find Gemstone (%1$s) in GemFire's Cache Region 'Gemstones'!"
,
gemstone
));
System
.
out
.
printf
(
"Saved Gemstone [%1$s]%n"
,
savedGemstone
.
getName
());
System
.
out
.
printf
(
"Saved Gemstone [%1$s]%n"
,
savedGemstone
.
getName
());
return
gemstone
;
return
gemstone
;
}
}
...
@@ -144,16 +133,7 @@ public class GemstoneServiceImpl implements GemstoneService {
...
@@ -144,16 +133,7 @@ public class GemstoneServiceImpl implements GemstoneService {
throw
new
IllegalGemstoneException
(
throw
new
IllegalGemstoneException
(
String
.
format
(
"[%1$s] is not a valid Gemstone!"
,
gemstone
.
getName
()));
String
.
format
(
"[%1$s] is not a valid Gemstone!"
,
gemstone
.
getName
()));
}
}
return
gemstone
;
return
gemstone
;
}
}
public
static
final
class
IllegalGemstoneException
extends
IllegalArgumentException
{
public
IllegalGemstoneException
(
String
message
)
{
super
(
message
);
}
}
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/IllegalGemstoneException.java
0 → 100644
View file @
01c9d726
/*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
.
service
;
/**
* Exception thrown from {@link GemstoneService}.
*
* @author John Blum
*/
public
class
IllegalGemstoneException
extends
IllegalArgumentException
{
public
IllegalGemstoneException
(
String
message
)
{
super
(
message
);
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/test/java/sample/data/gemfire/SampleDataGemFireApplicationTests.java
View file @
01c9d726
...
@@ -22,7 +22,7 @@ import org.junit.Test;
...
@@ -22,7 +22,7 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
sample.data.gemfire.domain.Gemstone
;
import
sample.data.gemfire.domain.Gemstone
;
import
sample.data.gemfire.service.GemstoneService
;
import
sample.data.gemfire.service.GemstoneService
;
import
sample.data.gemfire.service.
GemstoneServiceImpl.
IllegalGemstoneException
;
import
sample.data.gemfire.service.IllegalGemstoneException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
...
@@ -40,54 +40,42 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -40,54 +40,42 @@ import static org.assertj.core.api.Assertions.assertThat;
public
class
SampleDataGemFireApplicationTests
{
public
class
SampleDataGemFireApplicationTests
{
@Autowired
@Autowired
private
GemstoneService
gemstoneS
ervice
;
private
GemstoneService
s
ervice
;
private
final
AtomicLong
idGenerator
=
new
AtomicLong
(
0L
);
private
final
AtomicLong
idGenerator
=
new
AtomicLong
(
0L
);
@Test
@Test
public
void
gemstonesAppServiceEndpoints
()
{
public
void
gemstonesAppServiceEndpoints
()
{
assertThat
(
this
.
gemstoneService
.
count
()).
isEqualTo
(
0
);
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
0
);
assertThat
(
this
.
gemstoneService
.
list
()).
isEmpty
();
assertThat
(
this
.
service
.
list
()).
isEmpty
();
this
.
service
.
save
(
createGemstone
(
"Diamond"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Diamond"
));
this
.
service
.
save
(
createGemstone
(
"Ruby"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Ruby"
));
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
2
);
assertThat
(
this
.
service
.
list
()).
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
));
assertThat
(
this
.
gemstoneService
.
count
()).
isEqualTo
(
2
);
assertThat
(
this
.
gemstoneService
.
list
()).
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
));
try
{
try
{
this
.
gemstoneS
ervice
.
save
(
createGemstone
(
"Coal"
));
this
.
s
ervice
.
save
(
createGemstone
(
"Coal"
));
}
}
catch
(
IllegalGemstoneException
ignore
)
{
catch
(
IllegalGemstoneException
ignore
)
{
// expected
// expected
}
}
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
2
);
assertThat
(
this
.
gemstoneService
.
count
()).
isEqualTo
(
2
);
assertThat
(
this
.
service
.
list
()).
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
));
assertThat
(
this
.
gemstoneService
.
list
()).
contains
(
this
.
service
.
save
(
createGemstone
(
"Pearl"
));
getGemstones
(
"Diamond"
,
"Ruby"
));
this
.
service
.
save
(
createGemstone
(
"Sapphire"
));
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
4
);
this
.
gemstoneService
.
save
(
createGemstone
(
"Pearl"
));
assertThat
(
this
.
service
.
list
())
this
.
gemstoneService
.
save
(
createGemstone
(
"Sapphire"
));
.
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
));
assertThat
(
this
.
gemstoneService
.
count
()).
isEqualTo
(
4
);
assertThat
(
this
.
gemstoneService
.
list
()).
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
));
try
{
try
{
this
.
gemstoneS
ervice
.
save
(
createGemstone
(
"Quartz"
));
this
.
s
ervice
.
save
(
createGemstone
(
"Quartz"
));
}
}
catch
(
IllegalGemstoneException
ignore
)
{
catch
(
IllegalGemstoneException
ignore
)
{
// expected
// expected
}
}
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
4
);
assertThat
(
this
.
gemstoneService
.
count
()).
isEqualTo
(
4
);
assertThat
(
this
.
service
.
list
())
assertThat
(
this
.
gemstoneService
.
list
()).
contains
(
.
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
));
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
));
assertThat
(
this
.
service
.
get
(
"Diamond"
)).
isEqualTo
(
createGemstone
(
"Diamond"
));
assertThat
(
this
.
gemstoneService
.
get
(
"Diamond"
)).
isEqualTo
(
assertThat
(
this
.
service
.
get
(
"Pearl"
)).
isEqualTo
(
createGemstone
(
"Pearl"
));
createGemstone
(
"Diamond"
));
assertThat
(
this
.
gemstoneService
.
get
(
"Pearl"
)).
isEqualTo
(
createGemstone
(
"Pearl"
));
}
}
private
Gemstone
[]
getGemstones
(
String
...
names
)
{
private
Gemstone
[]
getGemstones
(
String
...
names
)
{
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/ConfigFileApplicationContextInitializer.java
View file @
01c9d726
...
@@ -27,7 +27,7 @@ import org.springframework.test.context.ContextConfiguration;
...
@@ -27,7 +27,7 @@ import org.springframework.test.context.ContextConfiguration;
*
*
* @author Phillip Webb
* @author Phillip Webb
* @see ConfigFileApplicationListener
* @see ConfigFileApplicationListener
* @deprecated
since 1.4.0
in favor of
* @deprecated
as of 1.4
in favor of
* {@link org.springframework.boot.test.context.ConfigFileApplicationContextInitializer}
* {@link org.springframework.boot.test.context.ConfigFileApplicationContextInitializer}
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/EnvironmentTestUtils.java
View file @
01c9d726
...
@@ -26,7 +26,7 @@ import org.springframework.core.env.Environment;
...
@@ -26,7 +26,7 @@ import org.springframework.core.env.Environment;
*
*
* @author Dave Syer
* @author Dave Syer
* @author Stephane Nicoll
* @author Stephane Nicoll
* @deprecated
since 1.4.0
in favor of
* @deprecated
as of 1.4
in favor of
* {@link org.springframework.boot.test.util.EnvironmentTestUtils}
* {@link org.springframework.boot.test.util.EnvironmentTestUtils}
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/IntegrationTest.java
View file @
01c9d726
...
@@ -41,7 +41,7 @@ import org.springframework.test.context.transaction.TransactionalTestExecutionLi
...
@@ -41,7 +41,7 @@ import org.springframework.test.context.transaction.TransactionalTestExecutionLi
*
*
* @author Dave Syer
* @author Dave Syer
* @see WebIntegrationTest
* @see WebIntegrationTest
* @deprecated
since 1.4.0
in favor of {@link SpringBootTest}
* @deprecated
as of 1.4
in favor of {@link SpringBootTest}
*/
*/
@Documented
@Documented
@Inherited
@Inherited
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/IntegrationTestPropertiesListener.java
View file @
01c9d726
...
@@ -30,7 +30,7 @@ import org.springframework.test.util.ReflectionTestUtils;
...
@@ -30,7 +30,7 @@ import org.springframework.test.util.ReflectionTestUtils;
* @author Dave Syer
* @author Dave Syer
* @author Phillip Webb
* @author Phillip Webb
* @since 1.2.0
* @since 1.2.0
* @deprecated
since 1.4.0
as no longer used by {@code @IntegrationTest}.
* @deprecated
as of 1.4
as no longer used by {@code @IntegrationTest}.
*/
*/
@Deprecated
@Deprecated
public
class
IntegrationTestPropertiesListener
extends
AbstractTestExecutionListener
{
public
class
IntegrationTestPropertiesListener
extends
AbstractTestExecutionListener
{
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/MergedContextConfigurationProperties.java
View file @
01c9d726
...
@@ -27,7 +27,7 @@ import org.springframework.test.util.ReflectionTestUtils;
...
@@ -27,7 +27,7 @@ import org.springframework.test.util.ReflectionTestUtils;
* Provides access to {@link MergedContextConfiguration} properties.
* Provides access to {@link MergedContextConfiguration} properties.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @deprecated
since 1.4.0
along with {@link IntegrationTestPropertiesListener}
* @deprecated
as of 1.4
along with {@link IntegrationTestPropertiesListener}
*/
*/
@Deprecated
@Deprecated
class
MergedContextConfigurationProperties
{
class
MergedContextConfigurationProperties
{
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/OutputCapture.java
View file @
01c9d726
...
@@ -21,7 +21,7 @@ package org.springframework.boot.test;
...
@@ -21,7 +21,7 @@ package org.springframework.boot.test;
*
*
* @author Phillip Webb
* @author Phillip Webb
* @author Andy Wilkinson
* @author Andy Wilkinson
* @deprecated
since 1.4.0
in favor of
* @deprecated
as of 1.4
in favor of
* {@link org.springframework.boot.test.rule.OutputCapture}
* {@link org.springframework.boot.test.rule.OutputCapture}
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/SpringApplicationConfiguration.java
View file @
01c9d726
...
@@ -41,7 +41,7 @@ import org.springframework.test.context.ContextConfiguration;
...
@@ -41,7 +41,7 @@ import org.springframework.test.context.ContextConfiguration;
* @author Sam Brannen
* @author Sam Brannen
* @see SpringBootContextLoader
* @see SpringBootContextLoader
* @see ContextConfiguration
* @see ContextConfiguration
* @deprecated
since 1.4.0
in favor of {@link SpringBootTest} or direct use of
* @deprecated
as of 1.4
in favor of {@link SpringBootTest} or direct use of
* {@link SpringBootContextLoader}.
* {@link SpringBootContextLoader}.
*/
*/
@ContextConfiguration
(
loader
=
SpringBootContextLoader
.
class
)
@ContextConfiguration
(
loader
=
SpringBootContextLoader
.
class
)
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java
View file @
01c9d726
...
@@ -70,10 +70,9 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
...
@@ -70,10 +70,9 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.boot.test.IntegrationTest
* @see org.springframework.boot.test.IntegrationTest
* @see org.springframework.boot.test.WebIntegrationTest
* @see org.springframework.boot.test.WebIntegrationTest
* @deprecated since 1.4.0 in favor of
* @deprecated as of 1.4 in favor of {@link SpringBootTest @SpringApplicationTest}
* {@link SpringBootTest @SpringApplicationTest}
* {@link org.springframework.boot.test.context.SpringBootContextLoader} can also be
* {@link org.springframework.boot.test.context.SpringBootContextLoader} can also
* considered if absolutely necessary.
* be considered if absolutely necessary.
*/
*/
@Deprecated
@Deprecated
public
class
SpringApplicationContextLoader
extends
AbstractContextLoader
{
public
class
SpringApplicationContextLoader
extends
AbstractContextLoader
{
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/SpringBootMockServletContext.java
View file @
01c9d726
...
@@ -25,7 +25,7 @@ import org.springframework.mock.web.MockServletContext;
...
@@ -25,7 +25,7 @@ import org.springframework.mock.web.MockServletContext;
* found.
* found.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @deprecated
since 1.4.0
in favor of
* @deprecated
as of 1.4
in favor of
* {@link org.springframework.boot.test.mock.web.SpringBootMockServletContext}
* {@link org.springframework.boot.test.mock.web.SpringBootMockServletContext}
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/TestRestTemplate.java
View file @
01c9d726
...
@@ -26,7 +26,7 @@ import org.springframework.web.client.RestTemplate;
...
@@ -26,7 +26,7 @@ import org.springframework.web.client.RestTemplate;
*
*
* @author Dave Syer
* @author Dave Syer
* @author Phillip Webb
* @author Phillip Webb
* @deprecated
since 1.4.0
in favor of
* @deprecated
as of 1.4
in favor of
* {@link org.springframework.boot.test.web.client.TestRestTemplate}
* {@link org.springframework.boot.test.web.client.TestRestTemplate}
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/WebAppIntegrationTestContextBootstrapper.java
View file @
01c9d726
...
@@ -29,7 +29,7 @@ import org.springframework.test.context.web.WebMergedContextConfiguration;
...
@@ -29,7 +29,7 @@ import org.springframework.test.context.web.WebMergedContextConfiguration;
*
*
* @author Phillip Webb
* @author Phillip Webb
* @since 1.2.1
* @since 1.2.1
* @deprecated
Since 1.4.0
* @deprecated
as of 1.4 along with {@link WebIntegrationTest}
*/
*/
@Deprecated
@Deprecated
class
WebAppIntegrationTestContextBootstrapper
extends
DefaultTestContextBootstrapper
{
class
WebAppIntegrationTestContextBootstrapper
extends
DefaultTestContextBootstrapper
{
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/WebIntegrationTest.java
View file @
01c9d726
...
@@ -39,7 +39,7 @@ import org.springframework.test.context.BootstrapWith;
...
@@ -39,7 +39,7 @@ import org.springframework.test.context.BootstrapWith;
* @author Phillip Webb
* @author Phillip Webb
* @since 1.2.1
* @since 1.2.1
* @see IntegrationTest
* @see IntegrationTest
* @deprecated
since 1.4.0
in favor of
* @deprecated
as of 1.4
in favor of
* {@link org.springframework.boot.test.context.SpringBootTest} with
* {@link org.springframework.boot.test.context.SpringBootTest} with
* {@code webEnvironment=RANDOM_PORT} or {@code webEnvironment=DEFINED_PORT}.
* {@code webEnvironment=RANDOM_PORT} or {@code webEnvironment=DEFINED_PORT}.
*/
*/
...
...
spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
View file @
01c9d726
...
@@ -582,8 +582,8 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
...
@@ -582,8 +582,8 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
}
}
private
Set
<
String
>
asResolvedSet
(
String
value
,
String
fallback
)
{
private
Set
<
String
>
asResolvedSet
(
String
value
,
String
fallback
)
{
List
<
String
>
list
=
Arrays
List
<
String
>
list
=
Arrays
.
asList
(
StringUtils
.
trimArrayElements
(
.
asList
(
StringUtils
.
trimArrayElements
(
StringUtils
.
commaDelimitedListToStringArray
(
value
!=
null
StringUtils
.
commaDelimitedListToStringArray
(
value
!=
null
?
this
.
environment
.
resolvePlaceholders
(
value
)
:
fallback
)));
?
this
.
environment
.
resolvePlaceholders
(
value
)
:
fallback
)));
Collections
.
reverse
(
list
);
Collections
.
reverse
(
list
);
return
new
LinkedHashSet
<
String
>(
list
);
return
new
LinkedHashSet
<
String
>(
list
);
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java
View file @
01c9d726
...
@@ -90,7 +90,7 @@ public @interface ConfigurationProperties {
...
@@ -90,7 +90,7 @@ public @interface ConfigurationProperties {
* defined in the environment.
* defined in the environment.
* @return the path (or paths) of resources to bind to
* @return the path (or paths) of resources to bind to
* @see #merge()
* @see #merge()
* @deprecated
since
1.4 in favor of configuring the environment directly with
* @deprecated
as of
1.4 in favor of configuring the environment directly with
* additional locations
* additional locations
*/
*/
@Deprecated
@Deprecated
...
@@ -101,7 +101,7 @@ public @interface ConfigurationProperties {
...
@@ -101,7 +101,7 @@ public @interface ConfigurationProperties {
* merged with the default configuration.
* merged with the default configuration.
* @return the flag value (default true)
* @return the flag value (default true)
* @see #locations()
* @see #locations()
* @deprecated
since
1.4 along with {@link #locations()} in favor of configuring the
* @deprecated
as of
1.4 along with {@link #locations()} in favor of configuring the
* environment directly with additional locations
* environment directly with additional locations
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringNamingStrategy.java
View file @
01c9d726
/*
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
...
@@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
* @author Phillip Webb
* @author Phillip Webb
* @see "http://stackoverflow.com/questions/7689206/ejb3namingstrategy-vs-improvednamingstrategy-foreign-key-naming"
* @see "http://stackoverflow.com/questions/7689206/ejb3namingstrategy-vs-improvednamingstrategy-foreign-key-naming"
* @since 1.2.0
* @since 1.2.0
* @deprecated
since 1.4.0
since {@link NamingStrategy} is no longer used by
* @deprecated
as of 1.4
since {@link NamingStrategy} is no longer used by
* {@link Hibernate}. Consider using {@link SpringPhysicalNamingStrategy}
* {@link Hibernate}. Consider using {@link SpringPhysicalNamingStrategy}
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot/src/main/java/org/springframework/boot/web/servlet/view/velocity/EmbeddedVelocityViewResolver.java
View file @
01c9d726
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -26,7 +26,7 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
...
@@ -26,7 +26,7 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
*
*
* @author Phillip Webb
* @author Phillip Webb
* @since 1.2.5
* @since 1.2.5
* @deprecated
In 1.4.0
following the deprecation of Velocity support in Spring Framework
* @deprecated
as of 1.4
following the deprecation of Velocity support in Spring Framework
* 4.3
* 4.3
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java
View file @
01c9d726
...
@@ -534,14 +534,16 @@ public class ConfigFileApplicationListenerTests {
...
@@ -534,14 +534,16 @@ public class ConfigFileApplicationListenerTests {
public
void
yamlSetsMultiProfiles
()
throws
Exception
{
public
void
yamlSetsMultiProfiles
()
throws
Exception
{
this
.
initializer
.
setSearchNames
(
"testsetmultiprofiles"
);
this
.
initializer
.
setSearchNames
(
"testsetmultiprofiles"
);
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"dev"
,
"healthcheck"
);
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"dev"
,
"healthcheck"
);
}
}
@Test
@Test
public
void
yamlSetsMultiProfilesWithWithespace
()
throws
Exception
{
public
void
yamlSetsMultiProfilesWithWithespace
()
throws
Exception
{
this
.
initializer
.
setSearchNames
(
"testsetmultiprofileswhitespace"
);
this
.
initializer
.
setSearchNames
(
"testsetmultiprofileswhitespace"
);
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"dev"
,
"healthcheck"
);
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"dev"
,
"healthcheck"
);
}
}
@Test
@Test
...
...
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