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
20d7dd57
Commit
20d7dd57
authored
Nov 19, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
9ec38dc8
16571202
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
299 additions
and
127 deletions
+299
-127
pom.xml
pom.xml
+1
-0
pom.xml
spring-boot-actuator/pom.xml
+5
-0
CloudFoundryEndpointHandlerMapping.java
...uate/cloudfoundry/CloudFoundryEndpointHandlerMapping.java
+25
-0
ManagementServerPropertiesAutoConfigurationNoSecurityTests.java
...mentServerPropertiesAutoConfigurationNoSecurityTests.java
+2
-2
CloudFoundryEndpointHandlerMappingTests.java
...cloudfoundry/CloudFoundryEndpointHandlerMappingTests.java
+24
-1
NoSpringSecurityHealthMvcEndpointIntegrationTests.java
...vc/NoSpringSecurityHealthMvcEndpointIntegrationTests.java
+2
-2
pom.xml
spring-boot-autoconfigure/pom.xml
+5
-0
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+2
-2
OnBeanConditionTypeDeductionFailureTests.java
...e/condition/OnBeanConditionTypeDeductionFailureTests.java
+2
-2
DataSourceBeanCreationFailureAnalyzerTests.java
...gure/jdbc/DataSourceBeanCreationFailureAnalyzerTests.java
+2
-2
pom.xml
spring-boot-dependencies/pom.xml
+6
-1
pom.xml
spring-boot-devtools/pom.xml
+5
-0
ClassLoaderFilesResourcePatternResolver.java
...ools/restart/ClassLoaderFilesResourcePatternResolver.java
+33
-33
Restarter.java
.../org/springframework/boot/devtools/restart/Restarter.java
+6
-2
ClassLoaderFileURLStreamHandler.java
.../restart/classloader/ClassLoaderFileURLStreamHandler.java
+1
-0
DevToolsEmbeddedDataSourceAutoConfigurationTests.java
...ure/DevToolsEmbeddedDataSourceAutoConfigurationTests.java
+2
-2
pom.xml
spring-boot-docs/pom.xml
+5
-0
SpringApplicationBuilderExampleTests.java
...rk/boot/builder/SpringApplicationBuilderExampleTests.java
+2
-2
pom.xml
spring-boot-full-build/pom.xml
+1
-0
DevToolsIntegrationTests.java
...amework/boot/devtools/tests/DevToolsIntegrationTests.java
+4
-2
pom.xml
spring-boot-junit-runners/pom.xml
+99
-0
ClassPathExclusions.java
...work/boot/junit/runner/classpath/ClassPathExclusions.java
+1
-1
ClassPathOverrides.java
...ework/boot/junit/runner/classpath/ClassPathOverrides.java
+1
-1
ModifiedClassPathRunner.java
.../boot/junit/runner/classpath/ModifiedClassPathRunner.java
+1
-1
package-info.java
...ngframework/boot/junit/runner/classpath/package-info.java
+20
-0
package-info.java
...a/org/springframework/boot/junit/runner/package-info.java
+20
-0
ModifiedClassPathRunnerExclusionsTests.java
...ner/classpath/ModifiedClassPathRunnerExclusionsTests.java
+1
-1
ModifiedClassPathRunnerOverridesTests.java
...nner/classpath/ModifiedClassPathRunnerOverridesTests.java
+1
-1
pom.xml
spring-boot-samples/spring-boot-sample-ant/pom.xml
+4
-5
pom.xml
spring-boot-test/pom.xml
+5
-0
Mockito21Tests.java
...pringframework/boot/test/mock/mockito/Mockito21Tests.java
+2
-2
Mockito22Tests.java
...pringframework/boot/test/mock/mockito/Mockito22Tests.java
+2
-2
pom.xml
spring-boot/pom.xml
+5
-58
ValidationExceptionFailureAnalyzerTests.java
...ics/analyzer/ValidationExceptionFailureAnalyzerTests.java
+2
-2
No files found.
pom.xml
View file @
20d7dd57
...
...
@@ -81,6 +81,7 @@
<module>
spring-boot-dependencies
</module>
<module>
spring-boot-parent
</module>
<module>
spring-boot-tools
</module>
<module>
spring-boot-junit-runners
</module>
<module>
spring-boot
</module>
<module>
spring-boot-test
</module>
<module>
spring-boot-autoconfigure
</module>
...
...
spring-boot-actuator/pom.xml
View file @
20d7dd57
...
...
@@ -277,6 +277,11 @@
<type>
test-jar
</type>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-junit-runners
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-test
</artifactId>
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/CloudFoundryEndpointHandlerMapping.java
View file @
20d7dd57
...
...
@@ -23,6 +23,7 @@ import java.util.List;
import
java.util.Set
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.boot.actuate.endpoint.Endpoint
;
import
org.springframework.boot.actuate.endpoint.mvc.AbstractEndpointHandlerMapping
;
...
...
@@ -34,6 +35,7 @@ import org.springframework.web.cors.CorsConfiguration;
import
org.springframework.web.servlet.HandlerExecutionChain
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.HandlerMapping
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
/**
* {@link HandlerMapping} to map {@link Endpoint}s to Cloud Foundry specific URLs.
...
...
@@ -45,10 +47,13 @@ class CloudFoundryEndpointHandlerMapping
private
final
HandlerInterceptor
securityInterceptor
;
private
final
CorsConfiguration
corsConfiguration
;
CloudFoundryEndpointHandlerMapping
(
Set
<?
extends
NamedMvcEndpoint
>
endpoints
,
CorsConfiguration
corsConfiguration
,
HandlerInterceptor
securityInterceptor
)
{
super
(
endpoints
,
corsConfiguration
);
this
.
securityInterceptor
=
securityInterceptor
;
this
.
corsConfiguration
=
corsConfiguration
;
}
@Override
...
...
@@ -97,6 +102,7 @@ class CloudFoundryEndpointHandlerMapping
private
HandlerInterceptor
[]
addSecurityInterceptor
(
HandlerInterceptor
[]
existing
)
{
List
<
HandlerInterceptor
>
interceptors
=
new
ArrayList
<
HandlerInterceptor
>();
interceptors
.
add
(
new
CorsInterceptor
(
this
.
corsConfiguration
));
interceptors
.
add
(
this
.
securityInterceptor
);
if
(
existing
!=
null
)
{
interceptors
.
addAll
(
Arrays
.
asList
(
existing
));
...
...
@@ -104,4 +110,23 @@ class CloudFoundryEndpointHandlerMapping
return
interceptors
.
toArray
(
new
HandlerInterceptor
[
interceptors
.
size
()]);
}
/**
* {@link HandlerInterceptor} that processes the response for CORS.
*/
class
CorsInterceptor
extends
HandlerInterceptorAdapter
{
private
final
CorsConfiguration
config
;
CorsInterceptor
(
CorsConfiguration
config
)
{
this
.
config
=
config
;
}
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
return
getCorsProcessor
().
processRequest
(
this
.
config
,
request
,
response
);
}
}
}
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationNoSecurityTests.java
View file @
20d7dd57
...
...
@@ -20,9 +20,9 @@ import org.junit.After;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.junit.runner.classpath.ClassPathExclusions
;
import
org.springframework.boot.junit.runner.classpath.ModifiedClassPathRunner
;
import
org.springframework.boot.test.util.EnvironmentTestUtils
;
import
org.springframework.boot.testutil.ClassPathExclusions
;
import
org.springframework.boot.testutil.ModifiedClassPathRunner
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/cloudfoundry/CloudFoundryEndpointHandlerMappingTests.java
View file @
20d7dd57
...
...
@@ -33,11 +33,16 @@ import org.springframework.boot.actuate.health.HealthIndicator;
import
org.springframework.boot.actuate.health.OrderedHealthAggregator
;
import
org.springframework.context.support.StaticApplicationContext
;
import
org.springframework.mock.web.MockHttpServletRequest
;
import
org.springframework.mock.web.MockHttpServletResponse
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.CorsProcessor
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.HandlerExecutionChain
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
/**
* Tests for {@link CloudFoundryEndpointHandlerMapping}.
...
...
@@ -47,6 +52,24 @@ import static org.assertj.core.api.Assertions.assertThat;
public
class
CloudFoundryEndpointHandlerMappingTests
extends
AbstractEndpointHandlerMappingTests
{
@Test
public
void
corsInterceptorShouldBeFirstAndCallCorsProcessor
()
throws
Exception
{
TestMvcEndpoint
endpoint
=
new
TestMvcEndpoint
(
new
TestEndpoint
(
"a"
));
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
CloudFoundryEndpointHandlerMapping
handlerMapping
=
new
CloudFoundryEndpointHandlerMapping
(
Collections
.
singleton
(
endpoint
),
corsConfiguration
,
null
);
CorsProcessor
corsProcessor
=
mock
(
CorsProcessor
.
class
);
handlerMapping
.
setCorsProcessor
(
corsProcessor
);
MockHttpServletRequest
request
=
new
MockHttpServletRequest
();
HandlerExecutionChain
handlerExecutionChain
=
handlerMapping
.
getHandlerExecutionChain
(
endpoint
,
request
);
HandlerInterceptor
[]
interceptors
=
handlerExecutionChain
.
getInterceptors
();
CloudFoundryEndpointHandlerMapping
.
CorsInterceptor
corsInterceptor
=
(
CloudFoundryEndpointHandlerMapping
.
CorsInterceptor
)
interceptors
[
0
];
MockHttpServletResponse
response
=
new
MockHttpServletResponse
();
corsInterceptor
.
preHandle
(
request
,
response
,
new
Object
());
verify
(
corsProcessor
).
processRequest
(
corsConfiguration
,
request
,
response
);
}
@Test
public
void
getHandlerExecutionChainShouldHaveSecurityInterceptor
()
throws
Exception
{
CloudFoundrySecurityInterceptor
securityInterceptor
=
Mockito
...
...
@@ -57,7 +80,7 @@ public class CloudFoundryEndpointHandlerMappingTests
HandlerExecutionChain
handlerExecutionChain
=
handlerMapping
.
getHandlerExecutionChain
(
endpoint
,
new
MockHttpServletRequest
());
HandlerInterceptor
[]
interceptors
=
handlerExecutionChain
.
getInterceptors
();
assertThat
(
interceptors
).
contains
(
securityInterceptor
);
assertThat
(
interceptors
[
1
]).
isEqualTo
(
securityInterceptor
);
}
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/NoSpringSecurityHealthMvcEndpointIntegrationTests.java
View file @
20d7dd57
...
...
@@ -30,8 +30,8 @@ import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfigurati
import
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
;
import
org.springframework.boot.
testutil
.ClassPathExclusions
;
import
org.springframework.boot.
testutil
.ModifiedClassPathRunner
;
import
org.springframework.boot.
junit.runner.classpath
.ClassPathExclusions
;
import
org.springframework.boot.
junit.runner.classpath
.ModifiedClassPathRunner
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.mock.web.MockServletContext
;
...
...
spring-boot-autoconfigure/pom.xml
View file @
20d7dd57
...
...
@@ -619,6 +619,11 @@
<type>
test-jar
</type>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-junit-runners
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-test
</artifactId>
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
20d7dd57
...
...
@@ -1035,8 +1035,8 @@ public class ServerProperties
private
boolean
renameOnRotate
;
/**
* Set request attributes for IP address, Hostname, protocol and port used
*
for
the request.
* Set request attributes for IP address, Hostname, protocol and port used
for
* the request.
*/
private
boolean
requestAttributesEnabled
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnBeanConditionTypeDeductionFailureTests.java
View file @
20d7dd57
...
...
@@ -21,8 +21,8 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.autoconfigure.condition.OnBeanCondition.BeanTypeDeductionException
;
import
org.springframework.boot.
testutil
.ClassPathExclusions
;
import
org.springframework.boot.
testutil
.ModifiedClassPathRunner
;
import
org.springframework.boot.
junit.runner.classpath
.ClassPathExclusions
;
import
org.springframework.boot.
junit.runner.classpath
.ModifiedClassPathRunner
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzerTests.java
View file @
20d7dd57
...
...
@@ -22,8 +22,8 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.BeanCreationException
;
import
org.springframework.boot.autoconfigure.ImportAutoConfiguration
;
import
org.springframework.boot.diagnostics.FailureAnalysis
;
import
org.springframework.boot.
testutil
.ClassPathExclusions
;
import
org.springframework.boot.
testutil
.ModifiedClassPathRunner
;
import
org.springframework.boot.
junit.runner.classpath
.ClassPathExclusions
;
import
org.springframework.boot.
junit.runner.classpath
.ModifiedClassPathRunner
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-dependencies/pom.xml
View file @
20d7dd57
...
...
@@ -199,6 +199,11 @@
<type>
test-jar
</type>
<version>
2.0.0.BUILD-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-junit-runners
</artifactId>
<version>
1.5.0.BUILD-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-test
</artifactId>
...
...
@@ -2526,4 +2531,4 @@
<id>
integration-test
</id>
</profile>
</profiles>
</project>
</project>
\ No newline at end of file
spring-boot-devtools/pom.xml
View file @
20d7dd57
...
...
@@ -92,6 +92,11 @@
<type>
test-jar
</type>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-junit-runners
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-test
</artifactId>
...
...
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ClassLoaderFilesResourcePatternResolver.java
View file @
20d7dd57
...
...
@@ -21,12 +21,8 @@ import java.io.InputStream;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
org.springframework.boot.devtools.restart.classloader.ClassLoaderFile
;
import
org.springframework.boot.devtools.restart.classloader.ClassLoaderFile.Kind
;
...
...
@@ -48,9 +44,8 @@ import org.springframework.util.AntPathMatcher;
*/
final
class
ClassLoaderFilesResourcePatternResolver
implements
ResourcePatternResolver
{
private
static
final
Set
<
String
>
LOCATION_PATTERN_PREFIXES
=
Collections
.
unmodifiableSet
(
new
HashSet
<
String
>(
Arrays
.
asList
(
CLASSPATH_ALL_URL_PREFIX
,
CLASSPATH_URL_PREFIX
)));
private
static
final
String
[]
LOCATION_PATTERN_PREFIXES
=
{
CLASSPATH_ALL_URL_PREFIX
,
CLASSPATH_URL_PREFIX
};
private
final
ResourcePatternResolver
delegate
=
new
PathMatchingResourcePatternResolver
();
...
...
@@ -62,26 +57,26 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
this
.
classLoaderFiles
=
classLoaderFiles
;
}
@Override
public
ClassLoader
getClassLoader
()
{
return
this
.
delegate
.
getClassLoader
();
}
@Override
public
Resource
getResource
(
String
location
)
{
Resource
candidate
=
this
.
delegate
.
getResource
(
location
);
if
(
is
ExcludedResource
(
candidate
))
{
if
(
is
Deleted
(
candidate
))
{
return
new
DeletedClassLoaderFileResource
(
location
);
}
return
candidate
;
}
@Override
public
ClassLoader
getClassLoader
()
{
return
this
.
delegate
.
getClassLoader
();
}
@Override
public
Resource
[]
getResources
(
String
locationPattern
)
throws
IOException
{
List
<
Resource
>
resources
=
new
ArrayList
<
Resource
>();
Resource
[]
candidates
=
this
.
delegate
.
getResources
(
locationPattern
);
for
(
Resource
candidate
:
candidates
)
{
if
(!
is
ExcludedResource
(
candidate
))
{
if
(!
is
Deleted
(
candidate
))
{
resources
.
add
(
candidate
);
}
}
...
...
@@ -89,38 +84,43 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
return
resources
.
toArray
(
new
Resource
[
resources
.
size
()]);
}
private
String
trimLocationPattern
(
String
locationPattern
)
{
for
(
String
prefix
:
LOCATION_PATTERN_PREFIXES
)
{
if
(
locationPattern
.
startsWith
(
prefix
))
{
return
locationPattern
.
substring
(
prefix
.
length
());
}
}
return
locationPattern
;
}
private
List
<
Resource
>
getAdditionalResources
(
String
locationPattern
)
throws
MalformedURLException
{
List
<
Resource
>
additionalResources
=
new
ArrayList
<
Resource
>();
String
trimmedLocationPattern
=
trimLocationPattern
(
locationPattern
);
for
(
SourceFolder
sourceFolder
:
this
.
classLoaderFiles
.
getSourceFolders
())
{
for
(
Entry
<
String
,
ClassLoaderFile
>
entry
:
sourceFolder
.
getFilesEntrySet
())
{
if
(
entry
.
getValue
().
getKind
()
==
Kind
.
ADDED
&&
this
.
antPathMatcher
.
match
(
trimmedLocationPattern
,
entry
.
getKey
()))
{
additionalResources
.
add
(
new
UrlResource
(
new
URL
(
"reloaded"
,
null
,
-
1
,
"/"
+
entry
.
getKey
(),
new
ClassLoaderFileURLStreamHandler
(
entry
.
getValue
()))));
String
name
=
entry
.
getKey
();
ClassLoaderFile
file
=
entry
.
getValue
();
if
(
file
.
getKind
()
==
Kind
.
ADDED
&&
this
.
antPathMatcher
.
match
(
trimmedLocationPattern
,
name
))
{
URL
url
=
new
URL
(
"reloaded"
,
null
,
-
1
,
"/"
+
name
,
new
ClassLoaderFileURLStreamHandler
(
file
));
UrlResource
resource
=
new
UrlResource
(
url
);
additionalResources
.
add
(
resource
);
}
}
}
return
additionalResources
;
}
private
boolean
isExcludedResource
(
Resource
resource
)
{
private
String
trimLocationPattern
(
String
pattern
)
{
for
(
String
prefix
:
LOCATION_PATTERN_PREFIXES
)
{
if
(
pattern
.
startsWith
(
prefix
))
{
return
pattern
.
substring
(
prefix
.
length
());
}
}
return
pattern
;
}
private
boolean
isDeleted
(
Resource
resource
)
{
for
(
SourceFolder
sourceFolder
:
this
.
classLoaderFiles
.
getSourceFolders
())
{
for
(
Entry
<
String
,
ClassLoaderFile
>
entry
:
sourceFolder
.
getFilesEntrySet
())
{
try
{
if
(
entry
.
getValue
().
getKind
()
==
Kind
.
DELETED
&&
resource
.
exists
()
&&
resource
.
getURI
().
toString
().
endsWith
(
entry
.
getKey
()))
{
String
name
=
entry
.
getKey
();
ClassLoaderFile
file
=
entry
.
getValue
();
if
(
file
.
getKind
()
==
Kind
.
DELETED
&&
resource
.
exists
()
&&
resource
.
getURI
().
toString
().
endsWith
(
name
))
{
return
true
;
}
}
...
...
@@ -136,8 +136,6 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
/**
* A {@link Resource} that represents a {@link ClassLoaderFile} that has been
* {@link Kind#DELETED deleted}.
*
* @author Andy Wilkinson
*/
private
final
class
DeletedClassLoaderFileResource
extends
AbstractResource
{
...
...
@@ -161,5 +159,7 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
public
InputStream
getInputStream
()
throws
IOException
{
throw
new
IOException
(
this
.
name
+
" has been deleted"
);
}
}
}
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
View file @
20d7dd57
...
...
@@ -421,8 +421,7 @@ public class Restarter {
return
;
}
if
(
applicationContext
instanceof
GenericApplicationContext
)
{
((
GenericApplicationContext
)
applicationContext
).
setResourceLoader
(
new
ClassLoaderFilesResourcePatternResolver
(
this
.
classLoaderFiles
));
prepare
((
GenericApplicationContext
)
applicationContext
);
}
this
.
rootContexts
.
add
(
applicationContext
);
}
...
...
@@ -433,6 +432,11 @@ public class Restarter {
}
}
private
void
prepare
(
GenericApplicationContext
applicationContext
)
{
applicationContext
.
setResourceLoader
(
new
ClassLoaderFilesResourcePatternResolver
(
this
.
classLoaderFiles
));
}
private
LeakSafeThread
getLeakSafeThread
()
{
try
{
return
this
.
leakSafeThreads
.
takeFirst
();
...
...
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileURLStreamHandler.java
View file @
20d7dd57
...
...
@@ -27,6 +27,7 @@ import java.net.URLStreamHandler;
* {@link URLStreamHandler} for the contents of a {@link ClassLoaderFile}.
*
* @author Phillip Webb
* @since 1.5.0
*/
public
class
ClassLoaderFileURLStreamHandler
extends
URLStreamHandler
{
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsEmbeddedDataSourceAutoConfigurationTests.java
View file @
20d7dd57
...
...
@@ -25,8 +25,8 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.
testutil
.ClassPathExclusions
;
import
org.springframework.boot.
testutil
.ModifiedClassPathRunner
;
import
org.springframework.boot.
junit.runner.classpath
.ClassPathExclusions
;
import
org.springframework.boot.
junit.runner.classpath
.ModifiedClassPathRunner
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
static
org
.
mockito
.
Mockito
.
times
;
...
...
spring-boot-docs/pom.xml
View file @
20d7dd57
...
...
@@ -725,6 +725,11 @@
<type>
test-jar
</type>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-junit-runners
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
spring-boot-docs/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderExampleTests.java
View file @
20d7dd57
...
...
@@ -20,9 +20,9 @@ import org.junit.Rule;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.junit.runner.classpath.ClassPathExclusions
;
import
org.springframework.boot.junit.runner.classpath.ModifiedClassPathRunner
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.testutil.ClassPathExclusions
;
import
org.springframework.boot.testutil.ModifiedClassPathRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
spring-boot-full-build/pom.xml
View file @
20d7dd57
...
...
@@ -48,6 +48,7 @@
<module>
../spring-boot-dependencies
</module>
<module>
../spring-boot-parent
</module>
<module>
../spring-boot-tools
</module>
<module>
../spring-boot-junit-runners
</module>
<module>
../spring-boot
</module>
<module>
../spring-boot-test
</module>
<module>
../spring-boot-autoconfigure
</module>
...
...
spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java
View file @
20d7dd57
...
...
@@ -146,8 +146,8 @@ public class DevToolsIntegrationTests {
}
Thread
.
sleep
(
100
);
}
int
port
=
Integer
.
valueOf
(
FileCopyUtils
.
copyToString
(
new
FileReader
(
this
.
serverPortFile
)
));
FileReader
portReader
=
new
FileReader
(
this
.
serverPortFile
);
int
port
=
Integer
.
valueOf
(
FileCopyUtils
.
copyToString
(
portReader
));
this
.
serverPortFile
.
delete
();
return
port
;
}
...
...
@@ -187,5 +187,7 @@ public class DevToolsIntegrationTests {
}
builder
.
make
().
saveIn
(
this
.
classesDirectory
);
}
}
}
spring-boot-junit-runners/pom.xml
0 → 100644
View file @
20d7dd57
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-parent
</artifactId>
<version>
1.5.0.BUILD-SNAPSHOT
</version>
<relativePath>
../spring-boot-parent
</relativePath>
</parent>
<artifactId>
spring-boot-junit-runners
</artifactId>
<name>
Spring Boot JUnit Runners
</name>
<description>
Spring Boot JUnit Runners
</description>
<url>
http://projects.spring.io/spring-boot/
</url>
<organization>
<name>
Pivotal Software, Inc.
</name>
<url>
http://www.spring.io
</url>
</organization>
<properties>
<main.basedir>
${basedir}/..
</main.basedir>
</properties>
<dependencies>
<!-- Provided -->
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
provided
</scope>
</dependency>
<!-- Compile -->
<dependency>
<groupId>
org.apache.maven
</groupId>
<artifactId>
maven-aether-provider
</artifactId>
<exclusions>
<exclusion>
<artifactId>
org.eclipse.sisu.plexus
</artifactId>
<groupId>
org.eclipse.sisu
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.maven
</groupId>
<artifactId>
maven-settings-builder
</artifactId>
</dependency>
<dependency>
<groupId>
org.codehaus.plexus
</groupId>
<artifactId>
plexus-component-api
</artifactId>
<exclusions>
<exclusion>
<groupId>
*
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-connector-basic
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-impl
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-spi
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-transport-file
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-transport-http
</artifactId>
<exclusions>
<exclusion>
<artifactId>
jcl-over-slf4j
</artifactId>
<groupId>
org.slf4j
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-util
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-core
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
io.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-context
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
spring-boot
/src/test/java/org/springframework/boot/testutil
/ClassPathExclusions.java
→
spring-boot
-junit-runners/src/main/java/org/springframework/boot/junit/runner/classpath
/ClassPathExclusions.java
View file @
20d7dd57
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
testutil
;
package
org
.
springframework
.
boot
.
junit
.
runner
.
classpath
;
import
java.io.File
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/test/java/org/springframework/boot/testutil
/ClassPathOverrides.java
→
spring-boot
-junit-runners/src/main/java/org/springframework/boot/junit/runner/classpath
/ClassPathOverrides.java
View file @
20d7dd57
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
testutil
;
package
org
.
springframework
.
boot
.
junit
.
runner
.
classpath
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
...
...
spring-boot
/src/test/java/org/springframework/boot/testutil
/ModifiedClassPathRunner.java
→
spring-boot
-junit-runners/src/main/java/org/springframework/boot/junit/runner/classpath
/ModifiedClassPathRunner.java
View file @
20d7dd57
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
testutil
;
package
org
.
springframework
.
boot
.
junit
.
runner
.
classpath
;
import
java.io.File
;
import
java.lang.annotation.Annotation
;
...
...
spring-boot-junit-runners/src/main/java/org/springframework/boot/junit/runner/classpath/package-info.java
0 → 100644
View file @
20d7dd57
/*
* 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.
*/
/**
* Custom JUnit runner to change the classpath.
*/
package
org
.
springframework
.
boot
.
junit
.
runner
.
classpath
;
spring-boot-junit-runners/src/main/java/org/springframework/boot/junit/runner/package-info.java
0 → 100644
View file @
20d7dd57
/*
* 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.
*/
/**
* Custom JUnit runners used in Spring Boot's own tests.
*/
package
org
.
springframework
.
boot
.
junit
.
runner
;
spring-boot
/src/test/java/org/springframework/boot/testutil
/ModifiedClassPathRunnerExclusionsTests.java
→
spring-boot
-junit-runners/src/test/java/org/springframework/boot/junit/runner/classpath
/ModifiedClassPathRunnerExclusionsTests.java
View file @
20d7dd57
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
testutil
;
package
org
.
springframework
.
boot
.
junit
.
runner
.
classpath
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
spring-boot
/src/test/java/org/springframework/boot/testutil
/ModifiedClassPathRunnerOverridesTests.java
→
spring-boot
-junit-runners/src/test/java/org/springframework/boot/junit/runner/classpath
/ModifiedClassPathRunnerOverridesTests.java
View file @
20d7dd57
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
testutil
;
package
org
.
springframework
.
boot
.
junit
.
runner
.
classpath
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
spring-boot-samples/spring-boot-sample-ant/pom.xml
View file @
20d7dd57
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<!-- This POM is just to trigger the Ant/Ivy sample from Maven and to test -->
<modelVersion>
4.0.0
</modelVersion>
<parent>
...
...
@@ -60,8 +59,8 @@
<phase>
package
</phase>
<configuration>
<target>
<property
name=
"build.compiler"
value=
"extJavac"
/>
<ant
dir=
"${basedir}"
/>
<property
name=
"build.compiler"
value=
"extJavac"
/>
<ant
dir=
"${basedir}"
/>
</target>
</configuration>
<goals>
...
...
@@ -101,4 +100,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
\ No newline at end of file
spring-boot-test/pom.xml
View file @
20d7dd57
...
...
@@ -118,6 +118,11 @@
<type>
test-jar
</type>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-junit-runners
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-runtime
</artifactId>
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito21Tests.java
View file @
20d7dd57
...
...
@@ -21,8 +21,8 @@ import org.junit.runner.JUnitCore;
import
org.junit.runner.Result
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.
testutil
.ClassPathOverrides
;
import
org.springframework.boot.
testutil
.ModifiedClassPathRunner
;
import
org.springframework.boot.
junit.runner.classpath
.ClassPathOverrides
;
import
org.springframework.boot.
junit.runner.classpath
.ModifiedClassPathRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/Mockito22Tests.java
View file @
20d7dd57
...
...
@@ -21,8 +21,8 @@ import org.junit.runner.JUnitCore;
import
org.junit.runner.Result
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.
testutil
.ClassPathOverrides
;
import
org.springframework.boot.
testutil
.ModifiedClassPathRunner
;
import
org.springframework.boot.
junit.runner.classpath
.ClassPathOverrides
;
import
org.springframework.boot.
junit.runner.classpath
.ModifiedClassPathRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
spring-boot/pom.xml
View file @
20d7dd57
...
...
@@ -246,6 +246,11 @@
<optional>
true
</optional>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-junit-runners
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.google.appengine
</groupId>
<artifactId>
appengine-api-1.0-sdk
</artifactId>
...
...
@@ -290,64 +295,6 @@
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpasyncclient
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.maven
</groupId>
<artifactId>
maven-aether-provider
</artifactId>
<exclusions>
<exclusion>
<artifactId>
org.eclipse.sisu.plexus
</artifactId>
<groupId>
org.eclipse.sisu
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.maven
</groupId>
<artifactId>
maven-settings-builder
</artifactId>
</dependency>
<dependency>
<groupId>
org.codehaus.plexus
</groupId>
<artifactId>
plexus-component-api
</artifactId>
<exclusions>
<exclusion>
<groupId>
*
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-connector-basic
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-impl
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-spi
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-transport-file
</artifactId>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-transport-http
</artifactId>
<exclusions>
<exclusion>
<artifactId>
jcl-over-slf4j
</artifactId>
<groupId>
org.slf4j
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-util
</artifactId>
</dependency>
<dependency>
<groupId>
org.firebirdsql.jdbc
</groupId>
...
...
spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/ValidationExceptionFailureAnalyzerTests.java
View file @
20d7dd57
...
...
@@ -22,8 +22,8 @@ import org.junit.runner.RunWith;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.diagnostics.FailureAnalysis
;
import
org.springframework.boot.
testutil
.ClassPathExclusions
;
import
org.springframework.boot.
testutil
.ModifiedClassPathRunner
;
import
org.springframework.boot.
junit.runner.classpath
.ClassPathExclusions
;
import
org.springframework.boot.
junit.runner.classpath
.ModifiedClassPathRunner
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
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