From: kiramt Date: Mon, 15 May 2017 08:42:17 +0000 (+0100) Subject: JAL-2491 Tests X-Git-Tag: Release_2_10_2~3^2~64^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=557859a3ea9a1e86899ef2033de90eadb6d87118;p=jalview.git JAL-2491 Tests --- diff --git a/test/jalview/viewmodel/ViewportRangesTest.java b/test/jalview/viewmodel/ViewportRangesTest.java index 4e15b80..3cd2096 100644 --- a/test/jalview/viewmodel/ViewportRangesTest.java +++ b/test/jalview/viewmodel/ViewportRangesTest.java @@ -94,11 +94,11 @@ public class ViewportRangesTest { vr.setStartSeq(-1); assertEquals(vr.getStartSeq(), 0); - vr.setStartSeq(al.getHeight()); - assertEquals(vr.getStartSeq(), al.getHeight() - 1); + vr.setStartSeq(al.getHeight() - vr.getViewportHeight() + 1); + assertEquals(vr.getStartSeq(), al.getHeight() - vr.getViewportHeight()); - vr.setStartSeq(al.getHeight() - 1); - assertEquals(vr.getStartSeq(), al.getHeight() - 1); + vr.setStartSeq(al.getHeight() - vr.getViewportHeight()); + assertEquals(vr.getStartSeq(), al.getHeight() - vr.getViewportHeight()); } @Test(groups = { "Functional" }) @@ -298,6 +298,10 @@ public class ViewportRangesTest { MockPropChangeListener l = new MockPropChangeListener(vr); List emptylist = new ArrayList(); + vr.setViewportWidth(5); + vr.setViewportHeight(5); + l.reset(); + // one event fired when startRes is called with new value vr.setStartRes(4); assertTrue(l.verify(1, Arrays.asList("startres")));