X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2Fdbsources%2FPDBRestClientTest.java;h=f92a32ef90bba273279a43f3b339b54fdbf2ce97;hb=3412b273e964fb1a9d22564b04a5f0c827ec2461;hp=a97f3e0e89439172771d267eca6faac108ea03c1;hpb=4bba61a3c701f83bdcb6707c4d9f17a1f5faaa04;p=jalview.git diff --git a/test/jalview/ws/dbsources/PDBRestClientTest.java b/test/jalview/ws/dbsources/PDBRestClientTest.java index a97f3e0..f92a32e 100644 --- a/test/jalview/ws/dbsources/PDBRestClientTest.java +++ b/test/jalview/ws/dbsources/PDBRestClientTest.java @@ -1,8 +1,11 @@ package jalview.ws.dbsources; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertTrue; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; +import org.testng.annotations.BeforeMethod; +import org.testng.Assert; import jalview.ws.dbsources.PDBRestClient.PDBDocField; import jalview.ws.uimodel.PDBRestRequest; import jalview.ws.uimodel.PDBRestResponse; @@ -20,10 +23,6 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; @@ -33,12 +32,12 @@ import com.sun.jersey.api.client.config.DefaultClientConfig; public class PDBRestClientTest { - @Before + @BeforeMethod public void setUp() throws Exception { } - @After + @AfterMethod public void tearDown() throws Exception { } @@ -67,7 +66,7 @@ public class PDBRestClientTest } catch (Exception e) { e.printStackTrace(); - fail("Couldn't execute webservice call!"); + Assert.fail("Couldn't execute webservice call!"); return; } assertTrue(response.getNumberOfItemsFound() > 99); @@ -130,7 +129,7 @@ public class PDBRestClientTest assertEquals(expectedErrorMsg, parsedErrorResponse); } - @Test(expected = Exception.class) + @Test(expectedExceptions = Exception.class) public void testForExpectedRuntimeException() throws Exception { List wantedFields = new ArrayList(); @@ -207,7 +206,7 @@ public class PDBRestClientTest // Check the response status and report exception if one occurs if (clientResponse.getStatus() != 200) { - fail("Webservice call failed!!!"); + Assert.fail("Webservice call failed!!!"); } else { @@ -248,7 +247,7 @@ public class PDBRestClientTest } } catch (ParseException e) { - fail(">>> Test failed due to exception while parsing pdb response json !!!"); + Assert.fail(">>> Test failed due to exception while parsing pdb response json !!!"); e.printStackTrace(); } }