/**
* @param matcher REGEX Matcher.
*/
protected void extractTestResult( Matcher matcher )
{
TestResult testResult = null;
final String okOrNotOk = matcher.group(1);
StatusValues status = null;
if ( okOrNotOk.trim().equals("ok"))
{
status = StatusValues.OK;
}
else // regex mate...
{
status = StatusValues.NOT_OK;
}
Integer testNumber = Integer.parseInt(matcher.group(2));
testResult = new TestResult( status, testNumber );
testResult.setDescription(matcher.group(3));
String directiveToken = matcher.group(4);
if ( directiveToken != null )
{
String directiveText = matcher.group(5);
DirectiveValues directiveValue = null;
if ( directiveText.trim().equals("TODO"))
{
directiveValue = DirectiveValues.TODO;
} else
{
directiveValue = DirectiveValues.SKIP;
}
String reason = matcher.group( 6 );
Directive directive = new Directive( directiveValue, reason );
testResult.setDirective( directive );
}
String commentToken = matcher.group( 7 );
if ( commentToken != null )
{
String text = matcher.group ( 8 );
final Comment comment = new Comment( text );
testResult.setComment( comment );
}
this.testResults.add( testResult );
this.tapLines.add( testResult );
}