From 9238f37da75fca644d970371f6b8e99144070bce Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sun, 28 Jun 2015 17:21:31 +0100 Subject: [PATCH] JAL-1705 test that the regex correctly processes ENSEMBL test IDs --- test/jalview/ext/ensembl/EnsemblSeqProxyTest.java | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java b/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java index 7e8745e..b456919 100644 --- a/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java +++ b/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java @@ -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 -- 1.7.10.2