Pepper
3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
|
This class is a container for a module selftest. More...
Classes | |
class | Builder |
Public Member Functions | |
SelfTestDesc (URI inputCorpusPath, URI expectedCorpusPath) | |
Creates an object with input corpus path and expected path. More... | |
URI | getInputCorpusPath () |
URI | getExpectedCorpusPath () |
boolean | compare (final SaltProject actualProject, final SaltProject expectedProject) |
This method is called by the Pepper framework, when making a selftest of the module. More... | |
boolean | compare (final URI actualCorpusPath, final URI expectedCorpusPath) |
This method is called by the Pepper framework, when making a selftest of the module. More... | |
boolean | isValid (final Collection< String > problems) |
Returns whether this object was correctly instantiated by module. More... | |
int | hashCode () |
boolean | equals (Object obj) |
String | toString () |
Protected Member Functions | |
boolean | compare (final File actualFile, final File expectedFile) |
This method is called by compare(URI, URI) to compare two files with each other. More... | |
boolean | compareXML (final File actualXmlFile, final File expectedXmlFile) |
This method is called by compare(URI, URI) to compare two xmlfiles with each other. More... | |
Protected Attributes | |
final DocumentBuilderFactory | docBuilderFactory = DocumentBuilderFactory.newInstance() |
This class is a container for a module selftest.
A Pepper module provides an object of this type, and the Pepper framework consumes its methods to check the the results of the module's mapping process. Mainly this class provides an input path, which should contain all files acting as the input for the tested module. And an expected path, which contains the expected output. The method compare(SaltProject, SaltProject) or compare(URI, URI) is called later to compare the result produced by the module with the expected model or files.
org.corpus_tools.pepper.core.SelfTestDesc.SelfTestDesc | ( | URI | inputCorpusPath, |
URI | expectedCorpusPath | ||
) |
Creates an object with input corpus path and expected path.
inputCorpusPath | the path where the corpus used as input is located |
expectedCorpusPath | the path where the expected corpus is located |
|
protected |
This method is called by compare(URI, URI) to compare two files with each other.
You are free to overwrite this method with your own comparison.
actualFile | the file produced by the module itself (which was generated from the files from the input corpus path) |
expectedFile | the file, which is contained in expected corpus path. |
boolean org.corpus_tools.pepper.core.SelfTestDesc.compare | ( | final SaltProject | actualProject, |
final SaltProject | expectedProject | ||
) |
This method is called by the Pepper framework, when making a selftest of the module.
This method is called when tested module is an importers or manipulators.
You are free to overwrite this method with your own comparison.
actualProject | is the project produced by the module itself (which was generated from the files from the input corpus path) |
expectedProject | is the expected Salt model, which is created from the output corpus path. |
boolean org.corpus_tools.pepper.core.SelfTestDesc.compare | ( | final URI | actualCorpusPath, |
final URI | expectedCorpusPath | ||
) |
This method is called by the Pepper framework, when making a selftest of the module.
This method is called when tested module is an exporter.
You are free to overwrite this method with your own comparison.
actualCorpusPath | is the corpus path produced by the module itself (which was generated from the files from the input corpus path) |
expectedCorpusPath | is the expected corpus path |
|
protected |
This method is called by compare(URI, URI) to compare two xmlfiles with each other.
You are free to overwrite this method with your own comparison.
actualXmlFile | the xml file produced by the module itself (which was generated from the files from the input corpus path) |
expectedXmlFile | the xml file, which is contained in expected corpus path. |
URI org.corpus_tools.pepper.core.SelfTestDesc.getExpectedCorpusPath | ( | ) |
URI org.corpus_tools.pepper.core.SelfTestDesc.getInputCorpusPath | ( | ) |
boolean org.corpus_tools.pepper.core.SelfTestDesc.isValid | ( | final Collection< String > | problems | ) |
Returns whether this object was correctly instantiated by module.
problems | when object is not valid, the reason(s) are written here. |