From: Jim Procter Date: Wed, 8 Sep 2021 11:37:00 +0000 (+0100) Subject: JAL-3829 formatting X-Git-Tag: Release_2_11_2_0~39^2~14 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6a346718778d27d70b74a90f573ca5a1d3e32cc8;p=jalview.git JAL-3829 formatting --- diff --git a/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java b/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java index fbf8539..91a3049 100644 --- a/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java +++ b/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java @@ -34,7 +34,7 @@ public class TDBeaconsFTSRestClientTest JvOptionPane.setInteractiveMode(false); JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); } - + private FTSRestClient ftsRestClient; @BeforeMethod(alwaysRun = true) @@ -62,20 +62,22 @@ public class TDBeaconsFTSRestClientTest public void tearDown() throws Exception { } - + @Test public void getAllDefaulDisplayedDataColumns() - { + { // to change when resources.tdbeacons_data_columns.txt is changed - Assert.assertNotNull(ftsRestClient - .getAllDefaultDisplayedFTSDataColumns()); - System.out.println(ftsRestClient.getAllDefaultDisplayedFTSDataColumns()); + Assert.assertNotNull( + ftsRestClient.getAllDefaultDisplayedFTSDataColumns()); + System.out + .println(ftsRestClient.getAllDefaultDisplayedFTSDataColumns()); Assert.assertTrue(!ftsRestClient.getAllDefaultDisplayedFTSDataColumns() .isEmpty()); - Assert.assertEquals(ftsRestClient - .getAllDefaultDisplayedFTSDataColumns().size(), 11); + Assert.assertEquals( + ftsRestClient.getAllDefaultDisplayedFTSDataColumns().size(), + 11); } - + @Test(groups = { "Functional" }) public void getPrimaryKeyColumIndexTest() { @@ -88,8 +90,8 @@ public class TDBeaconsFTSRestClientTest foundIndex = ftsRestClient.getPrimaryKeyColumIndex(wantedFields, false); Assert.assertEquals(foundIndex, 10); - foundIndex = ftsRestClient - .getPrimaryKeyColumIndex(wantedFields, true); + foundIndex = ftsRestClient.getPrimaryKeyColumIndex(wantedFields, + true); Assert.assertEquals(foundIndex, 11); } catch (Exception e) { @@ -97,7 +99,7 @@ public class TDBeaconsFTSRestClientTest Assert.fail("Exception thrown while testing..."); } } - + @Test(groups = { "Functional" }) public void getDataColumnsFieldsAsCommaDelimitedString() { @@ -109,37 +111,37 @@ public class TDBeaconsFTSRestClientTest Assert.assertEquals(actual, "model_identifier,provider,model_category,uniprot_start,uniprot_end,resolution,qmean_avg_local_score,coverage,created,entry_name,model_url"); } - + @Test(groups = { "Functional" }) public void getAllFTSDataColumns() { Collection allFields = ftsRestClient .getAllFTSDataColumns(); Assert.assertNotNull(allFields); - //System.out.println(allFields.size()); + // System.out.println(allFields.size()); Assert.assertEquals(allFields.size(), 15); } - + @Test(groups = { "Functional" }) public void getSearchableDataColumns() - { + { // to change when resources.tdbeacons_data_columns.txt is changed Collection searchableFields = ftsRestClient .getSearchableDataColumns(); Assert.assertNotNull(searchableFields); - //System.out.println(searchableFields.size()); - Assert.assertEquals(searchableFields.size(), 1); //only 1: uniprot accession + // System.out.println(searchableFields.size()); + Assert.assertEquals(searchableFields.size(), 1); // only 1: uniprot + // accession } - + @Test(groups = { "Functional" }) public void getPrimaryKeyColumn() - { + { // to change when resources.tdbeacons_data_columns.txt is changed FTSDataColumnI expectedPKColumn; try { - expectedPKColumn = ftsRestClient - .getDataColumnByNameOrCode("Url"); + expectedPKColumn = ftsRestClient.getDataColumnByNameOrCode("Url"); Assert.assertNotNull(ftsRestClient.getPrimaryKeyColumn()); Assert.assertEquals(ftsRestClient.getPrimaryKeyColumn(), expectedPKColumn); @@ -149,7 +151,7 @@ public class TDBeaconsFTSRestClientTest Assert.fail("Exception thrown while testing..."); } } - + @Test(groups = { "Functional" }) public void getDataColumnByNameOrCode() { @@ -165,7 +167,7 @@ public class TDBeaconsFTSRestClientTest Assert.fail("Exception thrown while testing..."); } } - + @Test(groups = { "Functional" }) public void getDataColumnGroupById() { @@ -180,14 +182,15 @@ public class TDBeaconsFTSRestClientTest e.printStackTrace(); } } - + @Test(groups = { "Functional" }) public void getDefaultResponsePageSize() { int defaultResSize = ftsRestClient.getDefaultResponsePageSize(); - Assert.assertEquals(defaultResSize, 100); //why 100 or 500 ? pdb is 100, uniprot 500 + Assert.assertEquals(defaultResSize, 100); // why 100 or 500 ? pdb is 100, + // uniprot 500 } - + @Test(groups = { "Functional" }) public void getColumnMinWidthTest() { @@ -205,7 +208,7 @@ public class TDBeaconsFTSRestClientTest } } // could add test for MaxWidth & PreferedWith - + @Test(groups = { "Functional" }) public void getColumnClassTest() { @@ -226,7 +229,7 @@ public class TDBeaconsFTSRestClientTest Assert.fail("Exception thrown while testing..."); } } - + @Test(groups = { "Functional" }) public void coverageForEqualsAndHashFunction() { @@ -241,9 +244,9 @@ public class TDBeaconsFTSRestClientTest uniqueSet.add(foundCol); } Assert.assertTrue(!uniqueSet.isEmpty()); - //Assert.assertEquals(uniqueSet.size(), 22); -> 1 or 2 currently for 3DB + // Assert.assertEquals(uniqueSet.size(), 22); -> 1 or 2 currently for 3DB } - + @Test(groups = { "Functional" }) public void getTDBIdColumIndexTest() { @@ -264,8 +267,8 @@ public class TDBeaconsFTSRestClientTest { assertEquals(4, TDBeaconsFTSRestClient.getInstance() .getPrimaryKeyColumIndex(wantedFields, true)); -// assertEquals(3, TDBeaconsFTSRestClient.getInstance() -// .getPrimaryKeyColumIndex(wantedFields, true)); + // assertEquals(3, TDBeaconsFTSRestClient.getInstance() + // .getPrimaryKeyColumIndex(wantedFields, true)); } catch (Exception e) { e.printStackTrace(); @@ -337,25 +340,27 @@ public class TDBeaconsFTSRestClientTest // check 404 behaviour request.setSearchTerm("P00000.json"); + try + { + response = TDBeaconsFTSRestClient.getInstance() + .executeRequest(request); - try { - response = TDBeaconsFTSRestClient.getInstance().executeRequest(request); - assertNull(response); } catch (Exception e) { e.printStackTrace(); Assert.fail("Unexpected failure during mock 3DBeacons 404 test"); } - + // check 200 behaviour request.setSearchTerm("P38398.json"); System.out.println("request : " + request.getFieldToSearchBy()); - //System.out.println(request.toString()); + // System.out.println(request.toString()); try { - response = TDBeaconsFTSRestClient.getInstance().executeRequest(request); + response = TDBeaconsFTSRestClient.getInstance() + .executeRequest(request); } catch (Exception e) { e.printStackTrace(); @@ -363,13 +368,13 @@ public class TDBeaconsFTSRestClientTest return; } assertTrue(response.getSearchSummary() != null); - assertTrue(response.getNumberOfItemsFound() > 3); //4 atm + assertTrue(response.getNumberOfItemsFound() > 3); // 4 atm System.out.println("Search summary : \n" + response.getSearchSummary()); - - //System.out.println(response.getSearchSummary().size()); + + // System.out.println(response.getSearchSummary().size()); } - @Test(groups = { "External", "Network" }) + @Test(groups = { "External", "Network" }) public void executeRequestTest() { List wantedFields = new ArrayList(); @@ -401,12 +406,13 @@ public class TDBeaconsFTSRestClientTest request.setSearchTerm("P01318.json"); request.setWantedFields(wantedFields); System.out.println("request : " + request.getFieldToSearchBy()); - //System.out.println(request.toString()); + // System.out.println(request.toString()); FTSRestResponse response; try { - response = TDBeaconsFTSRestClient.getInstance().executeRequest(request); + response = TDBeaconsFTSRestClient.getInstance() + .executeRequest(request); } catch (Exception e) { e.printStackTrace(); @@ -414,8 +420,8 @@ public class TDBeaconsFTSRestClientTest return; } assertTrue(response.getSearchSummary() != null); - assertTrue(response.getNumberOfItemsFound() > 3); //4 atm + assertTrue(response.getNumberOfItemsFound() > 3); // 4 atm System.out.println("Search summary : \n" + response.getSearchSummary()); - //System.out.println(response.getSearchSummary().size()); + // System.out.println(response.getSearchSummary().size()); } }