New Turbo Marc Xml test
authorDennis Schafroth <dennis@indexdata.com>
Wed, 18 Jan 2012 11:53:13 +0000 (12:53 +0100)
committerDennis Schafroth <dennis@indexdata.com>
Wed, 18 Jan 2012 11:53:13 +0000 (12:53 +0100)
src/org/marc4j/test/WriterTest.java

index fba5ea2..2e0760a 100644 (file)
@@ -11,8 +11,10 @@ import junit.textui.TestRunner;
 \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
@@ -33,7 +35,7 @@ public class WriterTest extends TestCase {
     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
@@ -43,6 +45,19 @@ public class WriterTest extends TestCase {
         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