JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / io / FileIOTester.java
index 04d01b0..48aae6b 100644 (file)
@@ -24,17 +24,19 @@ 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;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-import jalview.bin.Cache;
+import jalview.bin.Console;
 import jalview.gui.JvOptionPane;
 
 /**
@@ -57,7 +59,7 @@ public class FileIOTester
   @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
-    Cache.initLogger();
+    Console.initLogger();
   }
 
   /**
@@ -136,17 +138,23 @@ public class FileIOTester
   public void testIsGzipInputStream() throws IOException
   {
     InputStream is = new FileInputStream(ALIGN_FILE);
-    
+
     /*
      * first try fails - FileInputStream does not support mark/reset
      */
     assertFalse(FileParse.isGzipStream(is));
-    
+
     /*
      * wrap in a BufferedInputStream and try again
      */
     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" })