aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-12-31 17:33:42 +0000
committerMichael Williamson <mike@zwobble.org>2015-12-31 17:33:42 +0000
commit10fb9097c90d531445a290e29dcb29f9bcc8885a (patch)
tree19bb5638f2b4e070f5ebe13416931aa946b31f4c /src/test/java
parent853ed35d873b5a3e95d5d332ffeb2211f772edfe (diff)
Add relationship XML reading
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/docx/RelationshipsXmlTests.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/docx/RelationshipsXmlTests.java b/src/test/java/org/zwobble/mammoth/tests/docx/RelationshipsXmlTests.java
new file mode 100644
index 0000000..1ba9ea8
--- /dev/null
+++ b/src/test/java/org/zwobble/mammoth/tests/docx/RelationshipsXmlTests.java
@@ -0,0 +1,26 @@
+package org.zwobble.mammoth.tests.docx;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.junit.Test;
+import org.zwobble.mammoth.docx.Relationships;
+import org.zwobble.mammoth.xml.XmlElement;
+
+import static org.junit.Assert.assertEquals;
+import static org.zwobble.mammoth.docx.RelationshipsXml.readRelationshipsXmlElement;
+import static org.zwobble.mammoth.xml.XmlNodes.element;
+
+public class RelationshipsXmlTests {
+ @Test
+ public void targetIsReadFromRelationshipElement() {
+ XmlElement element = element("relationship:Relationships", ImmutableList.of(
+ element("relationships:Relationship", ImmutableMap.of(
+ "Id", "rId8",
+ "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
+ "Target", "http://example.com"))));
+
+ Relationships relationships = readRelationshipsXmlElement(element);
+
+ assertEquals("http://example.com", relationships.findRelationshipById("rId8").getTarget());
+ }
+}