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
d8c83af9
Commit
d8c83af9
authored
Jan 18, 2018
by
Johnny Lim
Committed by
Stephane Nicoll
Jan 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use System.lineSeparator()
See gh-11665
parent
70025073
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
46 deletions
+30
-46
ServiceCapabilitiesReportGenerator.java
.../cli/command/init/ServiceCapabilitiesReportGenerator.java
+15
-17
DescriptionExtractor.java
...work/boot/configurationmetadata/DescriptionExtractor.java
+2
-4
DescriptionExtractorTests.java
...boot/configurationmetadata/DescriptionExtractorTests.java
+3
-5
ImageBannerTests.java
.../test/java/org/springframework/boot/ImageBannerTests.java
+5
-7
ExtendedWhitespaceThrowablePatternConverterTests.java
...4j2/ExtendedWhitespaceThrowablePatternConverterTests.java
+1
-3
WhitespaceThrowablePatternConverterTests.java
...ging/log4j2/WhitespaceThrowablePatternConverterTests.java
+2
-4
ExtendedWhitespaceThrowableProxyConverterTests.java
...gback/ExtendedWhitespaceThrowableProxyConverterTests.java
+1
-3
WhitespaceThrowableProxyConverterTests.java
...gging/logback/WhitespaceThrowableProxyConverterTests.java
+1
-3
No files found.
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ServiceCapabilitiesReportGenerator.java
View file @
d8c83af9
...
@@ -36,8 +36,6 @@ import java.util.TreeSet;
...
@@ -36,8 +36,6 @@ import java.util.TreeSet;
*/
*/
class
ServiceCapabilitiesReportGenerator
{
class
ServiceCapabilitiesReportGenerator
{
private
static
final
String
NEW_LINE
=
System
.
getProperty
(
"line.separator"
);
private
final
InitializrService
initializrService
;
private
final
InitializrService
initializrService
;
/**
/**
...
@@ -66,29 +64,29 @@ class ServiceCapabilitiesReportGenerator {
...
@@ -66,29 +64,29 @@ class ServiceCapabilitiesReportGenerator {
private
String
generateHelp
(
String
url
,
InitializrServiceMetadata
metadata
)
{
private
String
generateHelp
(
String
url
,
InitializrServiceMetadata
metadata
)
{
String
header
=
"Capabilities of "
+
url
;
String
header
=
"Capabilities of "
+
url
;
StringBuilder
report
=
new
StringBuilder
();
StringBuilder
report
=
new
StringBuilder
();
report
.
append
(
repeat
(
"="
,
header
.
length
())
+
NEW_LINE
);
report
.
append
(
repeat
(
"="
,
header
.
length
())
+
System
.
lineSeparator
()
);
report
.
append
(
header
+
NEW_LINE
);
report
.
append
(
header
+
System
.
lineSeparator
()
);
report
.
append
(
repeat
(
"="
,
header
.
length
())
+
NEW_LINE
);
report
.
append
(
repeat
(
"="
,
header
.
length
())
+
System
.
lineSeparator
()
);
report
.
append
(
NEW_LINE
);
report
.
append
(
System
.
lineSeparator
()
);
reportAvailableDependencies
(
metadata
,
report
);
reportAvailableDependencies
(
metadata
,
report
);
report
.
append
(
NEW_LINE
);
report
.
append
(
System
.
lineSeparator
()
);
reportAvailableProjectTypes
(
metadata
,
report
);
reportAvailableProjectTypes
(
metadata
,
report
);
report
.
append
(
NEW_LINE
);
report
.
append
(
System
.
lineSeparator
()
);
reportDefaults
(
report
,
metadata
);
reportDefaults
(
report
,
metadata
);
return
report
.
toString
();
return
report
.
toString
();
}
}
private
void
reportAvailableDependencies
(
InitializrServiceMetadata
metadata
,
private
void
reportAvailableDependencies
(
InitializrServiceMetadata
metadata
,
StringBuilder
report
)
{
StringBuilder
report
)
{
report
.
append
(
"Available dependencies:"
+
NEW_LINE
);
report
.
append
(
"Available dependencies:"
+
System
.
lineSeparator
()
);
report
.
append
(
"-----------------------"
+
NEW_LINE
);
report
.
append
(
"-----------------------"
+
System
.
lineSeparator
()
);
List
<
Dependency
>
dependencies
=
getSortedDependencies
(
metadata
);
List
<
Dependency
>
dependencies
=
getSortedDependencies
(
metadata
);
for
(
Dependency
dependency
:
dependencies
)
{
for
(
Dependency
dependency
:
dependencies
)
{
report
.
append
(
dependency
.
getId
()
+
" - "
+
dependency
.
getName
());
report
.
append
(
dependency
.
getId
()
+
" - "
+
dependency
.
getName
());
if
(
dependency
.
getDescription
()
!=
null
)
{
if
(
dependency
.
getDescription
()
!=
null
)
{
report
.
append
(
": "
+
dependency
.
getDescription
());
report
.
append
(
": "
+
dependency
.
getDescription
());
}
}
report
.
append
(
NEW_LINE
);
report
.
append
(
System
.
lineSeparator
()
);
}
}
}
}
...
@@ -100,8 +98,8 @@ class ServiceCapabilitiesReportGenerator {
...
@@ -100,8 +98,8 @@ class ServiceCapabilitiesReportGenerator {
private
void
reportAvailableProjectTypes
(
InitializrServiceMetadata
metadata
,
private
void
reportAvailableProjectTypes
(
InitializrServiceMetadata
metadata
,
StringBuilder
report
)
{
StringBuilder
report
)
{
report
.
append
(
"Available project types:"
+
NEW_LINE
);
report
.
append
(
"Available project types:"
+
System
.
lineSeparator
()
);
report
.
append
(
"------------------------"
+
NEW_LINE
);
report
.
append
(
"------------------------"
+
System
.
lineSeparator
()
);
SortedSet
<
Entry
<
String
,
ProjectType
>>
entries
=
new
TreeSet
<>(
SortedSet
<
Entry
<
String
,
ProjectType
>>
entries
=
new
TreeSet
<>(
Comparator
.
comparing
(
Entry:
:
getKey
));
Comparator
.
comparing
(
Entry:
:
getKey
));
entries
.
addAll
(
metadata
.
getProjectTypes
().
entrySet
());
entries
.
addAll
(
metadata
.
getProjectTypes
().
entrySet
());
...
@@ -114,7 +112,7 @@ class ServiceCapabilitiesReportGenerator {
...
@@ -114,7 +112,7 @@ class ServiceCapabilitiesReportGenerator {
if
(
type
.
isDefaultType
())
{
if
(
type
.
isDefaultType
())
{
report
.
append
(
" (default)"
);
report
.
append
(
" (default)"
);
}
}
report
.
append
(
NEW_LINE
);
report
.
append
(
System
.
lineSeparator
()
);
}
}
}
}
...
@@ -134,13 +132,13 @@ class ServiceCapabilitiesReportGenerator {
...
@@ -134,13 +132,13 @@ class ServiceCapabilitiesReportGenerator {
private
void
reportDefaults
(
StringBuilder
report
,
private
void
reportDefaults
(
StringBuilder
report
,
InitializrServiceMetadata
metadata
)
{
InitializrServiceMetadata
metadata
)
{
report
.
append
(
"Defaults:"
+
NEW_LINE
);
report
.
append
(
"Defaults:"
+
System
.
lineSeparator
()
);
report
.
append
(
"---------"
+
NEW_LINE
);
report
.
append
(
"---------"
+
System
.
lineSeparator
()
);
List
<
String
>
defaultsKeys
=
new
ArrayList
<>(
metadata
.
getDefaults
().
keySet
());
List
<
String
>
defaultsKeys
=
new
ArrayList
<>(
metadata
.
getDefaults
().
keySet
());
Collections
.
sort
(
defaultsKeys
);
Collections
.
sort
(
defaultsKeys
);
for
(
String
defaultsKey
:
defaultsKeys
)
{
for
(
String
defaultsKey
:
defaultsKeys
)
{
String
defaultsValue
=
metadata
.
getDefaults
().
get
(
defaultsKey
);
String
defaultsValue
=
metadata
.
getDefaults
().
get
(
defaultsKey
);
report
.
append
(
defaultsKey
+
": "
+
defaultsValue
+
NEW_LINE
);
report
.
append
(
defaultsKey
+
": "
+
defaultsValue
+
System
.
lineSeparator
()
);
}
}
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/DescriptionExtractor.java
View file @
d8c83af9
...
@@ -26,8 +26,6 @@ import java.util.Locale;
...
@@ -26,8 +26,6 @@ import java.util.Locale;
*/
*/
class
DescriptionExtractor
{
class
DescriptionExtractor
{
private
static
final
String
NEW_LINE
=
System
.
getProperty
(
"line.separator"
);
public
String
getShortDescription
(
String
description
)
{
public
String
getShortDescription
(
String
description
)
{
if
(
description
==
null
)
{
if
(
description
==
null
)
{
return
null
;
return
null
;
...
@@ -41,13 +39,13 @@ class DescriptionExtractor {
...
@@ -41,13 +39,13 @@ class DescriptionExtractor {
return
removeSpaceBetweenLine
(
text
);
return
removeSpaceBetweenLine
(
text
);
}
}
else
{
else
{
String
[]
lines
=
description
.
split
(
NEW_LINE
);
String
[]
lines
=
description
.
split
(
System
.
lineSeparator
()
);
return
lines
[
0
].
trim
();
return
lines
[
0
].
trim
();
}
}
}
}
private
String
removeSpaceBetweenLine
(
String
text
)
{
private
String
removeSpaceBetweenLine
(
String
text
)
{
String
[]
lines
=
text
.
split
(
NEW_LINE
);
String
[]
lines
=
text
.
split
(
System
.
lineSeparator
()
);
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
for
(
String
line
:
lines
)
{
for
(
String
line
:
lines
)
{
sb
.
append
(
line
.
trim
()).
append
(
" "
);
sb
.
append
(
line
.
trim
()).
append
(
" "
);
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/DescriptionExtractorTests.java
View file @
d8c83af9
...
@@ -27,8 +27,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -27,8 +27,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
public
class
DescriptionExtractorTests
{
public
class
DescriptionExtractorTests
{
private
static
final
String
NEW_LINE
=
System
.
getProperty
(
"line.separator"
);
private
DescriptionExtractor
extractor
=
new
DescriptionExtractor
();
private
DescriptionExtractor
extractor
=
new
DescriptionExtractor
();
@Test
@Test
...
@@ -41,14 +39,14 @@ public class DescriptionExtractorTests {
...
@@ -41,14 +39,14 @@ public class DescriptionExtractorTests {
@Test
@Test
public
void
extractShortDescriptionNewLineBeforeDot
()
{
public
void
extractShortDescriptionNewLineBeforeDot
()
{
String
description
=
this
.
extractor
.
getShortDescription
(
String
description
=
this
.
extractor
.
getShortDescription
(
"My short"
+
NEW_LINE
+
"description."
+
NEW_LINE
+
"More stuff."
);
"My short"
+
System
.
lineSeparator
()
+
"description."
+
System
.
lineSeparator
()
+
"More stuff."
);
assertThat
(
description
).
isEqualTo
(
"My short description."
);
assertThat
(
description
).
isEqualTo
(
"My short description."
);
}
}
@Test
@Test
public
void
extractShortDescriptionNewLineBeforeDotWithSpaces
()
{
public
void
extractShortDescriptionNewLineBeforeDotWithSpaces
()
{
String
description
=
this
.
extractor
.
getShortDescription
(
String
description
=
this
.
extractor
.
getShortDescription
(
"My short "
+
NEW_LINE
+
" description. "
+
NEW_LINE
+
"More stuff."
);
"My short "
+
System
.
lineSeparator
()
+
" description. "
+
System
.
lineSeparator
()
+
"More stuff."
);
assertThat
(
description
).
isEqualTo
(
"My short description."
);
assertThat
(
description
).
isEqualTo
(
"My short description."
);
}
}
...
@@ -61,7 +59,7 @@ public class DescriptionExtractorTests {
...
@@ -61,7 +59,7 @@ public class DescriptionExtractorTests {
@Test
@Test
public
void
extractShortDescriptionNoDotMultipleLines
()
{
public
void
extractShortDescriptionNoDotMultipleLines
()
{
String
description
=
this
.
extractor
String
description
=
this
.
extractor
.
getShortDescription
(
"My short description "
+
NEW_LINE
+
" More stuff"
);
.
getShortDescription
(
"My short description "
+
System
.
lineSeparator
()
+
" More stuff"
);
assertThat
(
description
).
isEqualTo
(
"My short description"
);
assertThat
(
description
).
isEqualTo
(
"My short description"
);
}
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ImageBannerTests.java
View file @
d8c83af9
...
@@ -42,8 +42,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -42,8 +42,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
public
class
ImageBannerTests
{
public
class
ImageBannerTests
{
private
static
final
String
NEW_LINE
=
System
.
getProperty
(
"line.separator"
);
private
static
final
char
HIGH_LUMINANCE_CHARACTER
=
' '
;
private
static
final
char
HIGH_LUMINANCE_CHARACTER
=
' '
;
private
static
final
char
LOW_LUMINANCE_CHARACTER
=
'@'
;
private
static
final
char
LOW_LUMINANCE_CHARACTER
=
'@'
;
...
@@ -149,7 +147,7 @@ public class ImageBannerTests {
...
@@ -149,7 +147,7 @@ public class ImageBannerTests {
public
void
printBannerShouldPrintMargin
()
{
public
void
printBannerShouldPrintMargin
()
{
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
String
banner
=
printBanner
(
"large.gif"
);
String
banner
=
printBanner
(
"large.gif"
);
String
[]
lines
=
banner
.
split
(
NEW_LINE
);
String
[]
lines
=
banner
.
split
(
System
.
lineSeparator
()
);
for
(
int
i
=
2
;
i
<
lines
.
length
-
1
;
i
++)
{
for
(
int
i
=
2
;
i
<
lines
.
length
-
1
;
i
++)
{
assertThat
(
lines
[
i
]).
startsWith
(
" @"
);
assertThat
(
lines
[
i
]).
startsWith
(
" @"
);
}
}
...
@@ -159,7 +157,7 @@ public class ImageBannerTests {
...
@@ -159,7 +157,7 @@ public class ImageBannerTests {
public
void
printBannerWhenHasMarginPropertyShouldPrintSizedMargin
()
{
public
void
printBannerWhenHasMarginPropertyShouldPrintSizedMargin
()
{
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
String
banner
=
printBanner
(
"large.gif"
,
"spring.banner.image.margin=4"
);
String
banner
=
printBanner
(
"large.gif"
,
"spring.banner.image.margin=4"
);
String
[]
lines
=
banner
.
split
(
NEW_LINE
);
String
[]
lines
=
banner
.
split
(
System
.
lineSeparator
()
);
for
(
int
i
=
2
;
i
<
lines
.
length
-
1
;
i
++)
{
for
(
int
i
=
2
;
i
<
lines
.
length
-
1
;
i
++)
{
assertThat
(
lines
[
i
]).
startsWith
(
" @"
);
assertThat
(
lines
[
i
]).
startsWith
(
" @"
);
}
}
...
@@ -169,7 +167,7 @@ public class ImageBannerTests {
...
@@ -169,7 +167,7 @@ public class ImageBannerTests {
public
void
printBannerWhenAnimatesShouldPrintAllFrames
()
{
public
void
printBannerWhenAnimatesShouldPrintAllFrames
()
{
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
AnsiOutput
.
setEnabled
(
AnsiOutput
.
Enabled
.
NEVER
);
String
banner
=
printBanner
(
"animated.gif"
);
String
banner
=
printBanner
(
"animated.gif"
);
String
[]
lines
=
banner
.
split
(
NEW_LINE
);
String
[]
lines
=
banner
.
split
(
System
.
lineSeparator
()
);
int
frames
=
138
;
int
frames
=
138
;
int
linesPerFrame
=
36
;
int
linesPerFrame
=
36
;
assertThat
(
banner
).
contains
(
"\r"
);
assertThat
(
banner
).
contains
(
"\r"
);
...
@@ -177,12 +175,12 @@ public class ImageBannerTests {
...
@@ -177,12 +175,12 @@ public class ImageBannerTests {
}
}
private
int
getBannerHeight
(
String
banner
)
{
private
int
getBannerHeight
(
String
banner
)
{
return
banner
.
split
(
NEW_LINE
).
length
-
3
;
return
banner
.
split
(
System
.
lineSeparator
()
).
length
-
3
;
}
}
private
int
getBannerWidth
(
String
banner
)
{
private
int
getBannerWidth
(
String
banner
)
{
int
width
=
0
;
int
width
=
0
;
for
(
String
line
:
banner
.
split
(
NEW_LINE
))
{
for
(
String
line
:
banner
.
split
(
System
.
lineSeparator
()
))
{
width
=
Math
.
max
(
width
,
line
.
length
());
width
=
Math
.
max
(
width
,
line
.
length
());
}
}
return
width
;
return
width
;
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverterTests.java
View file @
d8c83af9
...
@@ -32,8 +32,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -32,8 +32,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
public
class
ExtendedWhitespaceThrowablePatternConverterTests
{
public
class
ExtendedWhitespaceThrowablePatternConverterTests
{
private
static
final
String
LINE_SEPARATOR
=
System
.
getProperty
(
"line.separator"
);
private
final
ThrowablePatternConverter
converter
=
ExtendedWhitespaceThrowablePatternConverter
private
final
ThrowablePatternConverter
converter
=
ExtendedWhitespaceThrowablePatternConverter
.
newInstance
(
new
DefaultConfiguration
(),
new
String
[]
{});
.
newInstance
(
new
DefaultConfiguration
(),
new
String
[]
{});
...
@@ -50,7 +48,7 @@ public class ExtendedWhitespaceThrowablePatternConverterTests {
...
@@ -50,7 +48,7 @@ public class ExtendedWhitespaceThrowablePatternConverterTests {
LogEvent
event
=
Log4jLogEvent
.
newBuilder
().
setThrown
(
new
Exception
()).
build
();
LogEvent
event
=
Log4jLogEvent
.
newBuilder
().
setThrown
(
new
Exception
()).
build
();
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
this
.
converter
.
format
(
event
,
builder
);
this
.
converter
.
format
(
event
,
builder
);
assertThat
(
builder
).
startsWith
(
LINE_SEPARATOR
).
endsWith
(
LINE_SEPARATOR
);
assertThat
(
builder
).
startsWith
(
System
.
lineSeparator
()).
endsWith
(
System
.
lineSeparator
()
);
}
}
}
}
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverterTests.java
View file @
d8c83af9
...
@@ -31,8 +31,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -31,8 +31,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
public
class
WhitespaceThrowablePatternConverterTests
{
public
class
WhitespaceThrowablePatternConverterTests
{
private
static
final
String
LINE_SEPARATOR
=
System
.
getProperty
(
"line.separator"
);
private
final
ThrowablePatternConverter
converter
=
WhitespaceThrowablePatternConverter
private
final
ThrowablePatternConverter
converter
=
WhitespaceThrowablePatternConverter
.
newInstance
(
new
DefaultConfiguration
(),
new
String
[]
{});
.
newInstance
(
new
DefaultConfiguration
(),
new
String
[]
{});
...
@@ -49,8 +47,8 @@ public class WhitespaceThrowablePatternConverterTests {
...
@@ -49,8 +47,8 @@ public class WhitespaceThrowablePatternConverterTests {
LogEvent
event
=
Log4jLogEvent
.
newBuilder
().
setThrown
(
new
Exception
()).
build
();
LogEvent
event
=
Log4jLogEvent
.
newBuilder
().
setThrown
(
new
Exception
()).
build
();
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
this
.
converter
.
format
(
event
,
builder
);
this
.
converter
.
format
(
event
,
builder
);
assertThat
(
builder
.
toString
()).
startsWith
(
LINE_SEPARATOR
)
assertThat
(
builder
.
toString
()).
startsWith
(
System
.
lineSeparator
()
)
.
endsWith
(
LINE_SEPARATOR
);
.
endsWith
(
System
.
lineSeparator
()
);
}
}
}
}
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/ExtendedWhitespaceThrowableProxyConverterTests.java
View file @
d8c83af9
...
@@ -30,8 +30,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -30,8 +30,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
public
class
ExtendedWhitespaceThrowableProxyConverterTests
{
public
class
ExtendedWhitespaceThrowableProxyConverterTests
{
private
static
final
String
LINE_SEPARATOR
=
System
.
getProperty
(
"line.separator"
);
private
final
ExtendedWhitespaceThrowableProxyConverter
converter
=
new
ExtendedWhitespaceThrowableProxyConverter
();
private
final
ExtendedWhitespaceThrowableProxyConverter
converter
=
new
ExtendedWhitespaceThrowableProxyConverter
();
private
final
LoggingEvent
event
=
new
LoggingEvent
();
private
final
LoggingEvent
event
=
new
LoggingEvent
();
...
@@ -46,7 +44,7 @@ public class ExtendedWhitespaceThrowableProxyConverterTests {
...
@@ -46,7 +44,7 @@ public class ExtendedWhitespaceThrowableProxyConverterTests {
public
void
withStackTrace
()
{
public
void
withStackTrace
()
{
this
.
event
.
setThrowableProxy
(
new
ThrowableProxy
(
new
RuntimeException
()));
this
.
event
.
setThrowableProxy
(
new
ThrowableProxy
(
new
RuntimeException
()));
String
s
=
this
.
converter
.
convert
(
this
.
event
);
String
s
=
this
.
converter
.
convert
(
this
.
event
);
assertThat
(
s
).
startsWith
(
LINE_SEPARATOR
).
endsWith
(
LINE_SEPARATOR
);
assertThat
(
s
).
startsWith
(
System
.
lineSeparator
()).
endsWith
(
System
.
lineSeparator
()
);
}
}
}
}
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/WhitespaceThrowableProxyConverterTests.java
View file @
d8c83af9
...
@@ -30,8 +30,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -30,8 +30,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
public
class
WhitespaceThrowableProxyConverterTests
{
public
class
WhitespaceThrowableProxyConverterTests
{
private
static
final
String
LINE_SEPARATOR
=
System
.
getProperty
(
"line.separator"
);
private
final
WhitespaceThrowableProxyConverter
converter
=
new
WhitespaceThrowableProxyConverter
();
private
final
WhitespaceThrowableProxyConverter
converter
=
new
WhitespaceThrowableProxyConverter
();
private
final
LoggingEvent
event
=
new
LoggingEvent
();
private
final
LoggingEvent
event
=
new
LoggingEvent
();
...
@@ -46,7 +44,7 @@ public class WhitespaceThrowableProxyConverterTests {
...
@@ -46,7 +44,7 @@ public class WhitespaceThrowableProxyConverterTests {
public
void
withStackTrace
()
{
public
void
withStackTrace
()
{
this
.
event
.
setThrowableProxy
(
new
ThrowableProxy
(
new
RuntimeException
()));
this
.
event
.
setThrowableProxy
(
new
ThrowableProxy
(
new
RuntimeException
()));
String
s
=
this
.
converter
.
convert
(
this
.
event
);
String
s
=
this
.
converter
.
convert
(
this
.
event
);
assertThat
(
s
).
startsWith
(
LINE_SEPARATOR
).
endsWith
(
LINE_SEPARATOR
);
assertThat
(
s
).
startsWith
(
System
.
lineSeparator
()).
endsWith
(
System
.
lineSeparator
()
);
}
}
}
}
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