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
JFrame fix for Window->JComponent
[jalview.git]
/
test
/
jalview
/
fts
/
service
/
pdb
/
PDBFTSRestClientTest.java
diff --git
a/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java
b/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java
index
ebc0405
..
bbd45aa
100644
(file)
--- a/
test/jalview/fts/service/pdb/PDBFTSRestClientTest.java
+++ b/
test/jalview/fts/service/pdb/PDBFTSRestClientTest.java
@@
-26,6
+26,7
@@
import static org.testng.AssertJUnit.assertTrue;
import jalview.fts.api.FTSDataColumnI;
import jalview.fts.core.FTSRestRequest;
import jalview.fts.core.FTSRestResponse;
import jalview.fts.api.FTSDataColumnI;
import jalview.fts.core.FTSRestRequest;
import jalview.fts.core.FTSRestResponse;
+import jalview.gui.JvOptionPane;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.FileReader;
@@
-42,6
+43,7
@@
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.json.simple.parser.ParseException;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@
-54,12
+56,19
@@
import com.sun.jersey.api.client.config.DefaultClientConfig;
public class PDBFTSRestClientTest
{
public class PDBFTSRestClientTest
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
{
}
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
{
}
- @AfterMethod
+ @AfterMethod(alwaysRun = true)
public void tearDown() throws Exception
{
}
public void tearDown() throws Exception
{
}
@@
-72,13
+81,11
@@
public class PDBFTSRestClientTest
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
@@
-117,13
+124,11
@@
public class PDBFTSRestClientTest
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
@@
-147,13
+152,11
@@
public class PDBFTSRestClientTest
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
@@
-190,9
+193,7
@@
public class PDBFTSRestClientTest
assertEquals(expectedErrorMsg, parsedErrorResponse);
}
assertEquals(expectedErrorMsg, parsedErrorResponse);
}
- @Test(
- groups = { "External" },
- expectedExceptions = Exception.class)
+ @Test(groups = { "External" }, expectedExceptions = Exception.class)
public void testForExpectedRuntimeException() throws Exception
{
List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
public void testForExpectedRuntimeException() throws Exception
{
List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
@@
-206,7
+207,7
@@
public class PDBFTSRestClientTest
PDBFTSRestClient.getInstance().executeRequest(request);
}
PDBFTSRestClient.getInstance().executeRequest(request);
}
- // JBP: Is this actually external ? Looks like it is mocked
+ // JBP: Is this actually external ? Looks like it is mocked
@Test(groups = { "External" })
public void parsePDBJsonResponseTest()
{
@Test(groups = { "External" })
public void parsePDBJsonResponseTest()
{
@@
-215,13
+216,11
@@
public class PDBFTSRestClientTest
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
{
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("molecule_type"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
.getDataColumnByNameOrCode("pdb_id"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
@@
-259,13
+258,11
@@
public class PDBFTSRestClientTest
.getDataColumnByNameOrCode("molecule_type"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
.getDataColumnByNameOrCode("molecule_type"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("genus"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
.getDataColumnByNameOrCode("gene_name"));
wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("title"));
- wantedFields
-.add(PDBFTSRestClient.getInstance()
+ wantedFields.add(PDBFTSRestClient.getInstance()
.getDataColumnByNameOrCode("pdb_id"));
} catch (Exception e)
{
.getDataColumnByNameOrCode("pdb_id"));
} catch (Exception e)
{
@@
-273,11
+270,9
@@
public class PDBFTSRestClientTest
}
try
{
}
try
{
- assertEquals(5,
- PDBFTSRestClient.getInstance()
+ assertEquals(5, PDBFTSRestClient.getInstance()
.getPrimaryKeyColumIndex(wantedFields, true));
.getPrimaryKeyColumIndex(wantedFields, true));
- assertEquals(4,
- PDBFTSRestClient.getInstance()
+ assertEquals(4, PDBFTSRestClient.getInstance()
.getPrimaryKeyColumIndex(wantedFields, false));
} catch (Exception e)
{
.getPrimaryKeyColumIndex(wantedFields, false));
} catch (Exception e)
{