Skip to content

Commit

Permalink
[test] fix SerializationTest
Browse files Browse the repository at this point in the history
refs #4736
  • Loading branch information
line-o committed Jul 16, 2024
1 parent d826a54 commit 36b8825
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions exist-core/src/test/java/org/exist/xmldb/SerializationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static java.util.Collection<Object[]> data() {

private Collection testCollection;

private final String getBaseUri() {
private String getBaseUri() {
return baseUri.replace(PORT_PLACEHOLDER, Integer.toString(existWebServer.getPort()));
}

Expand Down Expand Up @@ -178,10 +178,6 @@ public void xqueryUpdateNsTest() throws XMLDBException {
@Test
public void getDocTypeDefault() throws XMLDBException {
final Resource res = testCollection.getResource(TEST_XML_DOC_WITH_DOCTYPE_URI.lastSegmentString());
// FIXME (JL): local and remote collections apparently have different output properties set
// INDENT is set to "no" for remote collections that's why it is explicitly set to true here
// Also, setting INDENT to "no" does not work for local collections and only somewhat for remote ones.
testCollection.setProperty(INDENT, "yes");
assertEquals(XML_WITH_DOCTYPE, res.getContent());
}

Expand All @@ -191,7 +187,7 @@ public void getDocTypeNo() throws XMLDBException {
try {
final Resource res = testCollection.getResource(TEST_XML_DOC_WITH_DOCTYPE_URI.lastSegmentString());
testCollection.setProperty(EXistOutputKeys.OUTPUT_DOCTYPE, "no");
assertEquals("<bookmap id=\"bookmap-1\"/>", res.getContent());
assertEquals("<bookmap id=\"bookmap-1\">\n asdf\n </bookmap>", res.getContent());
} finally {
if (prevOutputDocType != null) {
testCollection.setProperty(EXistOutputKeys.OUTPUT_DOCTYPE, prevOutputDocType);
Expand Down Expand Up @@ -276,7 +272,11 @@ public void setUp() throws XMLDBException {
final XMLResource res2 = testCollection.createResource(TEST_XML_DOC_WITH_XMLDECL_URI.lastSegmentString(), XMLResource.class);
res2.setContent(XML_WITH_XMLDECL);
testCollection.storeResource(res2);
}

// FIXME (JL): local and remote collections apparently have different output properties set
// local collections have INDENT set to "yes" whereas remote collections have "no" by default
testCollection.setProperty(INDENT, "yes");
}

@After
public void tearDown() throws XMLDBException {
Expand Down

0 comments on commit 36b8825

Please sign in to comment.