@@ -86,6 +86,22 @@ public void shouldSupportCGXmlAsInputAndResultFormat() {
8686 // an exception.
8787 }
8888
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+
89105 @ Test
90106 public void issue219ShouldResolveXIncludesInMetamorphResources () {
91107 final Element inputElement = createFormetaRecord (INPUT_TAG );
@@ -125,4 +141,19 @@ private Element createCGXmlRecord(final String elementName) {
125141 return element ;
126142 }
127143
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+
128159}
0 commit comments