public abstract class PepperModuleTestHelper extends Object
Modifier and Type | Field and Description |
---|---|
protected PepperModule |
fixture |
protected static org.slf4j.Logger |
logger |
protected org.eclipse.emf.common.util.URI |
resourceURI |
static String |
TMP_TEST_DIR |
Constructor and Description |
---|
PepperModuleTestHelper()
Creates an object of type
PepperModuleTest . |
Modifier and Type | Method and Description |
---|---|
boolean |
compareFiles(File file1,
File file2)
Compares the content of two files.
|
boolean |
compareFiles(org.eclipse.emf.common.util.URI uri1,
org.eclipse.emf.common.util.URI uri2)
Compares the content of two files.
|
protected PepperModule |
getFixture()
Returns the current fixture to test.
|
static String |
getSrcResources() |
static File |
getTempPath_static(String testDirectory) |
File |
getTempPath(String testDirectory)
Returns a
File object pointing to a temporary path, where the
caller can store temporary files. |
org.eclipse.emf.common.util.URI |
getTempURI(String testDirectory)
Returns a
File object pointing to a temporary path, where the
caller can store temporary files. |
static String |
getTestResources() |
void |
initialize()
Initializes this object.
|
protected void |
setFixture(PepperModule fixture)
Sets the current fixture to test.
|
void |
setResourcesURI(org.eclipse.emf.common.util.URI resourceURI)
Sets the path to resources folder for module.
|
void |
start()
This methods starts the processing of Pepper in the development
environment.
|
protected static final org.slf4j.Logger logger
protected org.eclipse.emf.common.util.URI resourceURI
protected PepperModule fixture
public static String TMP_TEST_DIR
public PepperModuleTestHelper()
PepperModuleTest
. To initialize it, the
overridable method initialize()
is called.protected void setFixture(PepperModule fixture)
fixture
- object to test, derived from PepperModule
protected PepperModule getFixture()
PepperModule
public void initialize()
setResourcesURI(URI)
is set to mavens
default 'src/main/resources'public org.eclipse.emf.common.util.URI getTempURI(String testDirectory)
File
object pointing to a temporary path, where the
caller can store temporary files. The temporary path is located in the
temporary directory provided by the underlying os. The resulting
directory is located in TEMP_PATH_BY_OS//
testDirectory
.testDirectory
- last part of the temporary pathpublic File getTempPath(String testDirectory)
File
object pointing to a temporary path, where the
caller can store temporary files. The temporary path is located in the
temporary directory provided by the underlying os. The resulting
directory is located in TEMP_PATH_BY_OS//
testDirectory
.testDirectory
- last part of the temporary pathpublic static String getTestResources()
public static String getSrcResources()
public void start()
PepperImporter
, first the
method PepperImporter.importCorpusStructure(SCorpusGraph)
is
called. For all kinds of fixture, the method
PepperModule.start(org.corpus_tools.salt.graph.Identifier)
is
called for each SDocument
object contained in the variable
PepperModule.getSaltProject()
. This method will wait, until each
ModuleControllerImpl
return having finished the process. CorpusDefinition
and add it to this object and set its
FormatDefinition
and corpus pathSCorpusGraph
object as the one to be filled and add
it with
getFixture().getSaltProject().getCorpusGraphs().add(importedCorpusGraph); getFixture().importCorpusStructure(importedCorpusGraph);
public void setResourcesURI(org.eclipse.emf.common.util.URI resourceURI)
resourceURI
- URI with pathpublic boolean compareFiles(org.eclipse.emf.common.util.URI uri1, org.eclipse.emf.common.util.URI uri2) throws IOException
uri1
- first file to compareuri2
- second file to compareIOException
public boolean compareFiles(File file1, File file2) throws IOException
file1
- first file to comparefile2
- second file to compareIOException
IOException
Copyright © 2009–2019 Humboldt-Universität zu Berlin, INRIA. All rights reserved.