tmf: Fix remote.ui test on Windows due to line separators
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.remote.ui.tests / src / org / eclipse / tracecompass / tmf / remote / ui / tests / fetch / RemoteImportProfilesWriterTest.java
index ad3444ead32f6adf3d14a5b2264bb09ee113f308..0d7eccbde4b400dedbb9199903b3d97481c3a66d 100644 (file)
@@ -36,6 +36,7 @@ public class RemoteImportProfilesWriterTest extends
         AbstractRemoteImportProfilesIOTest {
 
     private static final String ENCODING = "UTF-8"; //$NON-NLS-1$
+    private static final String LINE_SEPARATOR_PROPERTY = "line.separator";
 
     /**
      * Test writing a profiles file.
@@ -53,6 +54,12 @@ public class RemoteImportProfilesWriterTest extends
         File expectedFile = getProfilesFile(VALID_PROFILE_PATH);
         String expectedContent = new String(
                 Files.readAllBytes(Paths.get(expectedFile.toURI())), ENCODING);
+
+        // On windows, \r\n will be written to the XML. Replace them with \n for
+        // proper comparison.
+        String sysLineSeparator = System.getProperty(LINE_SEPARATOR_PROPERTY);
+        writtenXML = writtenXML.replace(sysLineSeparator, "\n");
+
         assertEquals(expectedContent, writtenXML);
     }
 
This page took 0.023746 seconds and 5 git commands to generate.