JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / io / ScoreMatrixFileTest.java
index 254feaa..99ec9a6 100644 (file)
@@ -19,7 +19,7 @@ import org.testng.annotations.Test;
 public class ScoreMatrixFileTest
 {
 
-  @AfterMethod(alwaysRun=true)
+  @AfterMethod(alwaysRun = true)
   public void tearDownAfterTest()
   {
     ScoreModels.getInstance().reset();
@@ -33,8 +33,7 @@ public class ScoreMatrixFileTest
    */
   @Test(groups = "Functional")
   public void testParseMatrix_ncbiMixedDelimiters()
-          throws MalformedURLException,
-          IOException
+          throws MalformedURLException, IOException
   {
     /*
      * some messy but valid input data, with comma, space
@@ -262,8 +261,7 @@ public class ScoreMatrixFileTest
       fail("expected exception");
     } catch (IOException e)
     {
-      assertEquals(
-              e.getMessage(),
+      assertEquals(e.getMessage(),
               "Format error: expected 'ScoreMatrix <name>', found 'ScoreMatrix' at line 1");
     }
   }
@@ -275,8 +273,8 @@ public class ScoreMatrixFileTest
    * @throws MalformedURLException
    */
   @Test(groups = "Functional")
-  public void testParseMatrix_ncbiFormat() throws MalformedURLException,
-          IOException
+  public void testParseMatrix_ncbiFormat()
+          throws MalformedURLException, IOException
   {
     // input including comment and blank lines
     String data = "ScoreMatrix MyTest\n#comment\n\n" + "\tA\tB\tC\n"
@@ -285,7 +283,7 @@ public class ScoreMatrixFileTest
     FileParse fp = new FileParse(data, DataSourceType.PASTE);
     ScoreMatrixFile parser = new ScoreMatrixFile(fp);
     ScoreMatrix sm = parser.parseMatrix();
-  
+
     assertNotNull(sm);
     assertEquals(sm.getName(), "MyTest");
     assertEquals(parser.getMatrixName(), "MyTest");
@@ -302,14 +300,13 @@ public class ScoreMatrixFileTest
    */
   @Test(groups = "Functional")
   public void testParseMatrix_aaIndexBlosum80()
-          throws MalformedURLException,
-          IOException
+          throws MalformedURLException, IOException
   {
     FileParse fp = new FileParse("resources/scoreModel/blosum80.scm",
             DataSourceType.FILE);
     ScoreMatrixFile parser = new ScoreMatrixFile(fp);
     ScoreMatrix sm = parser.parseMatrix();
-  
+
     assertNotNull(sm);
     assertEquals(sm.getName(), "HENS920103");
     assertEquals(sm.getDescription(),
@@ -330,8 +327,8 @@ public class ScoreMatrixFileTest
    * @throws MalformedURLException
    */
   @Test(groups = "Functional")
-  public void testParseMatrix_aaindexFormat() throws MalformedURLException,
-          IOException
+  public void testParseMatrix_aaindexFormat()
+          throws MalformedURLException, IOException
   {
     /*
      * aaindex format has scores for diagonal and below only
@@ -339,13 +336,12 @@ public class ScoreMatrixFileTest
     String data = "H MyTest\n" + "D My description\n" + "R PMID:1438297\n"
             + "A Authors, names\n" + "T Journal title\n"
             + "J Journal reference\n" + "* matrix in 1/3 Bit Units\n"
-            + "M rows = ABC, cols = ABC\n" + "A\t1.0\n"
-            + "B\t4.0\t5.0\n"
+            + "M rows = ABC, cols = ABC\n" + "A\t1.0\n" + "B\t4.0\t5.0\n"
             + "C\t7.0\t8.0\t9.0\n";
     FileParse fp = new FileParse(data, DataSourceType.PASTE);
     ScoreMatrixFile parser = new ScoreMatrixFile(fp);
     ScoreMatrix sm = parser.parseMatrix();
-  
+
     assertNotNull(sm);
     assertEquals(sm.getSize(), 3);
     assertEquals(sm.getName(), "MyTest");
@@ -363,14 +359,12 @@ public class ScoreMatrixFileTest
 
   @Test(groups = "Functional")
   public void testParseMatrix_aaindex_mMissing()
-          throws MalformedURLException,
-          IOException
+          throws MalformedURLException, IOException
   {
     /*
      * aaindex format but M cols=, rows= is missing
      */
-    String data = "H MyTest\n" + "A\t1.0\n"
-            + "B\t4.0\t5.0\n"
+    String data = "H MyTest\n" + "A\t1.0\n" + "B\t4.0\t5.0\n"
             + "C\t7.0\t8.0\t9.0\n";
     FileParse fp = new FileParse(data, DataSourceType.PASTE);
     ScoreMatrixFile parser = new ScoreMatrixFile(fp);
@@ -386,12 +380,10 @@ public class ScoreMatrixFileTest
 
   @Test(groups = "Functional")
   public void testParseMatrix_aaindex_rowColMismatch()
-          throws MalformedURLException,
-          IOException
+          throws MalformedURLException, IOException
   {
     String data = "H MyTest\n" + "M rows=ABC, cols=ABD\n" + "A\t1.0\n"
-            + "B\t4.0\t5.0\n"
-            + "C\t7.0\t8.0\t9.0\n";
+            + "B\t4.0\t5.0\n" + "C\t7.0\t8.0\t9.0\n";
     FileParse fp = new FileParse(data, DataSourceType.PASTE);
     ScoreMatrixFile parser = new ScoreMatrixFile(fp);
     try
@@ -400,8 +392,7 @@ public class ScoreMatrixFileTest
       fail("Expected exception");
     } catch (FileFormatException e)
     {
-      assertEquals(
-              e.getMessage(),
+      assertEquals(e.getMessage(),
               "Unexpected aaIndex score matrix data at line 2: M rows=ABC, cols=ABD rows != cols");
     }
   }
@@ -424,8 +415,7 @@ public class ScoreMatrixFileTest
 
   @Test(groups = "Functional")
   public void testParseMatrix_aaindex_tooManyRows()
-          throws MalformedURLException,
-          IOException
+          throws MalformedURLException, IOException
   {
     String data = "H MyTest\n" + "M rows=ABC, cols=ABC\n" + "A\t1.0\n"
             + "B\t4.0\t5.0\n" + "C\t7.0\t8.0\t9.0\n" + "C\t7.0\t8.0\t9.0\n";
@@ -443,8 +433,7 @@ public class ScoreMatrixFileTest
 
   @Test(groups = "Functional")
   public void testParseMatrix_aaindex_extraDataLines()
-          throws MalformedURLException,
-          IOException
+          throws MalformedURLException, IOException
   {
     String data = "H MyTest\n" + "M rows=ABC, cols=ABC\n" + "A\t1.0\n"
             + "B\t4.0\t5.0\n" + "C\t7.0\t8.0\t9.0\n" + "something extra\n";
@@ -462,8 +451,7 @@ public class ScoreMatrixFileTest
 
   @Test(groups = "Functional")
   public void testParseMatrix_aaindex_tooFewColumns()
-          throws MalformedURLException,
-          IOException
+          throws MalformedURLException, IOException
   {
     String data = "H MyTest\n" + "M rows=ABC, cols=ABC\n" + "A\t1.0\n"
             + "B\t4.0\t5.0\n" + "C\t7.0\t8.0\n";
@@ -475,8 +463,7 @@ public class ScoreMatrixFileTest
       fail("Expected exception");
     } catch (FileFormatException e)
     {
-      assertEquals(
-              e.getMessage(),
+      assertEquals(e.getMessage(),
               "Expected 3 scores at line 5: 'C\t7.0\t8.0' but found 2");
     }
   }
@@ -488,8 +475,8 @@ public class ScoreMatrixFileTest
    * @throws MalformedURLException
    */
   @Test(groups = "Functional")
-  public void testParse_ncbiFormat() throws MalformedURLException,
-          IOException
+  public void testParse_ncbiFormat()
+          throws MalformedURLException, IOException
   {
     assertNull(ScoreModels.getInstance().getScoreModel("MyNewTest", null));
 
@@ -500,9 +487,9 @@ public class ScoreMatrixFileTest
     ScoreMatrixFile parser = new ScoreMatrixFile(fp);
 
     parser.parse();
-  
-    ScoreMatrix sm = (ScoreMatrix) ScoreModels.getInstance().getScoreModel(
-            "MyNewTest", null);
+
+    ScoreMatrix sm = (ScoreMatrix) ScoreModels.getInstance()
+            .getScoreModel("MyNewTest", null);
     assertNotNull(sm);
     assertEquals(sm.getName(), "MyNewTest");
     assertEquals(parser.getMatrixName(), "MyNewTest");