From e5b16d1a0238386bd01a7cc624d4f65ff7ed2cfd Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Thu, 26 Mar 2015 12:49:15 +0000 Subject: [PATCH] Updated BioJsHTMLOutputTest asserts to include error messages for failed Assertions --- test/jalview/io/BioJsHTMLOutputTest.java | 36 ++++++++++++++++++------------ 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/test/jalview/io/BioJsHTMLOutputTest.java b/test/jalview/io/BioJsHTMLOutputTest.java index 694419f..514cce0 100644 --- a/test/jalview/io/BioJsHTMLOutputTest.java +++ b/test/jalview/io/BioJsHTMLOutputTest.java @@ -43,7 +43,7 @@ public class BioJsHTMLOutputTest JSONObject actualJsonObj = (JSONObject) jsonParser.parse(actualJsonString); - System.out.println("Output : " + actualJsonString); + // System.out.println("Output : " + actualJsonString); Assert.assertTrue(actualJsonObj.get("globalColorScheme") != null); Assert.assertTrue((actualJsonObj.get("globalColorScheme").toString()).equals("zappo")); @@ -60,26 +60,34 @@ public class BioJsHTMLOutputTest JSONObject jsonSeq = jsonIter.next(); Assert.assertTrue(jsonSeq != null); - Assert.assertTrue(jsonSeq.get("name") != null); - Assert.assertTrue((jsonSeq.get("name").toString()) + Assert.assertTrue("'name' cannot be null!", + jsonSeq.get("name") != null); + Assert.assertTrue("Expected name mismatched!", + (jsonSeq.get("name").toString()) .equals("name/1-26")); - Assert.assertTrue(jsonSeq.get("seq") != null); - Assert.assertTrue((jsonSeq.get("seq").toString()) + Assert.assertTrue("'seq' cannot be null!", jsonSeq.get("seq") != null); + Assert.assertTrue("Expected sequence mismatched!", (jsonSeq + .get("seq").toString()) .equals("ABCDEFGHIJKLMNOPQRSTUVWXYZ")); - Assert.assertTrue(jsonSeq.get("id") != null); - Assert.assertTrue((jsonSeq.get("id").toString()).equals("1")); + Assert.assertTrue("'id' cannot be null!", jsonSeq.get("id") != null); + Assert.assertTrue("Expected id mismatched!", + (jsonSeq.get("id").toString()).equals("1")); - Assert.assertTrue(jsonSeq.get("start") != null); - Assert.assertTrue((jsonSeq.get("start").toString()).equals("1")); + Assert.assertTrue("'start' cannot be null!", + jsonSeq.get("start") != null); + Assert.assertTrue("Expected start mismatched!", + (jsonSeq.get("start").toString()).equals("1")); - Assert.assertTrue(jsonSeq.get("end") != null); - Assert.assertTrue((jsonSeq.get("end").toString()).equals("26")); - - Assert.assertTrue(jsonSeq.get("features") != null); - Assert.assertTrue(jsonSeq.get("features").toString().equals("[]")); + Assert.assertTrue("'end' cannot be null!", jsonSeq.get("end") != null); + Assert.assertTrue("Expected end mismatched!", + (jsonSeq.get("end").toString()).equals("26")); + Assert.assertTrue("'features' cannot be null!", + jsonSeq.get("features") != null); + Assert.assertTrue("Expected features mismatched!", + jsonSeq.get("features").toString().equals("[]")); } catch (IOException e) { -- 1.7.10.2