From 991b3541aaef4c3859ebfa74729a8d538213a11d Mon Sep 17 00:00:00 2001 From: albaizq Date: Tue, 14 Apr 2020 16:05:46 +0200 Subject: [PATCH] distinguish error and failure in the junit report --- .../albafernandez/tests/utils/Converter.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/oeg/albafernandez/tests/utils/Converter.java b/src/main/java/oeg/albafernandez/tests/utils/Converter.java index cf775f6..f18629a 100644 --- a/src/main/java/oeg/albafernandez/tests/utils/Converter.java +++ b/src/main/java/oeg/albafernandez/tests/utils/Converter.java @@ -82,12 +82,15 @@ public static String jsonToJUnitXML(JSONArray jsonArray){ if(obj.getJSONObject(0).has("Ontology")){ ontology = obj.getJSONObject(0).getString("Ontology"); } - if(!result.equalsIgnoreCase("passed")){ + if(result.equalsIgnoreCase("conflict")){ String msg=""; failures++; - if(result.equalsIgnoreCase("conflict")){ - msg="There is an inconsistency between the ontology and the requirement associated to the test\n"; - }else if(result.equalsIgnoreCase("Absent")){ + msg="There is an inconsistency between the ontology and the requirement associated to the test\n"; + testcases+="\t\t\t" + + "\n"; + }else if(result.equalsIgnoreCase("Absent") || result.equalsIgnoreCase("Incorrect") || result.equalsIgnoreCase("Undefined")){ + String msg=""; + if(result.equalsIgnoreCase("Absent")){ msg="A restriction included in the test may be missing in the ontology"; }else if(result.equalsIgnoreCase("Undefined")){ if(obj.getJSONObject(0).has("Undefined")){ @@ -100,9 +103,12 @@ public static String jsonToJUnitXML(JSONArray jsonArray){ }else msg="There are tests in the test that are not defined as in the ontology"; } - testcases+="\t\t\t" + - "\n"; + testcases+="\t\t\t" + + "\n"; + } + + testcases+="\t\t\n"; }