Class PepperExporterTest
- java.lang.Object
-
- org.corpus_tools.pepper.testFramework.helpers.PepperModuleTestHelper
-
- org.corpus_tools.pepper.testFramework.helpers.PepperModuleTest
-
- org.corpus_tools.pepper.testFramework.helpers.PepperImExporterTest
-
- org.corpus_tools.pepper.testFramework.PepperExporterTest
-
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 viagetFixture()is of typePepperExporter. To create an easier access, we recommend to overwrite the methodgetFixture()as follows:@Override public MY_EXPORTER_CLASS getFixture() { return (MY_EXPORTER_CLASS) fixture; }The method#setFixture(PepperExporter)sets theSaltProjectand creates a singleSCorpusGraphobject, 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.- Author:
- florian
-
-
Field Summary
-
Fields inherited from class org.corpus_tools.pepper.testFramework.helpers.PepperImExporterTest
supportedFormatsCheck
-
Fields inherited from class org.corpus_tools.pepper.testFramework.helpers.PepperModuleTestHelper
fixture, logger, resourceURI, TMP_TEST_DIR
-
-
Constructor Summary
Constructors Constructor Description PepperExporterTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckThatWhenSimulatingFitnessCheckModulePassesSelfTest(ModuleFitness fitness)protected PepperExportergetFixture()Returns the current fixture to test.-
Methods inherited from class org.corpus_tools.pepper.testFramework.helpers.PepperImExporterTest
addFormatWhichShouldBeSupported, addFormatWhichShouldBeSupported, addSupportedFormat, checkThatCorrectFormatsAreSupported, setFixture
-
Methods inherited from class org.corpus_tools.pepper.testFramework.helpers.PepperModuleTest
checkThatCorpusGraphIsSettable, checkThatFixtureIsSet, checkThatModuleHasName, checkThatResourcePathIsSet, checkThatWhenSimulatingFitnessCheckModulePassesSelfTest, diffsBetweenActualAndExpected, runSelfTest
-
Methods inherited from class org.corpus_tools.pepper.testFramework.helpers.PepperModuleTestHelper
compareFiles, compareFiles, getSrcResources, getTempPath, getTempPath_static, getTempURI, getTestResources, initialize, setResourcesURI, start
-
-
-
-
Method Detail
-
getFixture
protected PepperExporter getFixture()
Description copied from class:PepperModuleTestHelperReturns the current fixture to test.- Overrides:
getFixturein classPepperModuleTestHelper- Returns:
- object to test, derived from
PepperModule
-
checkThatWhenSimulatingFitnessCheckModulePassesSelfTest
public void checkThatWhenSimulatingFitnessCheckModulePassesSelfTest(ModuleFitness fitness)
- Specified by:
checkThatWhenSimulatingFitnessCheckModulePassesSelfTestin classPepperModuleTest
-
-