From 46ea72239db232c3a6ae2cbd082faa96a3817977 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 22 Feb 2012 15:42:17 +0100 Subject: [PATCH] Rename to Loc test. Now using LoC data --- src/org/marc4j/test/WriterTest.java | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) 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); -- 1.7.10.4