X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fworkers%2FAlignCalcManagerTest.java;h=a523f386e1e9de35da93e3cbcc82d39205436a95;hb=f44b21827a10ef83754f67a211968164055d39b4;hp=73247ef9cf3cf36922e5e4e2d547935e201b20a4;hpb=528c0f1815bc67b54618ad5b16c2162946974caf;p=jalview.git diff --git a/test/jalview/workers/AlignCalcManagerTest.java b/test/jalview/workers/AlignCalcManagerTest.java index 73247ef..a523f38 100644 --- a/test/jalview/workers/AlignCalcManagerTest.java +++ b/test/jalview/workers/AlignCalcManagerTest.java @@ -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 . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.workers; import static org.testng.AssertJUnit.assertEquals; @@ -14,15 +34,25 @@ import jalview.datamodel.Annotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import java.util.Collections; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class AlignCalcManagerTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private AlignFrame alignFrame; /** @@ -34,10 +64,10 @@ public class AlignCalcManagerTest public void testRemoveWorkerForAnnotation() { AlignCalcManagerI acm = alignFrame.getViewport().getCalcManager(); - final AlignmentAnnotation ann1 = new AlignmentAnnotation("Ann1", - "desc", new Annotation[] {}); - final AlignmentAnnotation ann2 = new AlignmentAnnotation("Ann2", - "desc", new Annotation[] {}); + final AlignmentAnnotation ann1 = new AlignmentAnnotation("Ann1", "desc", + new Annotation[] {}); + final AlignmentAnnotation ann2 = new AlignmentAnnotation("Ann2", "desc", + new Annotation[] {}); /* * make two workers for ann1, one deletable, one not @@ -90,8 +120,8 @@ public class AlignCalcManagerTest * - should delete worker1 but not worker2 */ acm.removeWorkerForAnnotation(ann1); - assertEquals(1, acm.getRegisteredWorkersOfClass(worker1.getClass()) - .size()); + assertEquals(1, + acm.getRegisteredWorkersOfClass(worker1.getClass()).size()); assertTrue(acm.getRegisteredWorkersOfClass(worker1.getClass()) .contains(worker2)); assertFalse(acm.isDisabled(worker1)); @@ -137,8 +167,9 @@ public class AlignCalcManagerTest @BeforeMethod(alwaysRun = true) public void setUp() { - AlignmentI al = new Alignment(new SequenceI[] { new Sequence("Seq1", - "ABC") }); + AlignmentI al = new Alignment( + new SequenceI[] + { new Sequence("Seq1", "ABC") }); al.setDataset(null); alignFrame = new AlignFrame(al, 3, 1); }