JAL-1705 test that the regex correctly processes ENSEMBL test IDs
authorJim Procter <jprocter@issues.jalview.org>
Sun, 28 Jun 2015 16:21:31 +0000 (17:21 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Sun, 28 Jun 2015 16:21:31 +0000 (17:21 +0100)
test/jalview/ext/ensembl/EnsemblSeqProxyTest.java

index 7e8745e..b456919 100644 (file)
@@ -155,4 +155,31 @@ public class EnsemblSeqProxyTest
 
     }
   }
+
+  @Test(dataProvider = "ens_seqs")
+  public void testRegexForProxy(EnsemblSeqType type, String sq,
+          String fastasq) throws Exception
+  {
+    EnsemblSeqProxy esq = new EnsemblProtein();
+    Assert.assertTrue(esq.isValidReference(sq),
+            "Expected reference string " + sq + " to be valid for regex "
+                    + esq.getAccessionValidator().toString());
+    
+    Assert.assertEquals(sq, DBRefUtils.processQueryToAccessionFor(esq, sq),
+            "Regex for " + esq.getClass().toString() + " not correct.");
+  }
+  // @Test(dataProvider = "ens_seqs", suiteName = "live")
+  // public void testGetOneSeqs(EnsemblSeqType type, String sq, String fastasq)
+  // throws Exception
+  // {
+  //
+  // {
+  // Assert.assertTrue(rseq[0].getDBRef() != null
+  // && rseq[0].getDBRef().length > 0,
+  // "No database references added to sequence by fetcher.");
+  // Assert.assertNotNull(DBRefUtils.searchRefs(rseq[0].getDBRef(),
+  // new DBRefEntry("ENSEMBL", null, sq)),
+  // "Could't find database references added to sequence by fetcher.");
+  //
+  // }
 }
\ No newline at end of file