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
8b69856f
Commit
8b69856f
authored
Dec 28, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
97d7ffd8
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
64 additions
and
41 deletions
+64
-41
CrshAutoConfiguration.java
...ork/boot/actuate/autoconfigure/CrshAutoConfiguration.java
+1
-1
MetricRepositoryAutoConfiguration.java
...uate/autoconfigure/MetricRepositoryAutoConfiguration.java
+3
-2
ShellProperties.java
...framework/boot/actuate/autoconfigure/ShellProperties.java
+1
-1
InMemoryMetricRepository.java
.../actuate/metrics/repository/InMemoryMetricRepository.java
+3
-3
InMemoryMultiMetricRepository.java
...ate/metrics/repository/InMemoryMultiMetricRepository.java
+15
-4
JolokiaAutoConfigurationTests.java
.../actuate/autoconfigure/JolokiaAutoConfigurationTests.java
+1
-1
PrefixMetricGroupExporterTests.java
...ctuate/metrics/export/PrefixMetricGroupExporterTests.java
+6
-8
InMemoryMetricRepositoryTests.java
...ate/metrics/repository/InMemoryMetricRepositoryTests.java
+2
-0
InMemoryMultiMetricRepositoryTests.java
...etrics/repository/InMemoryMultiMetricRepositoryTests.java
+3
-2
ClusterBuilderCustomizer.java
...oot/autoconfigure/cassandra/ClusterBuilderCustomizer.java
+4
-2
SearchStrategy.java
...ramework/boot/autoconfigure/condition/SearchStrategy.java
+1
-1
DataSourceConfiguration.java
...work/boot/autoconfigure/jdbc/DataSourceConfiguration.java
+1
-1
LiveReloadServerTests.java
...ework/boot/devtools/livereload/LiveReloadServerTests.java
+0
-3
RemoteShellStarterDeprecatedWarningAutoConfiguration.java
...RemoteShellStarterDeprecatedWarningAutoConfiguration.java
+1
-1
AutoConfigureTestDatabase.java
...test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
+1
-1
SpringBootContextLoader.java
...gframework/boot/test/context/SpringBootContextLoader.java
+11
-4
SpringBootTestCustomPortTests.java
...work/boot/test/context/SpringBootTestCustomPortTests.java
+2
-2
SpringBootTestWebEnvironmentRandomPortCustomPortTests.java
...pringBootTestWebEnvironmentRandomPortCustomPortTests.java
+3
-1
DeprecatedSpringBootPlugin.java
...mework/boot/gradle/plugin/DeprecatedSpringBootPlugin.java
+1
-1
TomcatEmbeddedServletContainerFactory.java
...mbedded/tomcat/TomcatEmbeddedServletContainerFactory.java
+1
-1
ApplicationStartedEvent.java
...framework/boot/context/event/ApplicationStartedEvent.java
+1
-1
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+2
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java
View file @
8b69856f
...
@@ -115,7 +115,7 @@ import org.springframework.util.StringUtils;
...
@@ -115,7 +115,7 @@ import org.springframework.util.StringUtils;
* @author Christian Dupuis
* @author Christian Dupuis
* @author Matt Benson
* @author Matt Benson
* @see ShellProperties
* @see ShellProperties
* @deprecated as of 1.5
* @deprecated as of 1.5
since CRaSH is not actively maintained
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
PluginLifeCycle
.
class
)
@ConditionalOnClass
(
PluginLifeCycle
.
class
)
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java
View file @
8b69856f
...
@@ -158,8 +158,9 @@ public class MetricRepositoryAutoConfiguration {
...
@@ -158,8 +158,9 @@ public class MetricRepositoryAutoConfiguration {
@Bean
@Bean
@ExportMetricReader
@ExportMetricReader
@ActuatorMetricWriter
@ActuatorMetricWriter
public
InMemoryMultiMetricRepository
actuatorMultiMetricRepository
()
{
public
InMemoryMultiMetricRepository
actuatorMultiMetricRepository
(
return
new
InMemoryMultiMetricRepository
(
actuatorMetricRepository
());
InMemoryMetricRepository
actuatorMetricRepository
)
{
return
new
InMemoryMultiMetricRepository
(
actuatorMetricRepository
);
}
}
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java
View file @
8b69856f
...
@@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
...
@@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
* @author Phillip Webb
* @author Phillip Webb
* @author Eddú Meléndez
* @author Eddú Meléndez
* @author Stephane Nicoll
* @author Stephane Nicoll
* @deprecated as of 1.5
* @deprecated as of 1.5
since CRaSH is not actively maintained
*/
*/
@ConfigurationProperties
(
prefix
=
ShellProperties
.
SHELL_PREFIX
,
ignoreUnknownFields
=
true
)
@ConfigurationProperties
(
prefix
=
ShellProperties
.
SHELL_PREFIX
,
ignoreUnknownFields
=
true
)
@Deprecated
@Deprecated
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepository.java
View file @
8b69856f
...
@@ -44,16 +44,16 @@ public class InMemoryMetricRepository implements MetricRepository {
...
@@ -44,16 +44,16 @@ public class InMemoryMetricRepository implements MetricRepository {
final
int
amount
=
delta
.
getValue
().
intValue
();
final
int
amount
=
delta
.
getValue
().
intValue
();
final
Date
timestamp
=
delta
.
getTimestamp
();
final
Date
timestamp
=
delta
.
getTimestamp
();
this
.
metrics
.
update
(
metricName
,
new
Callback
<
Metric
<?>>()
{
this
.
metrics
.
update
(
metricName
,
new
Callback
<
Metric
<?>>()
{
@Override
@Override
public
Metric
<?>
modify
(
Metric
<?>
current
)
{
public
Metric
<?>
modify
(
Metric
<?>
current
)
{
if
(
current
!=
null
)
{
if
(
current
!=
null
)
{
return
new
Metric
<
Long
>(
metricName
,
return
new
Metric
<
Long
>(
metricName
,
current
.
increment
(
amount
).
getValue
(),
timestamp
);
current
.
increment
(
amount
).
getValue
(),
timestamp
);
}
}
else
{
return
new
Metric
<
Long
>(
metricName
,
(
long
)
amount
,
timestamp
);
return
new
Metric
<
Long
>(
metricName
,
(
long
)
amount
,
timestamp
);
}
}
}
});
});
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/InMemoryMultiMetricRepository.java
View file @
8b69856f
...
@@ -22,6 +22,7 @@ import java.util.HashSet;
...
@@ -22,6 +22,7 @@ import java.util.HashSet;
import
org.springframework.boot.actuate.metrics.Metric
;
import
org.springframework.boot.actuate.metrics.Metric
;
import
org.springframework.boot.actuate.metrics.writer.Delta
;
import
org.springframework.boot.actuate.metrics.writer.Delta
;
import
org.springframework.util.Assert
;
/**
/**
* {@link MultiMetricRepository} implementation backed by a
* {@link MultiMetricRepository} implementation backed by a
...
@@ -36,14 +37,24 @@ public class InMemoryMultiMetricRepository implements MultiMetricRepository {
...
@@ -36,14 +37,24 @@ public class InMemoryMultiMetricRepository implements MultiMetricRepository {
private
final
Collection
<
String
>
groups
=
new
HashSet
<
String
>();
private
final
Collection
<
String
>
groups
=
new
HashSet
<
String
>();
public
InMemoryMultiMetricRepository
(
InMemoryMetricRepository
repository
)
{
/**
this
.
repository
=
repository
;
* Create a new {@link InMemoryMetricRepository} backed by a new
}
* {@link InMemoryMetricRepository}.
*/
public
InMemoryMultiMetricRepository
()
{
public
InMemoryMultiMetricRepository
()
{
this
(
new
InMemoryMetricRepository
());
this
(
new
InMemoryMetricRepository
());
}
}
/**
* Create a new {@link InMemoryMetricRepository} backed by the specified
* {@link InMemoryMetricRepository}.
* @param repository the backing repository
*/
public
InMemoryMultiMetricRepository
(
InMemoryMetricRepository
repository
)
{
Assert
.
notNull
(
repository
,
"Repository must not be null"
);
this
.
repository
=
repository
;
}
@Override
@Override
public
void
set
(
String
group
,
Collection
<
Metric
<?>>
values
)
{
public
void
set
(
String
group
,
Collection
<
Metric
<?>>
values
)
{
String
prefix
=
group
;
String
prefix
=
group
;
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfigurationTests.java
View file @
8b69856f
...
@@ -145,7 +145,7 @@ public class JolokiaAutoConfigurationTests {
...
@@ -145,7 +145,7 @@ public class JolokiaAutoConfigurationTests {
Collection
<?
extends
MvcEndpoint
>
endpoints
)
{
Collection
<?
extends
MvcEndpoint
>
endpoints
)
{
EndpointHandlerMapping
mapping
=
new
EndpointHandlerMapping
(
endpoints
);
EndpointHandlerMapping
mapping
=
new
EndpointHandlerMapping
(
endpoints
);
mapping
.
setSecurityInterceptor
(
mapping
.
setSecurityInterceptor
(
new
MvcEndpointSecurityInterceptor
(
false
,
Collections
.
EMPTY_LIST
));
new
MvcEndpointSecurityInterceptor
(
false
,
Collections
.
emptyList
()
));
return
mapping
;
return
mapping
;
}
}
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/PrefixMetricGroupExporterTests.java
View file @
8b69856f
...
@@ -54,8 +54,8 @@ public class PrefixMetricGroupExporterTests {
...
@@ -54,8 +54,8 @@ public class PrefixMetricGroupExporterTests {
@Test
@Test
public
void
countersIncremented
()
{
public
void
countersIncremented
()
{
this
.
writer
.
increment
(
"counter.foo"
,
new
Delta
<
Long
>(
"bar"
,
1L
));
this
.
writer
.
increment
(
"counter.foo"
,
new
Delta
<
Long
>(
"bar"
,
1L
));
this
.
reader
.
set
(
"counter"
,
Collections
.<
Metric
<?>>
singletonList
(
this
.
reader
.
set
(
"counter"
,
Collections
new
Metric
<
Number
>(
"counter.foo.bar"
,
1
)));
.<
Metric
<?>>
singletonList
(
new
Metric
<
Number
>(
"counter.foo.bar"
,
1
)));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"counter.foo"
));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"counter.foo"
));
this
.
exporter
.
export
();
this
.
exporter
.
export
();
assertThat
(
this
.
writer
.
findAll
(
"counter.foo"
).
iterator
().
next
().
getValue
())
assertThat
(
this
.
writer
.
findAll
(
"counter.foo"
).
iterator
().
next
().
getValue
())
...
@@ -65,8 +65,7 @@ public class PrefixMetricGroupExporterTests {
...
@@ -65,8 +65,7 @@ public class PrefixMetricGroupExporterTests {
@Test
@Test
public
void
unprefixedMetricsNotCopied
()
{
public
void
unprefixedMetricsNotCopied
()
{
this
.
reader
.
set
(
"foo"
,
Arrays
.<
Metric
<?>>
asList
(
this
.
reader
.
set
(
"foo"
,
Arrays
.<
Metric
<?>>
asList
(
new
Metric
<
Number
>(
"foo.bar"
,
2.3
),
new
Metric
<
Number
>(
"foo.bar"
,
2.3
),
new
Metric
<
Number
>(
"foo.spam"
,
1.3
)));
new
Metric
<
Number
>(
"foo.spam"
,
1.3
)));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"bar"
));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"bar"
));
this
.
exporter
.
export
();
this
.
exporter
.
export
();
assertThat
(
Iterables
.
collection
(
this
.
writer
.
groups
())).
isEmpty
();
assertThat
(
Iterables
.
collection
(
this
.
writer
.
groups
())).
isEmpty
();
...
@@ -84,10 +83,9 @@ public class PrefixMetricGroupExporterTests {
...
@@ -84,10 +83,9 @@ public class PrefixMetricGroupExporterTests {
@Test
@Test
public
void
onlyPrefixedMetricsCopied
()
{
public
void
onlyPrefixedMetricsCopied
()
{
this
.
reader
.
set
(
"foo"
,
Arrays
.<
Metric
<?>>
asList
(
this
.
reader
.
set
(
"foo"
,
Arrays
.<
Metric
<?>>
asList
(
new
Metric
<
Number
>(
"foo.bar"
,
2.3
),
new
Metric
<
Number
>(
"foo.bar"
,
2.3
),
new
Metric
<
Number
>(
"foo.spam"
,
1.3
)));
new
Metric
<
Number
>(
"foo.spam"
,
1.3
)));
this
.
reader
.
set
(
"foobar"
,
Collections
this
.
reader
.
set
(
"foobar"
,
Collections
.<
Metric
<?>>
singletonList
(
.<
Metric
<?>>
singletonList
(
new
Metric
<
Number
>(
"foobar.spam"
,
1.3
)));
new
Metric
<
Number
>(
"foobar.spam"
,
1.3
)));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"foo"
));
this
.
exporter
.
setGroups
(
Collections
.
singleton
(
"foo"
));
this
.
exporter
.
export
();
this
.
exporter
.
export
();
assertThat
(
Iterables
.
collection
(
this
.
writer
.
groups
())).
hasSize
(
1
);
assertThat
(
Iterables
.
collection
(
this
.
writer
.
groups
())).
hasSize
(
1
);
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepositoryTests.java
View file @
8b69856f
...
@@ -28,6 +28,8 @@ import static org.assertj.core.api.Assertions.offset;
...
@@ -28,6 +28,8 @@ import static org.assertj.core.api.Assertions.offset;
/**
/**
* Tests for {@link InMemoryMetricRepository}.
* Tests for {@link InMemoryMetricRepository}.
*
* @author Dave Syer
*/
*/
public
class
InMemoryMetricRepositoryTests
{
public
class
InMemoryMetricRepositoryTests
{
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/repository/InMemoryMultiMetricRepositoryTests.java
View file @
8b69856f
...
@@ -29,12 +29,13 @@ import org.springframework.boot.actuate.metrics.writer.Delta;
...
@@ -29,12 +29,13 @@ import org.springframework.boot.actuate.metrics.writer.Delta;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* Tests for {@link InMemoryMultiMetricRepository}.
*
* @author Dave Syer
* @author Dave Syer
*/
*/
public
class
InMemoryMultiMetricRepositoryTests
{
public
class
InMemoryMultiMetricRepositoryTests
{
private
final
InMemoryMultiMetricRepository
repository
=
private
final
InMemoryMultiMetricRepository
repository
=
new
InMemoryMultiMetricRepository
();
new
InMemoryMultiMetricRepository
();
@Test
@Test
public
void
registeredPrefixCounted
()
{
public
void
registeredPrefixCounted
()
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/ClusterBuilderCustomizer.java
View file @
8b69856f
...
@@ -20,7 +20,9 @@ import com.datastax.driver.core.Cluster;
...
@@ -20,7 +20,9 @@ import com.datastax.driver.core.Cluster;
/**
/**
* Callback interface that can be implemented by beans wishing to customize the
* Callback interface that can be implemented by beans wishing to customize the
* {@link Cluster} via {@link Cluster.Builder} retaining its default auto-configuration.
* {@link com.datastax.driver.core.Cluster} via
* {@link com.datastax.driver.core.Cluster.Builder} retaining its default
* auto-configuration.
*
*
* @author Eddú Meléndez
* @author Eddú Meléndez
* @since 1.5.0
* @since 1.5.0
...
@@ -28,7 +30,7 @@ import com.datastax.driver.core.Cluster;
...
@@ -28,7 +30,7 @@ import com.datastax.driver.core.Cluster;
public
interface
ClusterBuilderCustomizer
{
public
interface
ClusterBuilderCustomizer
{
/**
/**
* Customize the {@link Cluster.Builder}.
* Customize the {@link
com.datastax.driver.core.
Cluster.Builder}.
* @param clusterBuilder the builder to customize
* @param clusterBuilder the builder to customize
*/
*/
void
customize
(
Cluster
.
Builder
clusterBuilder
);
void
customize
(
Cluster
.
Builder
clusterBuilder
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SearchStrategy.java
View file @
8b69856f
...
@@ -30,7 +30,7 @@ public enum SearchStrategy {
...
@@ -30,7 +30,7 @@ public enum SearchStrategy {
/**
/**
* Search all parents and ancestors, but not the current context.
* Search all parents and ancestors, but not the current context.
* @deprecated
since
1.5 in favor of {@link SearchStrategy#ANCESTORS}
* @deprecated
as of
1.5 in favor of {@link SearchStrategy#ANCESTORS}
*/
*/
@Deprecated
PARENTS
,
@Deprecated
PARENTS
,
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.java
View file @
8b69856f
...
@@ -85,7 +85,7 @@ abstract class DataSourceConfiguration {
...
@@ -85,7 +85,7 @@ abstract class DataSourceConfiguration {
/**
/**
* DBCP DataSource configuration.
* DBCP DataSource configuration.
*
*
* @deprecated as of
Spring Boot
1.5 in favor of DBCP2
* @deprecated as of 1.5 in favor of DBCP2
*/
*/
@ConditionalOnClass
(
org
.
apache
.
commons
.
dbcp
.
BasicDataSource
.
class
)
@ConditionalOnClass
(
org
.
apache
.
commons
.
dbcp
.
BasicDataSource
.
class
)
@ConditionalOnProperty
(
name
=
"spring.datasource.type"
,
havingValue
=
"org.apache.commons.dbcp.BasicDataSource"
,
matchIfMissing
=
true
)
@ConditionalOnProperty
(
name
=
"spring.datasource.type"
,
havingValue
=
"org.apache.commons.dbcp.BasicDataSource"
,
matchIfMissing
=
true
)
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java
View file @
8b69856f
...
@@ -20,7 +20,6 @@ import java.io.IOException;
...
@@ -20,7 +20,6 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.net.URI
;
import
java.net.URI
;
import
java.nio.ByteBuffer
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.CountDownLatch
;
...
@@ -57,8 +56,6 @@ public class LiveReloadServerTests {
...
@@ -57,8 +56,6 @@ public class LiveReloadServerTests {
private
static
final
String
HANDSHAKE
=
"{command: 'hello', "
private
static
final
String
HANDSHAKE
=
"{command: 'hello', "
+
"protocols: ['http://livereload.com/protocols/official-7']}"
;
+
"protocols: ['http://livereload.com/protocols/official-7']}"
;
private
static
final
ByteBuffer
NO_DATA
=
ByteBuffer
.
allocate
(
0
);
private
int
port
=
SocketUtils
.
findAvailableTcpPort
();
private
int
port
=
SocketUtils
.
findAvailableTcpPort
();
private
MonitoredLiveReloadServer
server
;
private
MonitoredLiveReloadServer
server
;
...
...
spring-boot-starters/spring-boot-starter-remote-shell/src/main/java/org/springframework/boot/starter/remote/shell/RemoteShellStarterDeprecatedWarningAutoConfiguration.java
View file @
8b69856f
...
@@ -40,7 +40,7 @@ public class RemoteShellStarterDeprecatedWarningAutoConfiguration {
...
@@ -40,7 +40,7 @@ public class RemoteShellStarterDeprecatedWarningAutoConfiguration {
@PostConstruct
@PostConstruct
public
void
logWarning
()
{
public
void
logWarning
()
{
logger
.
warn
(
"spring-boot-starter-remote-shell is deprecated
since
Spring Boot "
logger
.
warn
(
"spring-boot-starter-remote-shell is deprecated
as of
Spring Boot "
+
"1.5 and will be removed in Spring Boot 2.0"
);
+
"1.5 and will be removed in Spring Boot 2.0"
);
}
}
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/AutoConfigureTestDatabase.java
View file @
8b69856f
...
@@ -34,7 +34,7 @@ import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
...
@@ -34,7 +34,7 @@ import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
* instead of any application defined or auto-configured {@link DataSource}.
* instead of any application defined or auto-configured {@link DataSource}.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @deprecated
since 1.5 in favou
r of
* @deprecated
as of 1.5 in favo
r of
* {@link org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase}
* {@link org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase}
*/
*/
@Target
({
ElementType
.
TYPE
,
ElementType
.
METHOD
})
@Target
({
ElementType
.
TYPE
,
ElementType
.
METHOD
})
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java
View file @
8b69856f
...
@@ -38,6 +38,7 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
...
@@ -38,6 +38,7 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.core.env.MapPropertySource
;
import
org.springframework.core.env.MapPropertySource
;
import
org.springframework.core.env.MutablePropertySources
;
import
org.springframework.core.env.MutablePropertySources
;
import
org.springframework.core.env.PropertySources
;
import
org.springframework.core.env.PropertySourcesPropertyResolver
;
import
org.springframework.core.env.PropertySourcesPropertyResolver
;
import
org.springframework.core.env.StandardEnvironment
;
import
org.springframework.core.env.StandardEnvironment
;
import
org.springframework.core.io.DefaultResourceLoader
;
import
org.springframework.core.io.DefaultResourceLoader
;
...
@@ -160,15 +161,21 @@ public class SpringBootContextLoader extends AbstractContextLoader {
...
@@ -160,15 +161,21 @@ public class SpringBootContextLoader extends AbstractContextLoader {
}
}
private
boolean
hasCustomServerPort
(
List
<
String
>
properties
)
{
private
boolean
hasCustomServerPort
(
List
<
String
>
properties
)
{
Map
<
String
,
Object
>
props
=
TestPropertySourceUtils
.
convertInlinedPropertiesToMap
(
PropertySources
sources
=
convertToPropertySources
(
properties
);
properties
.
toArray
(
new
String
[
properties
.
size
()]));
MutablePropertySources
sources
=
new
MutablePropertySources
();
sources
.
addFirst
(
new
MapPropertySource
(
"inline"
,
props
));
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
RelaxedPropertyResolver
resolver
=
new
RelaxedPropertyResolver
(
new
PropertySourcesPropertyResolver
(
sources
),
"server."
);
new
PropertySourcesPropertyResolver
(
sources
),
"server."
);
return
resolver
.
containsProperty
(
"port"
);
return
resolver
.
containsProperty
(
"port"
);
}
}
private
PropertySources
convertToPropertySources
(
List
<
String
>
properties
)
{
Map
<
String
,
Object
>
source
=
TestPropertySourceUtils
.
convertInlinedPropertiesToMap
(
properties
.
toArray
(
new
String
[
properties
.
size
()]));
MutablePropertySources
sources
=
new
MutablePropertySources
();
sources
.
addFirst
(
new
MapPropertySource
(
"inline"
,
source
));
return
sources
;
}
private
List
<
ApplicationContextInitializer
<?>>
getInitializers
(
private
List
<
ApplicationContextInitializer
<?>>
getInitializers
(
MergedContextConfiguration
config
,
SpringApplication
application
)
{
MergedContextConfiguration
config
,
SpringApplication
application
)
{
List
<
ApplicationContextInitializer
<?>>
initializers
=
new
ArrayList
<
ApplicationContextInitializer
<?>>();
List
<
ApplicationContextInitializer
<?>>
initializers
=
new
ArrayList
<
ApplicationContextInitializer
<?>>();
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestCustomPortTests.java
View file @
8b69856f
...
@@ -27,8 +27,8 @@ import org.springframework.test.context.junit4.SpringRunner;
...
@@ -27,8 +27,8 @@ import org.springframework.test.context.junit4.SpringRunner;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* Test for {@link SpringBootTest} with a custom inline server.port in a non-embedded
* Test for {@link SpringBootTest} with a custom inline server.port in a non-embedded
web
*
web
environment.
* environment.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootTestWebEnvironmentRandomPortCustomPortTests.java
View file @
8b69856f
...
@@ -38,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -38,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@DirtiesContext
@DirtiesContext
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"server.port=12345"
})
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"server.port=12345"
})
public
class
SpringBootTestWebEnvironmentRandomPortCustomPortTests
{
public
class
SpringBootTestWebEnvironmentRandomPortCustomPortTests
{
@Autowired
@Autowired
...
@@ -55,4 +56,5 @@ public class SpringBootTestWebEnvironmentRandomPortCustomPortTests {
...
@@ -55,4 +56,5 @@ public class SpringBootTestWebEnvironmentRandomPortCustomPortTests {
protected
static
class
Config
extends
AbstractConfig
{
protected
static
class
Config
extends
AbstractConfig
{
}
}
}
}
spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/DeprecatedSpringBootPlugin.java
View file @
8b69856f
...
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
...
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
* to use the new Gradle Plugin Portal-compatible ID {@code org.springframework.boot}.
* to use the new Gradle Plugin Portal-compatible ID {@code org.springframework.boot}.
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @deprecated
since
1.4.2 in favor of {@link SpringBootPlugin}
* @deprecated
as of
1.4.2 in favor of {@link SpringBootPlugin}
*/
*/
@Deprecated
@Deprecated
public
class
DeprecatedSpringBootPlugin
extends
SpringBootPlugin
{
public
class
DeprecatedSpringBootPlugin
extends
SpringBootPlugin
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java
View file @
8b69856f
...
@@ -554,7 +554,7 @@ public class TomcatEmbeddedServletContainerFactory
...
@@ -554,7 +554,7 @@ public class TomcatEmbeddedServletContainerFactory
* A comma-separated list of jars to ignore for TLD scanning. See Tomcat's
* A comma-separated list of jars to ignore for TLD scanning. See Tomcat's
* catalina.properties for typical values. Defaults to a list drawn from that source.
* catalina.properties for typical values. Defaults to a list drawn from that source.
* @param tldSkip the jars to skip when scanning for TLDs etc
* @param tldSkip the jars to skip when scanning for TLDs etc
* @deprecated
since 1.5.0
in favor of {@link #setTldSkipPatterns(Collection)}
* @deprecated
as of 1.5
in favor of {@link #setTldSkipPatterns(Collection)}
*/
*/
@Deprecated
@Deprecated
public
void
setTldSkip
(
String
tldSkip
)
{
public
void
setTldSkip
(
String
tldSkip
)
{
...
...
spring-boot/src/main/java/org/springframework/boot/context/event/ApplicationStartedEvent.java
View file @
8b69856f
...
@@ -29,7 +29,7 @@ import org.springframework.core.env.Environment;
...
@@ -29,7 +29,7 @@ import org.springframework.core.env.Environment;
* state too much at this early stage since it might be modified later in the lifecycle.
* state too much at this early stage since it might be modified later in the lifecycle.
*
*
* @author Dave Syer
* @author Dave Syer
* @deprecated
since 1.5.0
in favor of {@link ApplicationStartingEvent}
* @deprecated
as of 1.5
in favor of {@link ApplicationStartingEvent}
*/
*/
@Deprecated
@Deprecated
@SuppressWarnings
(
"serial"
)
@SuppressWarnings
(
"serial"
)
...
...
spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
View file @
8b69856f
...
@@ -97,6 +97,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
...
@@ -97,6 +97,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
/**
/**
* The name of the Spring property that contains the directory where log files are
* The name of the Spring property that contains the directory where log files are
* written.
* written.
* @deprecated as of 1.5 in favor of {@link LogFile#PATH_PROPERTY}
*/
*/
@Deprecated
@Deprecated
public
static
final
String
PATH_PROPERTY
=
LogFile
.
PATH_PROPERTY
;
public
static
final
String
PATH_PROPERTY
=
LogFile
.
PATH_PROPERTY
;
...
@@ -104,6 +105,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
...
@@ -104,6 +105,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
/**
/**
* The name of the Spring property that contains the name of the log file. Names can
* The name of the Spring property that contains the name of the log file. Names can
* be an exact location or relative to the current directory.
* be an exact location or relative to the current directory.
* @deprecated as of 1.5 in favor of {@link LogFile#FILE_PROPERTY}
*/
*/
@Deprecated
@Deprecated
public
static
final
String
FILE_PROPERTY
=
LogFile
.
FILE_PROPERTY
;
public
static
final
String
FILE_PROPERTY
=
LogFile
.
FILE_PROPERTY
;
...
...
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