JAL-1700 Improved the error handling mechanism for the PDB Rest client
[jalview.git] / test / jalview / ws / dbsources / PDBRestClientTest.java
index 86cb3a3..a97f3e0 100644 (file)
@@ -60,7 +60,16 @@ public class PDBRestClientTest
     request.setSearchTerm("abc");
     request.setWantedFields(wantedFields);
 
-    PDBRestResponse response = new PDBRestClient().executeRequest(request);
+    PDBRestResponse response;
+    try
+    {
+      response = new PDBRestClient().executeRequest(request);
+    } catch (Exception e)
+    {
+      e.printStackTrace();
+      fail("Couldn't execute webservice call!");
+      return;
+    }
     assertTrue(response.getNumberOfItemsFound() > 99);
     assertTrue(response.getSearchSummary() != null);
     assertTrue(response.getSearchSummary().size() > 99);
@@ -121,8 +130,8 @@ public class PDBRestClientTest
     assertEquals(expectedErrorMsg, parsedErrorResponse);
   }
 
-  @Test(expected = RuntimeException.class)
-  public void testForExpectedRuntimeException()
+  @Test(expected = Exception.class)
+  public void testForExpectedRuntimeException() throws Exception
   {
     List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
     wantedFields.add(PDBDocField.PDB_ID);