From: Dennis Schafroth Date: Wed, 22 Feb 2012 14:42:17 +0000 (+0100) Subject: Rename to Loc test. Now using LoC data X-Git-Tag: v2.5~13 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;ds=sidebyside;h=46ea72239db232c3a6ae2cbd082faa96a3817977;p=marc4j.git Rename to Loc test. Now using LoC data --- diff --git a/src/org/marc4j/test/WriterTest.java b/src/org/marc4j/test/WriterTest.java index af5e1a0..830e50a 100644 --- a/src/org/marc4j/test/WriterTest.java +++ b/src/org/marc4j/test/WriterTest.java @@ -6,6 +6,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.OutputStream; import java.io.PrintStream; import java.io.StringReader; @@ -71,17 +72,21 @@ public class WriterTest extends TestCase { System.out.println(""); } - public void testTurboMarcXmlWriterAutoGraphics() throws Exception { - InputStream input = getClass().getResourceAsStream("resources/auto-graphics.mrc"); - MarcWriter writer = new TurboMarcXmlWriter(new FileOutputStream( new File("auto-graphics.txml")), true); + public void testDummyLoadLoC10K() throws Exception { + @SuppressWarnings("unused") + InputStream input = getClass().getResourceAsStream("resources/loc-10k-0000001.mrc"); + } + + public void testMarcXmlWriterLoC10K() throws Exception { + InputStream input = getClass().getResourceAsStream("resources/loc-10k-0000001.mrc"); + MarcWriter writer = new MarcXmlWriter(new FileOutputStream( new File("auto-graphics.txml")), true); MarcStreamReader reader = new MarcStreamReader(input); doReadWrite(writer, reader); input.close(); } - - public void testMarcXmlWriterAutoGraphics() throws Exception { - InputStream input = getClass().getResourceAsStream("resources/auto-graphics.mrc"); - MarcWriter writer = new MarcXmlWriter(new FileOutputStream( new File("auto-graphics.txml")), true); + public void testTurboMarcXmlWriterLoC10K() throws Exception { + InputStream input = getClass().getResourceAsStream("resources/loc-10k-0000001.mrc"); + MarcWriter writer = new TurboMarcXmlWriter(new FileOutputStream( new File("auto-graphics.txml")), true); MarcStreamReader reader = new MarcStreamReader(input); doReadWrite(writer, reader); input.close(); @@ -114,10 +119,11 @@ public class WriterTest extends TestCase { } - public void testMarcXmlWriterAutoGraphics2pz() throws Exception { - InputStream input = getClass().getResourceAsStream("resources/auto-graphics.mrc"); + public void testMarcXmlWriterLoC10K2pz() throws Exception { + InputStream input = getClass().getResourceAsStream("resources/loc-10k-0000001.mrc"); PrintStream devNull = new java.io.PrintStream ( new java.io.OutputStream ( ) { public void write ( int b ) { } }); - StreamResult result = new StreamResult(new FileOutputStream("autographics.xml")); + OutputStream file = new FileOutputStream("loc10k.xml"); + StreamResult result = new StreamResult(file); MarcWriter writer = new MarcXmlWriter(result, new StreamSource(new InputStreamReader(getClass().getResourceAsStream("resources/marc21.xsl")))); MarcStreamReader reader = new MarcStreamReader(input); @@ -125,10 +131,11 @@ public class WriterTest extends TestCase { input.close(); } - public void testTurboMarcXmlWriterAutoGraphics2pz() throws Exception { - InputStream input = getClass().getResourceAsStream("resources/auto-graphics.mrc"); + public void testTurboMarcXmlWriterLoC10K2pz() throws Exception { + InputStream input = getClass().getResourceAsStream("resources/loc-10k-0000001.mrc"); PrintStream devNull = new java.io.PrintStream ( new java.io.OutputStream ( ) { public void write ( int b ) { } }); - StreamResult result = new StreamResult(new FileOutputStream("autographics.txml")); + OutputStream file = new FileOutputStream("loc10k.txml"); + StreamResult result = new StreamResult(file); MarcWriter writer = new TurboMarcXmlWriter(result, new StreamSource(new InputStreamReader(getClass().getResourceAsStream("resources/tmarc.xsl")))); MarcStreamReader reader = new MarcStreamReader(input); doReadWrite(writer, reader);