org.tap4j.parser
Class Tap13YamlParser

Package class diagram package Tap13YamlParser
java.lang.Object
  extended by org.tap4j.parser.Tap13YamlParser
All Implemented Interfaces:
Parser

public class Tap13YamlParser
extends Object
implements Parser

TAP 13 parser with support to YAML.

Since:
1.0

Field Summary
protected static Pattern INDENTANTION_PATTERN
           
 
Fields inherited from interface org.tap4j.parser.Parser
BAIL_OUT_PATTERN, COMMENT_PATTERN, FOOTER_PATTERN, HEADER_PATTERN, PLAN_PATTERN, REGEX_BAIL_OUT, REGEX_COMMENT, REGEX_FOOTER, REGEX_HEADER, REGEX_PLAN, REGEX_TEST_RESULT, TEST_RESULT_PATTERN
 
Constructor Summary
Tap13YamlParser()
           
 
Method Summary
protected  void checkIfTAPPlanIsSetBeforeTestResultsOrBailOut()
          Checks if the TAP Plan is set before any Test Result or Bail Out.
protected  void checkTAPHeaderParsingLocationAndDuplicity()
          Checks the Header location and duplicity.
protected  void checkTAPPlanDuplicity()
          Checks if there are more than one TAP Plan in the TAP Stream.
protected  void checkTAPPlanIsSet()
          Checks if TAP Plan has been set.
protected  void checkTAPPlanPosition()
          Deprecated.  
protected  void extractBailOut(Matcher matcher)
           
protected  void extractComment(Matcher matcher)
           
protected  void extractFooter(Matcher matcher)
          Simply extracts the footer from the TAP line.
protected  void extractHeader(Matcher matcher)
          Extracts the Header from a TAP Line.
protected  void extractPlan(Matcher matcher)
           
protected  void extractTestResult(Matcher matcher)
           
 TestSet getTestSet()
           
 void init()
          Called from the constructor and everytime a new TAP Stream (file or string) is processed.
protected  boolean isBaseIndentationAlreadyDefined()
           
 TestSet parseFile(File tapFile)
          Parses a TAP File.
 void parseLine(String tapLine)
          Parses a Test Result.
 TestSet parseTapStream(String tapStream)
          Parses a TAP Stream.
protected  void postProcess()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDENTANTION_PATTERN

protected static final Pattern INDENTANTION_PATTERN
Constructor Detail

Tap13YamlParser

public Tap13YamlParser()
Method Detail

init

public final void init()
Called from the constructor and everytime a new TAP Stream (file or string) is processed.


getTestSet

public TestSet getTestSet()

parseLine

public void parseLine(String tapLine)
Description copied from interface: Parser
Parses a Test Result.

Specified by:
parseLine in interface Parser
Parameters:
tapLine - TAP line

checkIfTAPPlanIsSetBeforeTestResultsOrBailOut

protected void checkIfTAPPlanIsSetBeforeTestResultsOrBailOut()
Checks if the TAP Plan is set before any Test Result or Bail Out.


checkTAPHeaderParsingLocationAndDuplicity

protected void checkTAPHeaderParsingLocationAndDuplicity()
Checks the Header location and duplicity. The Header must be the first element and cannot occurs more than on time. However the Header is optional.


checkTAPPlanDuplicity

protected void checkTAPPlanDuplicity()
Checks if there are more than one TAP Plan in the TAP Stream.


checkTAPPlanPosition

protected void checkTAPPlanPosition()
Deprecated. 

This method is called after the TAP Stream has already been parsed. So we just check if the plan was found before test result or bail outs. If so, skip this check. Otherwise, we shall check if the last line is the TAP Plan.


checkTAPPlanIsSet

protected void checkTAPPlanIsSet()
Checks if TAP Plan has been set.

Throws:
ParserException - if TAP Plan has not been set.

extractHeader

protected void extractHeader(Matcher matcher)
Extracts the Header from a TAP Line.

Parameters:
matcher - REGEX Matcher.

extractPlan

protected void extractPlan(Matcher matcher)
Parameters:
matcher - REGEX Matcher.

extractTestResult

protected void extractTestResult(Matcher matcher)
Parameters:
matcher - REGEX Matcher.

extractBailOut

protected void extractBailOut(Matcher matcher)
Parameters:
matcher - REGEX Matcher.

extractComment

protected void extractComment(Matcher matcher)
Parameters:
matcher - REGEX Matcher.

extractFooter

protected void extractFooter(Matcher matcher)
Simply extracts the footer from the TAP line.

Parameters:
matcher - REGEX Matcher.

parseTapStream

public TestSet parseTapStream(String tapStream)
Description copied from interface: Parser
Parses a TAP Stream.

Specified by:
parseTapStream in interface Parser
Parameters:
tapStream - TAP Stream

parseFile

public TestSet parseFile(File tapFile)
Description copied from interface: Parser
Parses a TAP File.

Specified by:
parseFile in interface Parser
Parameters:
tapFile - TAP File

isBaseIndentationAlreadyDefined

protected boolean isBaseIndentationAlreadyDefined()
Returns:
true if the base indentation is already defined, false otherwise.

postProcess

protected void postProcess()


Copyright © 2010-2012 TupiLabs. All Rights Reserved.