Class PepperImporterTest
- 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.PepperImporterTest
-
public abstract class PepperImporterTest extends PepperImExporterTest
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 viagetFixture()is of typePepperImporter. To create an easier access, we recommend to overwrite the methodgetFixture()as follows:@Override public MY_IMPORTER_CLASS getFixture() { return (MY_IMPORTER_CLASS) fixture; }The method#setFixture(PepperIMporter)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 importer is set correctly. Therefore you need to call
PepperImExporterTest.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
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 PepperImporterTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckThatWhenSimulatingFitnessCheckModulePassesSelfTest(ModuleFitness fitness)protected PepperImportergetFixture()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 PepperImporter 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
-
-