gate.jape.functest
Class BaseJapeTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by 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


Nested Class Summary
static interface BaseJapeTests.AnnotationCreator
          Callback interface used in the doTest method.
static class BaseJapeTests.BaseAnnotationCreator
           
 
Field Summary
protected static String DEFAULT_DATA_FILE
           
static TransducerType transducerType
          JAPE Transducer under test.
 
Constructor Summary
BaseJapeTests(String name)
           
 
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)
           
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)
           
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transducerType

public static final TransducerType transducerType
JAPE Transducer under test. CHANGE THIS to test another Transducer


DEFAULT_DATA_FILE

protected static final String DEFAULT_DATA_FILE
See Also:
Constant Field Values
Constructor Detail

BaseJapeTests

public BaseJapeTests(String name)
Method Detail

setUpGate

protected static void setUpGate()
Initializes GATE and sets up plug-ins. The operation is idempotent.


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)