gate.jape.functest
Class BaseJapeTests
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
gate.jape.functest.BaseJapeTests
- All Implemented Interfaces:
- junit.framework.Test
- Direct Known Subclasses:
- TestConstraints, TestJape
public abstract class BaseJapeTests
- extends junit.framework.TestCase
Tests for Constraint predicate logic
|
Method Summary |
protected static void |
compareEndOffsets(Set<Annotation> res,
int... endOffsets)
|
protected static void |
compareResults(String[] expectedResults,
Set<Annotation> actualResults)
Compares 2 ordered sets of annotations by comparison of the rules that created them. |
protected static void |
compareStartOffsets(Set<Annotation> res,
int... startOffsets)
|
private static Resource |
createOntology(String ontologyURL)
|
protected Set<Annotation> |
doTest(Document doc,
String japeResourcePath,
BaseJapeTests.AnnotationCreator ac,
String ontologyURL)
|
protected Set<Annotation> |
doTest(String docResourcePath,
String japeResourcePath,
BaseJapeTests.AnnotationCreator ac)
|
protected Set<Annotation> |
doTest(String docResourcePath,
String japeResourcePath,
BaseJapeTests.AnnotationCreator ac,
String ontologyURL)
|
private static void |
registerCREOLE(File plugInDir)
|
private Set<Annotation> |
runTransducer(Document doc,
String japeFile,
String ontologyURL)
Executes transducer with the provided parameters and returns transduced annotations ordered |
protected static void |
setUpGate()
Initializes GATE and sets up plug-ins. |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
| Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
transducerType
public static final TransducerType transducerType
- JAPE Transducer under test. CHANGE THIS to test another Transducer
logger
private static final org.apache.log4j.Logger logger
DEFAULT_DATA_FILE
protected static final String DEFAULT_DATA_FILE
- See Also:
- Constant Field Values
BaseJapeTests
public BaseJapeTests(String name)
setUpGate
protected static void setUpGate()
- Initializes GATE and sets up plug-ins. The operation is idempotent.
registerCREOLE
private static void registerCREOLE(File plugInDir)
throws GateException
- Throws:
GateException
createOntology
private static Resource createOntology(String ontologyURL)
throws MalformedURLException
- Throws:
MalformedURLException
runTransducer
private Set<Annotation> runTransducer(Document doc,
String japeFile,
String ontologyURL)
throws MalformedURLException,
ResourceInstantiationException,
ExecutionException
- Executes transducer with the provided parameters and returns transduced annotations ordered
- Parameters:
doc - a GATE document with initial annotationsjapeFile - a file with the JAPE grammarontologyURL - optional ontology URL. Might be null.
- Returns:
- an ordered set of transduced annotations
- Throws:
MalformedURLException
ResourceInstantiationException
ExecutionException
doTest
protected Set<Annotation> doTest(String docResourcePath,
String japeResourcePath,
BaseJapeTests.AnnotationCreator ac,
String ontologyURL)
throws Exception
- Throws:
Exception
doTest
protected Set<Annotation> doTest(String docResourcePath,
String japeResourcePath,
BaseJapeTests.AnnotationCreator ac)
throws Exception
- Throws:
Exception
doTest
protected Set<Annotation> doTest(Document doc,
String japeResourcePath,
BaseJapeTests.AnnotationCreator ac,
String ontologyURL)
throws Exception
- Throws:
Exception
compareResults
protected static void compareResults(String[] expectedResults,
Set<Annotation> actualResults)
- Compares 2 ordered sets of annotations by comparison of the rules that created them.
compareStartOffsets
protected static final void compareStartOffsets(Set<Annotation> res,
int... startOffsets)
compareEndOffsets
protected static final void compareEndOffsets(Set<Annotation> res,
int... endOffsets)