Skip to content

Commit 3512544

Browse files
committed
fix #100 and #264 - (cherry-pick 43bed84) remove conversion to XML as we no longer have the JSON-XML facade--we now only support reading/writing JSON as JSON
(cherry picked from commit 43bed84)
1 parent 857a8c6 commit 3512544

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/test/java/com/marklogic/client/test/JSONDocumentTest.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import java.io.IOException;
2424
import java.io.Reader;
2525

26-
import javax.xml.XMLConstants;
27-
2826
import com.fasterxml.jackson.databind.JsonNode;
2927
import com.fasterxml.jackson.databind.ObjectMapper;
3028
import com.fasterxml.jackson.databind.node.ArrayNode;
@@ -40,7 +38,6 @@
4038
import com.marklogic.client.document.DocumentPatchBuilder;
4139
import com.marklogic.client.document.DocumentPatchBuilder.Position;
4240
import com.marklogic.client.document.JSONDocumentManager;
43-
import com.marklogic.client.document.XMLDocumentManager;
4441
import com.marklogic.client.io.BytesHandle;
4542
import com.marklogic.client.io.DOMHandle;
4643
import com.marklogic.client.io.FileHandle;
@@ -91,23 +88,6 @@ public void testReadWrite() throws IOException {
9188
File file = docMgr.read(docId, new FileHandle()).get();
9289
readNode = mapper.readTree(file);
9390
assertTrue("JSON document mismatch with file", sourceNode.equals(readNode));
94-
95-
docMgr.write(docId,
96-
new StringHandle().with(GenericDocumentTest.metadata).withFormat(Format.XML),
97-
new StringHandle().with(content));
98-
docText = docMgr.read(docId, new StringHandle()).get();
99-
assertNotNull("Read null string for JSON content",docText);
100-
readNode = mapper.readTree(docText);
101-
assertTrue("Failed to read JSON document as String", sourceNode.equals(readNode));
102-
103-
String lang = "fr-CA";
104-
docMgr.setLanguage(lang);
105-
docMgr.write(docId, new StringHandle().with(content));
106-
107-
XMLDocumentManager xmlMgr = Common.client.newXMLDocumentManager();
108-
Document document = xmlMgr.read(docId, new DOMHandle()).get();
109-
assertEquals("Failed to set language attribute on JSON", lang,
110-
document.getDocumentElement().getAttributeNS(XMLConstants.XML_NS_URI, "lang"));
11191
}
11292

11393
@Test

0 commit comments

Comments
 (0)