Merge branch 'develop' into patch/JAL-4281_idwidthandannotHeight_in_project
[jalview.git] / test / jalview / gui / ScalePanelTest.java
index 7d39ea9..20e72b9 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.gui;
 
 import static org.testng.Assert.assertEquals;
@@ -44,6 +64,10 @@ public class ScalePanelTest
     ScalePanel scalePanel = alignFrame.alignPanel.getScalePanel();
 
     MouseEvent mouse = new MouseEvent(scalePanel, 0, 1, 0, 4, 0, 1, false);
+    
+    // check the bounded lookup is not returning negatives
+    assertEquals(alignFrame.alignPanel.getSeqPanel().findAlignmentColumn(mouse),0);
+    
     scalePanel.mousePressed(mouse);
     scalePanel.mouseDragged(mouse);
 
@@ -83,7 +107,7 @@ public class ScalePanelTest
     alignFrame.alignPanel.updateLayout();
     assertEquals(ranges.getStartRes(), 0);
     assertEquals(ranges.getEndRes(), 22);
-    
+
     int cw = viewport.getCharWidth();
     int xPos = 9 * cw + 2;
     MouseEvent mouse = new MouseEvent(scalePanel, 0, 1, 0, xPos, 0, 1,
@@ -232,7 +256,7 @@ public class ScalePanelTest
      * use read-only test properties file
      */
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Jalview.main(new String[] { "-nonews" });
+    Jalview.main(new String[] { "--nonews" });
   }
 
 }