From: gmungoc Date: Thu, 8 Mar 2018 14:05:51 +0000 (+0000) Subject: JAL-2885 tests updated for code changes X-Git-Tag: Release_2_10_4~47 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b41bffc6a21d067bc272c1447c2f393dcf1118cf;p=jalview.git JAL-2885 tests updated for code changes --- diff --git a/src/jalview/ws/dbsources/Pfam.java b/src/jalview/ws/dbsources/Pfam.java index 62e59c9..8877c34 100644 --- a/src/jalview/ws/dbsources/Pfam.java +++ b/src/jalview/ws/dbsources/Pfam.java @@ -35,7 +35,7 @@ import com.stevesoft.pat.Regex; */ abstract public class Pfam extends Xfam { - private static final String PFAM_BASEURL_KEY = "PFAM_BASEURL"; + static final String PFAM_BASEURL_KEY = "PFAM_BASEURL"; private static final String DEFAULT_PFAM_BASEURL = "https://pfam.xfam.org"; diff --git a/src/jalview/ws/dbsources/Rfam.java b/src/jalview/ws/dbsources/Rfam.java index 51edb05..1d9d99a 100644 --- a/src/jalview/ws/dbsources/Rfam.java +++ b/src/jalview/ws/dbsources/Rfam.java @@ -32,7 +32,7 @@ import com.stevesoft.pat.Regex; */ abstract public class Rfam extends Xfam { - private static final String RFAM_BASEURL_KEY = "RFAM_BASEURL"; + static final String RFAM_BASEURL_KEY = "RFAM_BASEURL"; private static final String DEFAULT_RFAM_BASEURL = "https://rfam.xfam.org"; diff --git a/test/jalview/ws/dbsources/PfamFullTest.java b/test/jalview/ws/dbsources/PfamFullTest.java index d675fbe..b914a45 100644 --- a/test/jalview/ws/dbsources/PfamFullTest.java +++ b/test/jalview/ws/dbsources/PfamFullTest.java @@ -18,13 +18,15 @@ public class PfamFullTest @Test(groups = "Functional") public void testGetURL() { + String path = "pfam.xfam.org/family/ABC/alignment/full"; + // with default value for domain String url = new PfamFull().getURL(" abc "); - assertEquals(url, "http://pfam.xfam.org/family/ABC/alignment/full"); + assertEquals(url, "https://" + path); // with override in properties - Cache.setProperty("PFAM_DOMAIN", "https://pfam.xfam.org"); + Cache.setProperty(Pfam.PFAM_BASEURL_KEY, "http://pfam.xfam.org"); url = new PfamFull().getURL(" abc "); - assertEquals(url, "https://pfam.xfam.org/family/ABC/alignment/full"); + assertEquals(url, "http://" + path); } } diff --git a/test/jalview/ws/dbsources/PfamSeedTest.java b/test/jalview/ws/dbsources/PfamSeedTest.java index 537c97e..2fa1871 100644 --- a/test/jalview/ws/dbsources/PfamSeedTest.java +++ b/test/jalview/ws/dbsources/PfamSeedTest.java @@ -18,13 +18,15 @@ public class PfamSeedTest @Test(groups = "Functional") public void testGetURL() { + String path = "pfam.xfam.org/family/ABC/alignment/seed"; + // with default value for domain String url = new PfamSeed().getURL(" abc "); - assertEquals(url, "http://pfam.xfam.org/family/ABC/alignment/seed"); + assertEquals(url, "https://" + path); // with override in properties - Cache.setProperty("PFAM_DOMAIN", "https://pfam.xfam.org"); + Cache.setProperty(Pfam.PFAM_BASEURL_KEY, "http://pfam.xfam.org"); url = new PfamSeed().getURL(" abc "); - assertEquals(url, "https://pfam.xfam.org/family/ABC/alignment/seed"); + assertEquals(url, "http://" + path); } } diff --git a/test/jalview/ws/dbsources/RfamFullTest.java b/test/jalview/ws/dbsources/RfamFullTest.java index 344aee6..cb60b14 100644 --- a/test/jalview/ws/dbsources/RfamFullTest.java +++ b/test/jalview/ws/dbsources/RfamFullTest.java @@ -18,13 +18,15 @@ public class RfamFullTest @Test(groups = "Functional") public void testGetURL() { + String path = "rfam.xfam.org/family/ABC/alignment/full"; + // with default value for domain String url = new RfamFull().getURL(" abc "); - assertEquals(url, "http://rfam.xfam.org/family/ABC/alignment/full"); + assertEquals(url, "https://" + path); // with override in properties - Cache.setProperty("RFAM_DOMAIN", "https://rfam.xfam.org"); + Cache.setProperty(Rfam.RFAM_BASEURL_KEY, "http://rfam.xfam.org"); url = new RfamFull().getURL(" abc "); - assertEquals(url, "https://rfam.xfam.org/family/ABC/alignment/full"); + assertEquals(url, "http://" + path); } } diff --git a/test/jalview/ws/dbsources/RfamSeedTest.java b/test/jalview/ws/dbsources/RfamSeedTest.java index e45fff1..5ca72c2 100644 --- a/test/jalview/ws/dbsources/RfamSeedTest.java +++ b/test/jalview/ws/dbsources/RfamSeedTest.java @@ -18,15 +18,15 @@ public class RfamSeedTest @Test(groups = "Functional") public void testGetURL() { + String path = "rfam.xfam.org/family/ABC/alignment/stockholm"; + // with default value for domain String url = new RfamSeed().getURL(" abc "); - assertEquals(url, - "http://rfam.xfam.org/family/ABC/alignment/stockholm"); + assertEquals(url, "https://" + path); // with override in properties - Cache.setProperty("RFAM_DOMAIN", "https://rfam.xfam.org"); + Cache.setProperty(Rfam.RFAM_BASEURL_KEY, "http://rfam.xfam.org"); url = new RfamSeed().getURL(" abc "); - assertEquals(url, - "https://rfam.xfam.org/family/ABC/alignment/stockholm"); + assertEquals(url, "http://" + path); } }