Clover icon

Coverage Report

  1. Project Clover database Thu Nov 7 2024 13:01:17 GMT
  2. Package jalview.io

File Jalview2xmlBase.java

 

Coverage histogram

../../img/srcFileCovDistChart8.png
20% of files have more coverage

Code metrics

8
17
5
1
107
62
11
0.65
3.4
5
2.2

Classes

Class Line # Actions
Jalview2xmlBase 36 17 11
0.7333333573.3%
 

Contributing tests

This file is covered by 1 test. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
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.
11    *
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.
16    *
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.
20    */
21    package jalview.io;
22   
23    import java.util.Date;
24   
25    import org.testng.annotations.AfterClass;
26    import org.testng.annotations.BeforeClass;
27    import org.testng.annotations.BeforeTest;
28   
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;
35   
 
36    public class Jalview2xmlBase
37    {
38   
 
39  0 toggle @BeforeClass(alwaysRun = true)
40    public void setUpJvOptionPane()
41    {
42  0 JvOptionPane.setInteractiveMode(false);
43  0 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
44    }
45   
46    /**
47    * @throws java.lang.Exception
48    */
 
49  3 toggle @BeforeClass(alwaysRun = true)
50    public static void setUpBeforeClass() throws Exception
51    {
52    /*
53    * use read-only test properties file
54    */
55  3 Cache.loadProperties("test/jalview/io/testProps.jvprops");
56   
57    /*
58    * set news feed last read to a future time to ensure no
59    * 'unread' news item is displayed
60    */
61  3 Date oneHourFromNow = new Date(
62    System.currentTimeMillis() + 3600 * 1000);
63  3 Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow);
64   
65  3 Jalview.main(new String[] {});
66    }
67   
68    /**
69    * @throws java.lang.Exception
70    */
 
71  3 toggle @AfterClass(alwaysRun = true)
72    public static void tearDownAfterClass() throws Exception
73    {
74  3 if (Desktop.instance != null)
75  3 Desktop.instance.closeAll_actionPerformed(null);
76    }
77   
 
78  4 toggle @BeforeTest(alwaysRun = true)
79    public static void clearDesktop()
80    {
81  4 if (Desktop.instance != null && Desktop.getFrames() != null
82    && Desktop.getFrames().length > 0)
83    {
84  0 Desktop.instance.closeAll_actionPerformed(null);
85    }
86    }
87   
 
88  2 toggle public int countDsAnn(jalview.viewmodel.AlignmentViewport avp)
89    {
90  2 int numdsann = 0;
91  2 for (SequenceI sq : avp.getAlignment().getDataset().getSequences())
92    {
93  122 if (sq.getAnnotation() != null)
94    {
95  122 for (AlignmentAnnotation dssa : sq.getAnnotation())
96    {
97  122 if (dssa.isValidStruc())
98    {
99  122 numdsann++;
100    }
101    }
102    }
103    }
104  2 return numdsann;
105    }
106   
107    }