git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-4134 efficiency improvement
[jalview.git]
/
test
/
jalview
/
urls
/
CustomUrlProviderTest.java
diff --git
a/test/jalview/urls/CustomUrlProviderTest.java
b/test/jalview/urls/CustomUrlProviderTest.java
index
853167b
..
58b2731
100644
(file)
--- a/
test/jalview/urls/CustomUrlProviderTest.java
+++ b/
test/jalview/urls/CustomUrlProviderTest.java
@@
-47,13
+47,13
@@
public class CustomUrlProviderTest
private static final HashMap<String, String> urlMap = new HashMap<String, String>()
{
{
private static final HashMap<String, String> urlMap = new HashMap<String, String>()
{
{
- put("TEST","http://someurl.blah/$DB_ACCESSION$");
- put("ANOTHER","http://test/t$SEQUENCE_ID$");
+ put("TEST", "http://someurl.blah/$DB_ACCESSION$");
+ put("ANOTHER", "http://test/t$SEQUENCE_ID$");
put("TEST2", "http://address/$SEQUENCE_ID$");
put("SRS", "http://theSRSlink/$SEQUENCE_ID$");
}
};
put("TEST2", "http://address/$SEQUENCE_ID$");
put("SRS", "http://theSRSlink/$SEQUENCE_ID$");
}
};
-
+
private static final HashMap<String, String> unselUrlMap = new HashMap<String, String>()
{
{
private static final HashMap<String, String> unselUrlMap = new HashMap<String, String>()
{
{
@@
-65,8
+65,7
@@
public class CustomUrlProviderTest
private static final String[] dlinks = {
"TEST|http://someurl.blah/$DB_ACCESSION$",
"ANOTHER|http://test/t$SEQUENCE_ID$",
private static final String[] dlinks = {
"TEST|http://someurl.blah/$DB_ACCESSION$",
"ANOTHER|http://test/t$SEQUENCE_ID$",
- "TEST2|http://address/$SEQUENCE_ID$",
- UrlConstants.DEFAULT_STRING };
+ "TEST2|http://address/$SEQUENCE_ID$", UrlConstants.DEFAULT_STRING };
private static final String[] unselDlinks = {
"NON1|http://x/y/$DB_ACCESSION$", "NON2|http://a/b/c/$DB_ACCESSION" };
private static final String[] unselDlinks = {
"NON1|http://x/y/$DB_ACCESSION$", "NON2|http://a/b/c/$DB_ACCESSION" };
@@
-77,7
+76,8
@@
public class CustomUrlProviderTest
private static final Vector<String> unselDisplayLinks = new Vector<String>(
Arrays.asList(unselDlinks));
private static final Vector<String> unselDisplayLinks = new Vector<String>(
Arrays.asList(unselDlinks));
- private static final String[] dlinks2 = { "a|http://x.y.z/$SEQUENCE_ID$" };
+ private static final String[] dlinks2 = {
+ "a|http://x.y.z/$SEQUENCE_ID$" };
private static final Vector<String> displayLinks2 = new Vector<String>(
Arrays.asList(dlinks2));
private static final Vector<String> displayLinks2 = new Vector<String>(
Arrays.asList(dlinks2));
@@
-100,30
+100,28
@@
public class CustomUrlProviderTest
{
UrlProviderI customProv = new CustomUrlProvider(cachedList,
unselectedList);
{
UrlProviderI customProv = new CustomUrlProvider(cachedList,
unselectedList);
-
+
// default url can be set
// default url can be set
- assertTrue(customProv.setDefaultUrl("ANOTHER"));
+ assertTrue(customProv.setPrimaryUrl("ANOTHER"));
// supplied replacement id must be more than 4 chars
// supplied replacement id must be more than 4 chars
- String result = customProv.getDefaultUrl("123");
+ String result = customProv.getPrimaryUrl("123");
assertEquals(null, result);
// default url can be retrieved given a sequence id
assertEquals(null, result);
// default url can be retrieved given a sequence id
- result = customProv.getDefaultUrl("seqid");
+ result = customProv.getPrimaryUrl("seqid");
assertEquals("http://test/tseqid", result);
// if there is no default url it sets the default to null
assertEquals("http://test/tseqid", result);
// if there is no default url it sets the default to null
- assertFalse(customProv.setDefaultUrl("No default"));
- result = customProv.getDefaultUrl("testid");
+ assertFalse(customProv.setPrimaryUrl("No default"));
+ result = customProv.getPrimaryUrl("testid");
assertEquals(null, result);
assertEquals(null, result);
-
+
// choosing the default picks the DEFAULT_STRING option
// choosing the default picks the DEFAULT_STRING option
- customProv.chooseDefaultUrl();
- result = customProv.getDefaultUrl("seqid");
- assertEquals(
- UrlConstants.DEFAULT_STRING.split("\\|")[1].split("\\$")[0]
- + "seqid",
- result);
+ customProv.choosePrimaryUrl();
+ result = customProv.getPrimaryUrl("seqid");
+ assertEquals(UrlConstants.DEFAULT_STRING.split("\\|")[1].split("\\$")[0]
+ + "seqid", result);
}
/*
}
/*