creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1549181 - /creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/annotation/LicenceAppenderTest.java
Date Sun, 08 Dec 2013 20:01:15 GMT
Author: rdonkin
Date: Sun Dec  8 20:01:15 2013
New Revision: 1549181

URL: http://svn.apache.org/r1549181
Log:
Add test: testBOMInputStreamReset

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/annotation/LicenceAppenderTest.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/annotation/LicenceAppenderTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/annotation/LicenceAppenderTest.java?rev=1549181&r1=1549180&r2=1549181&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/annotation/LicenceAppenderTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/annotation/LicenceAppenderTest.java
Sun Dec  8 20:01:15 2013
@@ -1032,4 +1032,50 @@ public class LicenceAppenderTest {
 		Assert.assertEquals(1000, bomInputStream.read(buf));
 		bomInputStream.close();
 	}
+
+	/**
+	 * Test bom input stream reset.
+	 * 
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	@Test
+	public void testBOMInputStreamReset() throws IOException {
+		String document = qualify("tmp.apt");
+		FileCreator creator = new FileCreator() {
+			public void createFile(final Writer writer) throws IOException {
+				writer.write("A Simple APT file");
+				writer.write(" This file contains nothing\n");
+				writer.write(" of any importance\n");
+			}
+		};
+		createTestFile(document, creator);
+		InputStream fis = new FileInputStream(new File(document));
+		BOMInputStream bomInputStream = new BOMInputStream(fis);
+		bomInputStream.mark(10000);
+		bomInputStream.close();
+	}
+
+	/**
+	 * Test bom input stream mark.
+	 * 
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	@Test
+	public void testBOMInputStreamMark() throws IOException {
+		String document = qualify("tmp.apt");
+		FileCreator creator = new FileCreator() {
+			public void createFile(final Writer writer) throws IOException {
+				writer.write("A Simple APT file");
+				writer.write(" This file contains nothing\n");
+				writer.write(" of any importance\n");
+			}
+		};
+		createTestFile(document, creator);
+		InputStream fis = new FileInputStream(new File(document));
+		BOMInputStream bomInputStream = new BOMInputStream(fis);
+		bomInputStream.mark(10000);
+		bomInputStream.close();
+	}
 }



Mime
View raw message