3 import jalview.bin.Cache;
4 import jalview.bin.Jalview;
5 import jalview.datamodel.AlignmentAnnotation;
6 import jalview.datamodel.SequenceI;
7 import jalview.gui.Desktop;
11 import org.testng.annotations.AfterClass;
12 import org.testng.annotations.BeforeClass;
13 import org.testng.annotations.BeforeTest;
15 public class Jalview2xmlBase
19 * @throws java.lang.Exception
21 @BeforeClass(alwaysRun = true)
22 public static void setUpBeforeClass() throws Exception
25 * use read-only test properties file
27 Cache.loadProperties("test/jalview/io/testProps.jvprops");
30 * set news feed last read to a future time to ensure no
31 * 'unread' news item is displayed
33 Date oneHourFromNow = new Date(System.currentTimeMillis() + 3600 * 1000);
34 Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow);
36 Jalview.main(new String[] {});
40 * @throws java.lang.Exception
42 @AfterClass(alwaysRun = true)
43 public static void tearDownAfterClass() throws Exception
45 jalview.gui.Desktop.instance.closeAll_actionPerformed(null);
48 @BeforeTest(alwaysRun = true)
49 public static void clearDesktop()
51 if (Desktop.instance != null && Desktop.getAlignFrames() != null)
53 Desktop.instance.closeAll_actionPerformed(null);
57 public int countDsAnn(jalview.viewmodel.AlignmentViewport avp)
60 for (SequenceI sq : avp.getAlignment().getDataset().getSequences())
62 if (sq.getAnnotation() != null)
64 for (AlignmentAnnotation dssa : sq.getAnnotation())
66 if (dssa.isValidStruc())