Merge branch 'develop' into merged_2_11_2_0_to_2_12
[jalview.git] / test / jalview / analysis / FinderTest.java
index 764c56f..319c998 100644 (file)
@@ -68,7 +68,7 @@ public class FinderTest
   public void setUp()
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.applicationProperties.setProperty("PAD_GAPS",
+    Cache.setPropertyNoSave("PAD_GAPS",
             Boolean.FALSE.toString());
 
     //@formatter:off
@@ -82,16 +82,6 @@ public class FinderTest
             DataSourceType.PASTE);
     av = af.getViewport();
     al = av.getAlignment();
-    
-    // JAL-3765 bug test data
-    String longSeqData = 
-            ">O80429_MAIZE/2-140 Ferredoxin\n" + 
-            "AAT---------ALSMSILR---APPPCFSSPLRLRV--AVAKPLA-APMRRQLLRAQATYNVKLITPEGEV\n" + 
-            "ELQVPDDVYILDFAEEEGIDLPFSCRAGSCSSCAGKVVSGSVDQSDQSFLNDNQVADGWVLTCAAYPTSDVV\n" + 
-            "IETHKEDDLL--\n" ;
-    af_oneseq=new FileLoader().LoadFileWaitTillLoaded(longSeqData, DataSourceType.PASTE);
-    av_oneseq = af_oneseq.getViewport();
-    al_oneseq = av_oneseq.getAlignment();
   }
 
   @AfterMethod(alwaysRun = true)
@@ -133,6 +123,20 @@ public class FinderTest
     assertEquals(matches.get(1).getEnd(), 6);
   }
 
+  @Test(groups = "Functional")
+  public void testFind_findAll()
+  {
+    /*
+     * simple JAL-3765 test
+     * single symbol should find *all* matching symbols 
+     */
+    Finder f = new Finder(av);
+    f.findAll("M", false, false, false);
+    SearchResultsI sr = f.getSearchResults();
+    assertEquals(sr.getCount(), 5);
+
+  }
+
   /**
    * Test for (undocumented) find residue by position
    */
@@ -572,7 +576,7 @@ public class FinderTest
     sg.addSequence(al.getSequenceAt(1), false);
     sg.addSequence(al.getSequenceAt(2), false);
     av.setSelectionGroup(sg);
-  
+
     /*
      * search for 'e' should match two sequence ids and one residue
      */
@@ -638,8 +642,8 @@ public class FinderTest
   }
 
   /**
-   * Test that find does not report hidden positions, but does report matches that
-   * span hidden gaps
+   * Test that find does not report hidden positions, but does report matches
+   * that span hidden gaps
    */
   @Test(groups = "Functional")
   public void testFind_withHiddenColumns()
@@ -767,7 +771,7 @@ public class FinderTest
      * --bcdEFH
      * aa---aMMMMMaaa
      */
-  
+
     /*
      * hide columns 2-4 and 6-7
      */
@@ -775,7 +779,7 @@ public class FinderTest
     hc.hideColumns(2, 4);
     hc.hideColumns(6, 7);
     al.setHiddenColumns(hc);
-  
+
     /*
      * select rows 2-3
      */