From 5dc8ade14d08c1d63fb2d1b344afa4a1baa3eca5 Mon Sep 17 00:00:00 2001 From: arngucci Date: Mon, 12 Apr 2021 16:05:35 +0200 Subject: [PATCH] JAL-3832 Gui working, with 3DBeacons parameters --- resources/fts/tdbeacons_data_columns.txt | 6 ++--- src/jalview/fts/core/FTSDataColumnPreferences.java | 6 +++-- .../threedbeacons/TDBeaconsFTSRestClientTest.java | 25 +++++++++++--------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/resources/fts/tdbeacons_data_columns.txt b/resources/fts/tdbeacons_data_columns.txt index 31d85c6..350b9e8 100644 --- a/resources/fts/tdbeacons_data_columns.txt +++ b/resources/fts/tdbeacons_data_columns.txt @@ -40,11 +40,11 @@ _data_column.max_col_width _data_column.preferred_col_width _data_column.is_shown_by_default _data_column.is_searchable -Sequence;aligned_sequence;String;g1;80;150;85;true;true Model id;model_identifier;String;g2;80;150;85;true;true +Sequence;aligned_sequence;String;g1;80;150;85;true;true Provider;provider;String;g1;80;150;85;true;true Uniprot Id;id;String;g2;80;150;85;true;true UniProt Accession;uniprot_accession;String;g2;50;400;95;true;false -Entry Name;entry name;String;g2;100;150;105;true;true +Entry Name;entry_name;String;g2;100;150;105;true;true Url;model_url;String;g1;100;150;105;true;true -Qmean;qmean_avg_local_score;double;g3;100;150;105;true;true +Qmean;qmean_avg_local_score;double;g2;100;150;105;true;false diff --git a/src/jalview/fts/core/FTSDataColumnPreferences.java b/src/jalview/fts/core/FTSDataColumnPreferences.java index e5042ae..f865ac3 100644 --- a/src/jalview/fts/core/FTSDataColumnPreferences.java +++ b/src/jalview/fts/core/FTSDataColumnPreferences.java @@ -96,11 +96,12 @@ public class FTSDataColumnPreferences extends JScrollPane break; } - Object[][] data = new Object[allFTSDataColumns.size() - 1][3]; + Object[][] data = new Object[allFTSDataColumns.size()][3]; int x = 0; for (FTSDataColumnI field : allFTSDataColumns) - { + { + //System.out.println("allFTSDataColumns==" + allFTSDataColumns); if (field.getName().equalsIgnoreCase("all")) { continue; @@ -112,6 +113,7 @@ public class FTSDataColumnPreferences extends JScrollPane data[x++] = new Object[] { ftsRestClient .getAllDefaultDisplayedFTSDataColumns().contains(field), field.getName(), field.getGroup() }; + //System.out.println(" PUIS " + field.getName() + " ET AUSSI " + field.getGroup() + "X = " + x); break; case STRUCTURE_CHOOSER: data[x++] = new Object[] { structSummaryColumns.contains(field), diff --git a/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java b/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java index b144aa5..539af37 100644 --- a/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java +++ b/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java @@ -63,15 +63,15 @@ public class TDBeaconsFTSRestClientTest @Test public void getAllDefaulDisplayedDataColumns() - { + { + // to change when resources.tdbeacons_data_columns.txt is changed Assert.assertNotNull(ftsRestClient .getAllDefaultDisplayedFTSDataColumns()); System.out.println(ftsRestClient.getAllDefaultDisplayedFTSDataColumns()); Assert.assertTrue(!ftsRestClient.getAllDefaultDisplayedFTSDataColumns() .isEmpty()); Assert.assertEquals(ftsRestClient - .getAllDefaultDisplayedFTSDataColumns().size(), 3); - // currently 3, may change -> change this test and the nexts accordingly + .getAllDefaultDisplayedFTSDataColumns().size(), 8); } @Test(groups = { "Functional" }) @@ -85,10 +85,10 @@ public class TDBeaconsFTSRestClientTest Assert.assertEquals(foundIndex, -1); foundIndex = ftsRestClient.getPrimaryKeyColumIndex(wantedFields, false); - Assert.assertEquals(foundIndex, 0); + Assert.assertEquals(foundIndex, 1); foundIndex = ftsRestClient .getPrimaryKeyColumIndex(wantedFields, true); - Assert.assertEquals(foundIndex, 1); + Assert.assertEquals(foundIndex, 2); } catch (Exception e) { e.printStackTrace(); @@ -99,12 +99,13 @@ public class TDBeaconsFTSRestClientTest @Test(groups = { "Functional" }) public void getDataColumnsFieldsAsCommaDelimitedString() { + // to change when resources.tdbeacons_data_columns.txt is changed Collection wantedFields = ftsRestClient .getAllDefaultDisplayedFTSDataColumns(); String actual = ftsRestClient .getDataColumnsFieldsAsCommaDelimitedString(wantedFields); Assert.assertEquals(actual, - "id,uniprot_accession,entry name"); + "aligned_sequence,model_identifier,provider,id,uniprot_accession,entry_name,model_url,qmean_avg_local_score"); } @Test(groups = { "Functional" }) @@ -114,27 +115,29 @@ public class TDBeaconsFTSRestClientTest .getAllFTSDataColumns(); Assert.assertNotNull(allFields); //System.out.println(allFields.size()); - Assert.assertEquals(allFields.size(), 3); + Assert.assertEquals(allFields.size(), 8); } @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, as of first 3DB test + Assert.assertEquals(searchableFields.size(), 6); //only 1, as of first 3DB test } @Test(groups = { "Functional" }) public void getPrimaryKeyColumn() - { + { + // to change when resources.tdbeacons_data_columns.txt is changed FTSDataColumnI expectedPKColumn; try { expectedPKColumn = ftsRestClient - .getDataColumnByNameOrCode("Uniprot Id"); + .getDataColumnByNameOrCode("Model id"); Assert.assertNotNull(ftsRestClient.getPrimaryKeyColumn()); Assert.assertEquals(ftsRestClient.getPrimaryKeyColumn(), expectedPKColumn); -- 1.7.10.2