JAL-3615 code tidy, improve unit test
[jalview.git] / test / jalview / io / FileIOTester.java
index 04d01b0..e37ae3f 100644 (file)
@@ -24,10 +24,12 @@ import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
 import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.StringBufferInputStream;
 
 import org.testng.AssertJUnit;
 import org.testng.annotations.AfterClass;
@@ -147,6 +149,12 @@ public class FileIOTester
      */
     is = new BufferedInputStream(is, 16);
     assertTrue(FileParse.isGzipStream(is));
+    
+    /*
+     * check recognition of non-gzipped input
+     */
+    assertFalse(FileParse.isGzipStream(new BufferedInputStream(
+            new ByteArrayInputStream("NOT A GZIP".getBytes()))));    
   }
 
   @Test(groups = { "Functional" })