Pepper 3.7.0
A highly extensible plattform for conversion and
Loading...
Searching...
No Matches
org.corpus_tools.pepper.testFramework.PepperImporterTest Class Referenceabstract

Inherits PepperImExporterTest.

Public Member Functions

void checkThatWhenSimulatingFitnessCheckModulePassesSelfTest (final ModuleFitness fitness)
 

Protected Member Functions

PepperImporter getFixture ()
 

Detailed Description

This class is a helper class for creating tests for PepperImporters. This class provides a fixture declaration which could be called via setFixture(PepperImporter). The fixture which is returned via getFixture() is of type PepperImporter. To create an easier access, we recommend to overwrite the method getFixture() as follows:

@Override
public MY_IMPORTER_CLASS getFixture() {
        return (MY_IMPORTER_CLASS) fixture;
}

The method setFixture(PepperIMporter) sets the SaltProject and creates a single SCorpusGraph object, which is added to the list of corpus structures in the salt project. To access the salt project or the corpus structure use the following code:

        getFixture().getSaltProject();
 getFixture().getSaltProject().getCorpusGraphs()

This class predefines a test to check that the format of the importer is set correctly. Therefore you need to call addSupportedFormat(FormatDesc) and pass the format your importer should support. Otherwise this test will fail. You can do this as follows:

addSupportedFormat(new FormatDesc().setFormatName(FORMAT_NAME).setFormatVersion(FROMAT_VERSION));

To run the test call start() in your test method. This will start the test environment, which simulates a Pepper conversion process.

Author
florian