Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.ext.ensembl

File EnsemblRestClientTest.java

 

Code metrics

4
13
9
1
106
71
11
0.85
1.44
9
1.22

Classes

Class Line # Actions
EnsemblRestClientTest 34 13 11 26
0.00%
 

Contributing tests

No tests hitting this source file were found.

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.ext.ensembl;
22   
23    import static org.testng.Assert.assertTrue;
24   
25    import jalview.datamodel.AlignmentI;
26   
27    import java.net.MalformedURLException;
28    import java.net.URL;
29    import java.util.List;
30   
31    import org.testng.annotations.BeforeMethod;
32    import org.testng.annotations.Test;
33   
 
34    public class EnsemblRestClientTest
35    {
36    private EnsemblRestClient sf;
37   
 
38  0 toggle @Test(suiteName = "live")
39    public void testIsEnsemblAvailable()
40    {
41  0 boolean isAvailable = sf.isEnsemblAvailable();
42  0 if (isAvailable)
43    {
44  0 System.out.println("Ensembl is UP!");
45    }
46    else
47    {
48  0 System.err
49    .println("Ensembl is DOWN or unreachable ******************* BAD!");
50    }
51    }
52   
 
53  0 toggle @BeforeMethod(alwaysRun = true)
54    protected void setUp()
55    {
56  0 sf = new EnsemblRestClient()
57    {
58   
 
59  0 toggle @Override
60    public String getDbName()
61    {
62  0 return null;
63    }
64   
 
65  0 toggle @Override
66    public AlignmentI getSequenceRecords(String queries) throws Exception
67    {
68  0 return null;
69    }
70   
 
71  0 toggle @Override
72    protected URL getUrl(List<String> ids) throws MalformedURLException
73    {
74  0 return null;
75    }
76   
 
77  0 toggle @Override
78    protected boolean useGetRequest()
79    {
80  0 return false;
81    }
82   
 
83  0 toggle @Override
84    protected String getRequestMimeType(boolean b)
85    {
86  0 return null;
87    }
88   
 
89  0 toggle @Override
90    protected String getResponseMimeType()
91    {
92  0 return null;
93    }
94   
95    };
96    }
97   
 
98  0 toggle @Test(groups = "Network")
99    public void testCheckEnsembl_overload()
100    {
101  0 for (int i = 0; i < 20; i++)
102    {
103  0 assertTrue(sf.checkEnsembl(), "Error on " + (i + 1) + "th ping");
104    }
105    }
106    }