Commit aa748cb0 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Use System.lineSeparator()""

Closes gh-11665
parent d8c83af9
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -39,14 +39,16 @@ public class DescriptionExtractorTests { ...@@ -39,14 +39,16 @@ public class DescriptionExtractorTests {
@Test @Test
public void extractShortDescriptionNewLineBeforeDot() { public void extractShortDescriptionNewLineBeforeDot() {
String description = this.extractor.getShortDescription( String description = this.extractor.getShortDescription(
"My short" + System.lineSeparator() + "description." + System.lineSeparator() + "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 " + System.lineSeparator() + " description. " + System.lineSeparator() + "More stuff."); "My short " + System.lineSeparator() + " description. "
+ System.lineSeparator() + "More stuff.");
assertThat(description).isEqualTo("My short description."); assertThat(description).isEqualTo("My short description.");
} }
...@@ -59,7 +61,8 @@ public class DescriptionExtractorTests { ...@@ -59,7 +61,8 @@ public class DescriptionExtractorTests {
@Test @Test
public void extractShortDescriptionNoDotMultipleLines() { public void extractShortDescriptionNoDotMultipleLines() {
String description = this.extractor String description = this.extractor
.getShortDescription("My short description " + System.lineSeparator() + " More stuff"); .getShortDescription("My short description " + System.lineSeparator()
+ " More stuff");
assertThat(description).isEqualTo("My short description"); assertThat(description).isEqualTo("My short description");
} }
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -48,7 +48,8 @@ public class ExtendedWhitespaceThrowablePatternConverterTests { ...@@ -48,7 +48,8 @@ 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(System.lineSeparator()).endsWith(System.lineSeparator()); assertThat(builder).startsWith(System.lineSeparator())
.endsWith(System.lineSeparator());
} }
} }
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment