JAL-2079 test for Pfam and Rfam sources to validate that seed and full sources return...
authorJim Procter <jprocter@issues.jalview.org>
Tue, 26 Apr 2016 15:52:12 +0000 (16:52 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 26 Apr 2016 15:52:12 +0000 (16:52 +0100)
test/jalview/ws/dbsources/XfamFetcherTest.java [new file with mode: 0644]

diff --git a/test/jalview/ws/dbsources/XfamFetcherTest.java b/test/jalview/ws/dbsources/XfamFetcherTest.java
new file mode 100644 (file)
index 0000000..ab625c4
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
+ * Copyright (C) 2016 The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.ws.dbsources;
+
+import jalview.datamodel.AlignmentI;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class XfamFetcherTest
+{
+  @Test(groups = { "network" })
+  public void testRfamFullAndSeed() throws Exception
+  {
+    RfamFull rff = new RfamFull();
+    RfamSeed rfseed = new RfamSeed();
+
+    AlignmentI fullrf = rff.getSequenceRecords(rff.getTestQuery());
+    Assert.assertNotNull(fullrf, "Full Alignment for " + rff.getTestQuery()
+            + " didn't retrieve.");
+    Assert.assertTrue(fullrf.getHeight() > 1,
+            "Full Alignment for " + rff.getTestQuery()
+                    + " didn't have more than one sequence.");
+    AlignmentI seedrf = rfseed.getSequenceRecords(rff.getTestQuery());
+    Assert.assertNotNull(seedrf, "Seed Alignment for " + rff.getTestQuery()
+            + " didn't retrieve.");
+
+    Assert.assertTrue(seedrf.getHeight() < fullrf.getHeight(),
+            "Expected Full alignment to have more sequences than seed for "
+                    + rff.getTestQuery());
+  }
+
+  @Test(groups = { "network" })
+  public void testPfamFullAndSeed() throws Exception
+  {
+    PfamFull pff = new PfamFull();
+    PfamSeed pfseed = new PfamSeed();
+
+    AlignmentI fullpf = pff.getSequenceRecords(pff.getTestQuery());
+    Assert.assertNotNull(fullpf, "Full Alignment for " + pff.getTestQuery()
+            + " didn't retrieve.");
+    Assert.assertTrue(fullpf.getHeight() > 1,
+            "Full Alignment for " + pff.getTestQuery()
+                    + " didn't have more than one sequence.");
+    AlignmentI seedpf = pfseed.getSequenceRecords(pff.getTestQuery());
+    Assert.assertNotNull(seedpf, "Seed Alignment for " + pff.getTestQuery()
+            + " didn't retrieve.");
+
+    Assert.assertTrue(seedpf.getHeight() < fullpf.getHeight(),
+            "Expected Full alignment to have more sequences than seed for "
+                    + pff.getTestQuery());
+  }
+}