@@ -86,6 +86,22 @@ public void shouldSupportCGXmlAsInputAndResultFormat() {
86
86
// an exception.
87
87
}
88
88
89
+ @ Test
90
+ public void issue229ShouldSupportMarcXmlAsInputAndResultFormat () {
91
+ final Element inputElement = createMarcXmlRecord (INPUT_TAG );
92
+ final Element resultElement = createMarcXmlRecord (RESULT_TAG );
93
+
94
+ final Element testCaseElement = document .createElement (TEST_CASE_TAG );
95
+ testCaseElement .appendChild (inputElement );
96
+ testCaseElement .appendChild (resultElement );
97
+
98
+ final TestCase testCase = new TestCase (testCaseElement );
99
+ testCase .run ();
100
+
101
+ // The test was successful if run does not throw
102
+ // an exception.
103
+ }
104
+
89
105
@ Test
90
106
public void issue219ShouldResolveXIncludesInMetamorphResources () {
91
107
final Element inputElement = createFormetaRecord (INPUT_TAG );
@@ -125,4 +141,19 @@ private Element createCGXmlRecord(final String elementName) {
125
141
return element ;
126
142
}
127
143
144
+ private Element createMarcXmlRecord (final String elementName ) {
145
+ final Element fieldElement = document .createElement ("controlfield" );
146
+ fieldElement .setAttribute ("tag" , "001" );
147
+ fieldElement .setTextContent ("123" );
148
+ final Element recordElement = document .createElement ("record" );
149
+ recordElement .appendChild (fieldElement );
150
+ final Element collectionElement = document .createElementNS (
151
+ "http://www.loc.gov/MARC21/slim" , "collection" );
152
+ collectionElement .appendChild (recordElement );
153
+ final Element element = document .createElement (elementName );
154
+ element .setAttribute ("type" , "application/marcxml+xml" );
155
+ element .appendChild (collectionElement );
156
+ return element ;
157
+ }
158
+
128
159
}
0 commit comments