public abstract class PepperExporterTest extends PepperImExporterTest
This class is a helper class for creating tests for PepperExporters.
This class provides a fixture declaration which could be called via
#setFixture(PepperExporter). The fixture which is returned via
getFixture() is of type PepperExporter. To create an easier
access, we recommend to overwrite the method getFixture() as
follows:
@Override
public MY_EXPORTER_CLASS getFixture() {
return (MY_EXPORTER_CLASS) fixture;
}
The method #setFixture(PepperExporter) 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 exporter is set
correctly. Therefore you need to call PepperImExporterTest.addSupportedFormat(FormatDesc)
and pass the format your exporter 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 PepperModuleTestHelper.start() in your test method. This will start
the test environment, which simulates a Pepper conversion process.
supportedFormatsCheckfixture, logger, resourceURI, TMP_TEST_DIR| Constructor and Description |
|---|
PepperExporterTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkThatWhenSimulatingFitnessCheckModulePassesSelfTest(ModuleFitness fitness) |
protected PepperExporter |
getFixture()
Returns the current fixture to test.
|
addFormatWhichShouldBeSupported, addFormatWhichShouldBeSupported, addSupportedFormat, checkThatCorrectFormatsAreSupported, setFixturecheckThatCorpusGraphIsSettable, checkThatFixtureIsSet, checkThatModuleHasName, checkThatResourcePathIsSet, checkThatWhenSimulatingFitnessCheckModulePassesSelfTest, diffsBetweenActualAndExpected, runSelfTestcompareFiles, compareFiles, getSrcResources, getTempPath_static, getTempPath, getTempURI, getTestResources, initialize, setResourcesURI, startprotected PepperExporter getFixture()
PepperModuleTestHelpergetFixture in class PepperModuleTestHelperPepperModulepublic void checkThatWhenSimulatingFitnessCheckModulePassesSelfTest(ModuleFitness fitness)
checkThatWhenSimulatingFitnessCheckModulePassesSelfTest in class PepperModuleTestCopyright © 2009–2021 Humboldt-Universität zu Berlin, INRIA. All rights reserved.