2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import java.util.Date;
25 import org.testng.annotations.AfterClass;
26 import org.testng.annotations.BeforeClass;
27 import org.testng.annotations.BeforeTest;
29 import jalview.bin.Cache;
30 import jalview.bin.Jalview;
31 import jalview.datamodel.AlignmentAnnotation;
32 import jalview.datamodel.SequenceI;
33 import jalview.gui.Desktop;
34 import jalview.gui.JvOptionPane;
36 public class Jalview2xmlBase
39 @BeforeClass(alwaysRun = true)
40 public void setUpJvOptionPane()
42 JvOptionPane.setInteractiveMode(false);
43 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
47 * @throws java.lang.Exception
49 @BeforeClass(alwaysRun = true)
50 public static void setUpBeforeClass() throws Exception
53 * use read-only test properties file
55 Cache.loadProperties("test/jalview/io/testProps.jvprops");
58 * set news feed last read to a future time to ensure no
59 * 'unread' news item is displayed
61 Date oneHourFromNow = new Date(
62 System.currentTimeMillis() + 3600 * 1000);
63 Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow);
65 Jalview.main(new String[] {});
69 * @throws java.lang.Exception
71 @AfterClass(alwaysRun = true)
72 public static void tearDownAfterClass() throws Exception
74 if (Desktop.instance != null)
75 Desktop.instance.closeAll_actionPerformed(null);
78 @BeforeTest(alwaysRun = true)
79 public static void clearDesktop()
81 if (Desktop.instance != null && Desktop.getFrames() != null
82 && Desktop.getFrames().length > 0)
84 Desktop.instance.closeAll_actionPerformed(null);
88 public int countDsAnn(jalview.viewmodel.AlignmentViewport avp)
91 for (SequenceI sq : avp.getAlignment().getDataset().getSequences())
93 if (sq.getAnnotation() != null)
95 for (AlignmentAnnotation dssa : sq.getAnnotation())
97 if (dssa.isValidStruc())