JAL-2084 JAL-2079 removed RFAM(Full) from Xfam Network tests
[jalview.git] / test / jalview / ws / dbsources / XfamFetcherTest.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
3  * Copyright (C) 2016 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.ws.dbsources;
22
23 import jalview.datamodel.AlignmentI;
24
25 import org.testng.Assert;
26 import org.testng.annotations.Test;
27
28 public class XfamFetcherTest
29 {
30   @Test(groups = { "network" })
31   public void testRfamSeed() throws Exception
32   {
33     // RfamFull rff = new RfamFull();
34     RfamSeed rfs = new RfamSeed();
35
36     AlignmentI seedrf = rfs.getSequenceRecords(rfs.getTestQuery());
37     Assert.assertNotNull(seedrf, "Seed Alignment for " + rfs.getTestQuery()
38             + " didn't retrieve.");
39     Assert.assertTrue(seedrf.getHeight() > 1,
40             "Seed Alignment for " + rfs.getTestQuery()
41                     + " didn't contain more than one sequence.");
42   }
43
44   @Test(groups = { "network" })
45   public void testPfamFullAndSeed() throws Exception
46   {
47     PfamFull pff = new PfamFull();
48     PfamSeed pfseed = new PfamSeed();
49
50     AlignmentI fullpf = pff.getSequenceRecords(pff.getTestQuery());
51     Assert.assertNotNull(fullpf, "Full Alignment for " + pff.getTestQuery()
52             + " didn't retrieve.");
53     Assert.assertTrue(fullpf.getHeight() > 1,
54             "Full Alignment for " + pff.getTestQuery()
55                     + " didn't have more than one sequence.");
56     AlignmentI seedpf = pfseed.getSequenceRecords(pff.getTestQuery());
57     Assert.assertNotNull(seedpf, "Seed Alignment for " + pff.getTestQuery()
58             + " didn't retrieve.");
59
60     Assert.assertTrue(seedpf.getHeight() < fullpf.getHeight(),
61             "Expected Full alignment to have more sequences than seed for "
62                     + pff.getTestQuery());
63   }
64 }