1 package jalview.fts.threedbeacons;
3 import static org.testng.AssertJUnit.assertTrue;
5 import java.util.ArrayList;
8 import org.testng.Assert;
9 import org.testng.annotations.AfterMethod;
10 import org.testng.annotations.BeforeClass;
11 import org.testng.annotations.BeforeMethod;
12 import org.testng.annotations.Test;
14 import jalview.fts.api.FTSDataColumnI;
15 import jalview.fts.core.FTSRestRequest;
16 import jalview.fts.core.FTSRestResponse;
17 import jalview.fts.service.threedbeacons.TDBeaconsFTSRestClient;
18 import jalview.gui.JvOptionPane;
20 public class TDBeaconsFTSRestClientTest
22 @BeforeClass(alwaysRun = true)
23 public void setUpJvOptionPane()
25 JvOptionPane.setInteractiveMode(false);
26 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
29 @BeforeMethod(alwaysRun = true)
30 public void setUp() throws Exception
34 @AfterMethod(alwaysRun = true)
35 public void tearDown() throws Exception
39 @Test(groups = { "External", "Network" })
41 public void executeRequestTest()
43 List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
46 wantedFields.add(TDBeaconsFTSRestClient.getInstance()
47 .getDataColumnByNameOrCode("uniprot_entry"));
48 } catch (Exception e1)
52 System.out.println(wantedFields);
54 FTSRestRequest request = new FTSRestRequest();
55 //request.setAllowEmptySeq(false);
56 //request.setResponseSize(100);
57 request.setSearchTerm("01308.json");
58 //request.setWantedFields(wantedFields);
59 System.out.println(request.toString());
61 FTSRestResponse response;
64 response = TDBeaconsFTSRestClient.getInstance().executeRequest(request);
68 Assert.fail("Couldn't execute webservice call!");
71 //assertTrue(response.getNumberOfItemsFound() > 99);
72 assertTrue(response.getSearchSummary() != null);
73 assertTrue(response.getSearchSummary().size() > 99);