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
207d4853
Commit
207d4853
authored
Mar 11, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More defensive testing of tmpdir
parent
0439b393
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
LogbackLoggingSystemTests.java
...ework/boot/logging/logback/LogbackLoggingSystemTests.java
+8
-3
No files found.
spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java
View file @
207d4853
...
...
@@ -51,7 +51,11 @@ public class LogbackLoggingSystemTests {
@Before
public
void
setup
()
{
this
.
logger
=
new
SLF4JLogFactory
().
getInstance
(
getClass
().
getName
());
new
File
(
"/tmp/spring.log"
).
delete
();
new
File
(
tmpDir
()
+
"/spring.log"
).
delete
();
}
private
String
tmpDir
()
{
return
System
.
getProperty
(
"java.io.tmpdir"
);
}
@After
...
...
@@ -68,8 +72,9 @@ public class LogbackLoggingSystemTests {
this
.
logger
.
info
(
"Hello world"
);
String
output
=
this
.
output
.
toString
().
trim
();
assertTrue
(
"Wrong output:\n"
+
output
,
output
.
contains
(
"Hello world"
));
assertTrue
(
"Wrong output:\n"
+
output
,
output
.
contains
(
"/tmp/spring.log"
));
assertFalse
(
new
File
(
"/tmp/spring.log"
).
exists
());
assertTrue
(
"Wrong output (not "
+
tmpDir
()
+
" :\n"
+
output
,
output
.
contains
(
tmpDir
()
+
"/tmp.log"
));
assertFalse
(
new
File
(
tmpDir
()
+
"/tmp.log"
).
exists
());
}
@Test
(
expected
=
IllegalStateException
.
class
)
...
...
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