\r
import org.marc4j.MarcStreamReader;\r
import org.marc4j.MarcStreamWriter;\r
+import org.marc4j.MarcWriter;\r
import org.marc4j.MarcXmlReader;\r
import org.marc4j.MarcXmlWriter;\r
+import org.marc4j.TurboMarcXmlWriter;\r
import org.marc4j.marc.Record;\r
\r
public class WriterTest extends TestCase {\r
public void testMarcXmlWriter() throws Exception {\r
InputStream input = getClass().getResourceAsStream(\r
"resources/summerland.mrc");\r
- MarcXmlWriter writer = new MarcXmlWriter(System.out, true);\r
+ MarcWriter writer = new MarcXmlWriter(System.out, true);\r
MarcStreamReader reader = new MarcStreamReader(input);\r
while (reader.hasNext()) {\r
Record record = reader.next();\r
writer.close();\r
}\r
\r
+ public void testTurboMarcXmlWriter() throws Exception {\r
+ InputStream input = getClass().getResourceAsStream(\r
+ "resources/summerland.mrc");\r
+ MarcWriter writer = new TurboMarcXmlWriter(System.out, true);\r
+ MarcStreamReader reader = new MarcStreamReader(input);\r
+ while (reader.hasNext()) {\r
+ Record record = reader.next();\r
+ writer.write(record);\r
+ }\r
+ input.close();\r
+ writer.close();\r
+ }\r
+ \r
public void testWriteAndRead() throws Exception {\r
InputStream input = getClass().getResourceAsStream(\r
"resources/summerland.xml");\r