JAL-2189 apply license
[jalview.git] / test / jalview / fts / core / FTSRestClientTest.java
index 0dac04b..b751b77 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.fts.core;
 
 import jalview.fts.api.FTSDataColumnI;
@@ -40,7 +60,7 @@ public class FTSRestClientTest
   public void getPrimaryKeyColumIndexTest()
   {
     Collection<FTSDataColumnI> wantedFields = ftsRestClient
-            .getAllDefaulDisplayedDataColumns();
+            .getAllDefaultDisplayedFTSDataColumns();
     int foundIndex = -1;
     try
     {
@@ -61,25 +81,25 @@ public class FTSRestClientTest
   @Test(groups = { "Functional" })
   public void getAllDefaulDisplayedDataColumns()
   {
-    Assert.assertNotNull(ftsRestClient.getAllDefaulDisplayedDataColumns());
-    Assert.assertTrue(!ftsRestClient.getAllDefaulDisplayedDataColumns()
+    Assert.assertNotNull(ftsRestClient
+            .getAllDefaultDisplayedFTSDataColumns());
+    Assert.assertTrue(!ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
             .isEmpty());
-    Assert.assertEquals(ftsRestClient.getAllDefaulDisplayedDataColumns()
-            .size(), 7);
+    Assert.assertEquals(ftsRestClient
+            .getAllDefaultDisplayedFTSDataColumns().size(), 7);
   }
 
   @Test(groups = { "Functional" })
   public void getDataColumnsFieldsAsCommaDelimitedString()
   {
     Collection<FTSDataColumnI> wantedFields = ftsRestClient
-            .getAllDefaulDisplayedDataColumns();
+            .getAllDefaultDisplayedFTSDataColumns();
     String actual = ftsRestClient
             .getDataColumnsFieldsAsCommaDelimitedString(wantedFields);
     Assert.assertEquals(actual,
-            "id,entry name,protein names,genes,organism,length,reviewed");
+            "id,entry name,protein names,genes,organism,reviewed,length");
   }
 
-
   @Test(groups = { "Functional" })
   public void getAllFTSDataColumns()
   {
@@ -95,7 +115,7 @@ public class FTSRestClientTest
     Collection<FTSDataColumnI> searchalbeFields = ftsRestClient
             .getSearchableDataColumns();
     Assert.assertNotNull(searchalbeFields);
-    Assert.assertEquals(searchalbeFields.size(), 30);
+    Assert.assertEquals(searchalbeFields.size(), 22);
   }
 
   @Test(groups = { "Functional" })
@@ -151,7 +171,7 @@ public class FTSRestClientTest
   public void getDefaultResponsePageSize()
   {
     int defaultResSize = ftsRestClient.getDefaultResponsePageSize();
-    Assert.assertEquals(defaultResSize, 100);
+    Assert.assertEquals(defaultResSize, 500);
   }
 
   @Test(groups = { "Functional" })
@@ -213,10 +233,12 @@ public class FTSRestClientTest
       FTSDataColumnI foundDataCol = ftsRestClient
               .getDataColumnByNameOrCode("Protein names");
       Assert.assertNotNull(foundDataCol);
-      Assert.assertEquals(foundDataCol.getDataColumnClass(), String.class);
+      Assert.assertEquals(foundDataCol.getDataType().getDataTypeClass(),
+              String.class);
       foundDataCol = ftsRestClient.getDataColumnByNameOrCode("length");
       Assert.assertNotNull(foundDataCol);
-      Assert.assertEquals(foundDataCol.getDataColumnClass(), Integer.class);
+      Assert.assertEquals(foundDataCol.getDataType().getDataTypeClass(),
+              Integer.class);
       // foundDataCol = ftsRestClient.getDataColumnByNameOrCode("length");
       // Assert.assertNotNull(foundDataCol);
       // Assert.assertEquals(foundDataCol.getDataColumnClass(), Double.class);
@@ -235,11 +257,12 @@ public class FTSRestClientTest
             .getSearchableDataColumns();
     for (FTSDataColumnI foundCol : searchableCols)
     {
+      System.out.println(foundCol.toString());
       uniqueSet.add(foundCol);
       uniqueSet.add(foundCol);
     }
     Assert.assertTrue(!uniqueSet.isEmpty());
-    Assert.assertEquals(uniqueSet.size(), 30);
+    Assert.assertEquals(uniqueSet.size(), 22);
   }
 
   @Test(groups = { "Functional" })