JAL-1894 update year/version in copyright
[jalview.git] / test / jalview / ws / dbsources / PDBRestClientTest.java
index 00c1e02..679cfe4 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1)
+ * Copyright (C) 2015 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.ws.dbsources;
 
 import static org.testng.AssertJUnit.assertEquals;
@@ -34,7 +54,7 @@ import com.sun.jersey.api.client.config.DefaultClientConfig;
 public class PDBRestClientTest
 {
 
-  @BeforeMethod
+  @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
   }
@@ -44,8 +64,7 @@ public class PDBRestClientTest
   {
   }
 
-  @Test(groups =
-  { "External" })
+  @Test(groups = { "External", "Network" })
   public void executeRequestTest()
   {
     List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
@@ -77,7 +96,7 @@ public class PDBRestClientTest
     assertTrue(response.getSearchSummary().size() > 99);
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void getPDBDocFieldsAsCommaDelimitedStringTest()
   {
     List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
@@ -94,8 +113,7 @@ public class PDBRestClientTest
     assertEquals("", expectedResult, actualResult);
   }
 
-  @Test(groups =
-  { "External" })
+  @Test(groups = { "External, Network" })
   public void parsePDBJsonExceptionStringTest()
   {
     List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
@@ -133,8 +151,9 @@ public class PDBRestClientTest
     assertEquals(expectedErrorMsg, parsedErrorResponse);
   }
 
-  @Test(groups =
-  { "External" }, expectedExceptions = Exception.class)
+  @Test(
+    groups = { "External", "Network" },
+    expectedExceptions = Exception.class)
   public void testForExpectedRuntimeException() throws Exception
   {
     List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
@@ -147,8 +166,7 @@ public class PDBRestClientTest
     new PDBRestClient().executeRequest(request);
   }
 
-  @Test(groups =
-  { "External" })
+  @Test(groups = { "External" })
   public void parsePDBJsonResponseTest()
   {
     List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
@@ -177,7 +195,7 @@ public class PDBRestClientTest
     assertTrue(response.getSearchSummary().size() == 14);
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void getPDBIdColumIndexTest()
   {
     List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
@@ -190,8 +208,7 @@ public class PDBRestClientTest
     assertEquals(4, PDBRestClient.getPDBIdColumIndex(wantedFields, false));
   }
 
-  @Test(groups =
-  { "External" })
+  @Test(groups = { "External" })
   public void externalServiceIntegrationTest()
   {
     ClientConfig clientConfig = new DefaultClientConfig();
@@ -247,7 +264,7 @@ public class PDBRestClientTest
           if (pdbJsonDoc.get(field.getCode()) == null)
           {
             // System.out.println(">>>\t" + field.getCode());
-            assertTrue(field.getClass()
+            assertTrue(field.getCode()
                     + " has been removed from PDB doc Entity",
                     !pdbJsonResponseString.contains(field.getCode()));
           }
@@ -274,7 +291,7 @@ public class PDBRestClientTest
         sb.append(line);
         sb.append(System.lineSeparator());
         line = br.readLine();
-        }
+      }
       fileContent = sb.toString();
     } finally
     {