mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-07-07 19:12:28 +02:00
fix IndentXMLStreamWriterTest on windows
This commit is contained in:
@@ -34,6 +34,7 @@ package sonia.scm.xml;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import javax.xml.namespace.NamespaceContext;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamWriter;
|
||||
@@ -48,7 +49,8 @@ public final class IndentXMLStreamWriter implements XMLStreamWriter
|
||||
{
|
||||
|
||||
/** line separator */
|
||||
private static final String LINE_SEPARATOR =
|
||||
@VisibleForTesting
|
||||
static final String LINE_SEPARATOR =
|
||||
System.getProperty("line.separator");
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
@@ -86,15 +86,14 @@ public class IndentXMLStreamWriterTest
|
||||
|
||||
String content = baos.toString();
|
||||
|
||||
//J-
|
||||
Assert.assertEquals(
|
||||
"<?xml version=\"1.0\" ?>\n" +
|
||||
"<root>\n" +
|
||||
" <message>Hello</message>\n" +
|
||||
"</root>\n",
|
||||
content
|
||||
);
|
||||
//J
|
||||
StringBuilder buffer = new StringBuilder("<?xml version=\"1.0\" ?>");
|
||||
buffer.append(IndentXMLStreamWriter.LINE_SEPARATOR);
|
||||
buffer.append("<root>").append(IndentXMLStreamWriter.LINE_SEPARATOR);
|
||||
buffer.append(" <message>Hello</message>");
|
||||
buffer.append(IndentXMLStreamWriter.LINE_SEPARATOR);
|
||||
buffer.append("</root>").append(IndentXMLStreamWriter.LINE_SEPARATOR);
|
||||
|
||||
Assert.assertEquals(buffer.toString(), content);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user