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
31101bdb
Commit
31101bdb
authored
Jul 06, 2017
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
8dacbbf1
222a09cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
LoggingApplicationListenerTests.java
...boot/context/logging/LoggingApplicationListenerTests.java
+17
-1
No files found.
spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java
View file @
31101bdb
...
...
@@ -18,6 +18,7 @@ package org.springframework.boot.context.logging;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -58,6 +59,8 @@ import org.springframework.context.event.ContextClosedEvent;
import
org.springframework.context.event.SimpleApplicationEventMulticaster
;
import
org.springframework.context.support.GenericApplicationContext
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.core.env.MapPropertySource
;
import
org.springframework.core.env.MutablePropertySources
;
import
org.springframework.test.context.support.TestPropertySourceUtils
;
import
org.springframework.test.util.ReflectionTestUtils
;
...
...
@@ -110,7 +113,9 @@ public class LoggingApplicationListenerTests {
@After
public
void
clear
()
{
LoggingSystem
.
get
(
getClass
().
getClassLoader
()).
cleanUp
();
LoggingSystem
loggingSystem
=
LoggingSystem
.
get
(
getClass
().
getClassLoader
());
loggingSystem
.
setLogLevel
(
"ROOT"
,
LogLevel
.
INFO
);
loggingSystem
.
cleanUp
();
System
.
clearProperty
(
LoggingSystem
.
class
.
getName
());
System
.
clearProperty
(
"LOG_FILE"
);
System
.
clearProperty
(
"LOG_PATH"
);
...
...
@@ -520,6 +525,17 @@ public class LoggingApplicationListenerTests {
assertThat
(
loggingSystem
.
cleanedUp
).
isTrue
();
}
@Test
public
void
lowPriorityPropertySourceShouldNotOverrideRootLoggerConfig
()
throws
Exception
{
MutablePropertySources
propertySources
=
this
.
context
.
getEnvironment
().
getPropertySources
();
propertySources
.
addFirst
(
new
MapPropertySource
(
"test1"
,
Collections
.
singletonMap
(
"logging.level.ROOT"
,
"DEBUG"
)));
propertySources
.
addLast
(
new
MapPropertySource
(
"test2"
,
Collections
.
singletonMap
(
"logging.level.root"
,
"WARN"
)));
this
.
initializer
.
initialize
(
this
.
context
.
getEnvironment
(),
this
.
context
.
getClassLoader
());
this
.
logger
.
debug
(
"testatdebug"
);
assertThat
(
this
.
outputCapture
.
toString
()).
contains
(
"testatdebug"
);
}
private
void
multicastEvent
(
ApplicationEvent
event
)
{
multicastEvent
(
this
.
initializer
,
event
);
}
...
...
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