Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;

import com.mirth.connect.model.converters.TestUtil;

/**
* Serializes every sample in tests/dicom and compares it against the committed XML, which is the
* serializer's own output and so is already indented. Drop a new .dcm and its .xml into that
Expand Down Expand Up @@ -50,6 +52,6 @@ public void toXml() throws Exception {
String actual = new DICOMSerializer().toXML(Base64.getEncoder().encodeToString(header));
String expected = FileUtils.readFileToString(new File(SAMPLES, StringUtils.removeEnd(name, ".dcm") + ".xml"), UTF_8);

assertEquals(expected, actual);
assertEquals(TestUtil.normalizeLineEndings(expected), TestUtil.normalizeLineEndings(actual));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testFromXMLWithExternalDtd() {
public void test51RequestToXml() throws Exception {
String input = read("test-ncpdp-51-request-input.txt");
String output = read("test-ncpdp-51-request-output.xml");
assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
assertEquals(TestUtil.normalizeLineEndings(output), TestUtil.normalizeLineEndings(TestUtil.prettyPrintXml(serializer.toXML(input))));
}

@Test
Expand All @@ -66,7 +66,7 @@ public void test51RequestFromXml() throws Exception {
public void test51ResponseToXml() throws Exception {
String input = read("test-ncpdp-51-response-input.txt");
String output = read("test-ncpdp-51-response-output.xml");
assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
assertEquals(TestUtil.normalizeLineEndings(output), TestUtil.normalizeLineEndings(TestUtil.prettyPrintXml(serializer.toXML(input))));
}

@Test
Expand All @@ -80,7 +80,7 @@ public void test51ResponseFromXml() throws Exception {
public void testD0RequestToXml() throws Exception {
String input = read("test-ncpdp-d0-request-input.txt");
String output = read("test-ncpdp-d0-request-output.xml");
assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
assertEquals(TestUtil.normalizeLineEndings(output), TestUtil.normalizeLineEndings(TestUtil.prettyPrintXml(serializer.toXML(input))));
}

@Test
Expand All @@ -94,7 +94,7 @@ public void testD0RequestFromXml() throws Exception {
public void testD0ResponseToXml() throws Exception {
String input = read("test-ncpdp-d0-response-input.txt");
String output = read("test-ncpdp-d0-response-output.xml");
assertEquals(output, TestUtil.prettyPrintXml(serializer.toXML(input)));
assertEquals(TestUtil.normalizeLineEndings(output), TestUtil.normalizeLineEndings(TestUtil.prettyPrintXml(serializer.toXML(input))));
}

@Test
Expand Down
Loading