Skip to content

Commit

Permalink
#319 - append all tests in hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoltz committed Mar 21, 2018
1 parent f83a1cd commit 151cada
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -189,7 +189,7 @@ private void getSubtestResult( Model model, NodeList testcallList, NodeList logL
addTestRequirements( model, testInfo );
}

processTestResults( model, logElements, logList, conformanceClass );
processTestResults( model, logElements, logList, conformanceClass, null );

Resource testReq = model.createResource( conformanceClass );
testReq.addLiteral( CITE.testsPassed, new Integer( this.cPassCount ) );
Expand Down Expand Up @@ -295,7 +295,8 @@ private void addTestRequirements( Model earl, TestInfo testInfo ) {
/*
* Process child tests of Conformance Class and call same method recursively if it has the child tests.
*/
private void processTestResults( Model earl, Element logElement, NodeList logList, String conformanceClass )
private void processTestResults( Model earl, Element logElement, NodeList logList, String conformanceClass,
Resource parentTestCase )
throws UnsupportedEncodingException {
NodeList childtestcallList = logElement.getElementsByTagName( "testcall" );

Expand Down Expand Up @@ -332,13 +333,12 @@ private void processTestResults( Model earl, Element logElement, NodeList logLis
testCase.addProperty( DCTerms.title, testName );
testCase.addProperty( DCTerms.description, testDetails.assertion );
assertion.addProperty( EARL.test, testCase );
earl.createResource( conformanceClass ).addProperty( DCTerms.hasPart, testCase );

NodeList testcallLists = childtestcallElement.getElementsByTagName( "testcall" );

if ( testcallLists.getLength() > 0 ) {
processTestResults( earl, childtestcallElement, logList, conformanceClass );
}

if ( parentTestCase != null )
parentTestCase.addProperty( DCTerms.hasPart, testCase );
else
earl.createResource( conformanceClass ).addProperty( DCTerms.hasPart, testCase );
processTestResults( earl, childlogElement, logList, conformanceClass, testCase );
}
}

Expand Down

0 comments on commit 151cada

Please sign in to comment.