File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
metafacture-biblio/src/test/java/org/metafacture/biblio/marc21 Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ public void shouldIgnoreNullValueOfTypeLiteral() {
246246 }
247247
248248 @ Test
249- public void shouldEncodeTypeLiteralAsAttribute () {
249+ public void issue402_shouldEncodeTypeLiteralAsAttribute () {
250250 encoder .startRecord (RECORD_ID );
251251 encoder .literal ("type" , "value" );
252252 encoder .endRecord ();
@@ -258,4 +258,23 @@ public void shouldEncodeTypeLiteralAsAttribute() {
258258 assertEquals (expected , actual );
259259 }
260260
261+ @ Test
262+ public void shouldNotEncodeNestedTypeLiteralAsAttribute () {
263+ encoder .startRecord (RECORD_ID );
264+ encoder .startEntity ("tag12" );
265+ encoder .literal ("type" , "value" );
266+ encoder .endEntity ();
267+ encoder .endRecord ();
268+ encoder .closeStream ();
269+ String expected = XML_DECLARATION + XML_ROOT_OPEN
270+ + "<marc:record>"
271+ + "<marc:datafield tag=\" tag\" ind1=\" 1\" ind2=\" 2\" >"
272+ + "<marc:subfield code=\" type\" >value</marc:subfield>"
273+ + "</marc:datafield>"
274+ + "</marc:record>"
275+ + XML_MARC_COLLECTION_END_TAG ;
276+ String actual = resultCollector .toString ();
277+ assertEquals (expected , actual );
278+ }
279+
261280}
You can’t perform that action at this time.
0 commit comments