gate.jape.functest
Class TestConstraints

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by gate.jape.functest.BaseJapeTests
              extended by gate.jape.functest.TestConstraints
All Implemented Interfaces:
junit.framework.Test

public class TestConstraints
extends BaseJapeTests

Tests for Constraint predicate logic


Nested Class Summary
 
Nested classes/interfaces inherited from class gate.jape.functest.BaseJapeTests
BaseJapeTests.AnnotationCreator, BaseJapeTests.BaseAnnotationCreator
 
Field Summary
protected  BaseJapeTests.AnnotationCreator basicAnnotCreator
          Visually, this creates an annot set like this: 0-------------1--------------2 12345678901234567890 _AA (f1,"atext"), (f2,"2"), (f3,3) _B (f1,"btext), (f2,"2"), (f4,"btext4") ___BB (f1,"btext), (f2,"2"), (f4,"btext4") ______B (f1,"cctext"), (f2,"2"), (f3,3l), (f4,"ctext4") ______CC (f1,"cctext"), (f2,"2"), (f3,3l), (f4,"ctext4") ________CC (f1,"cctext"), (f2,"1"), (f4,"ctext4") _____________DD (f1,"dtext"), (f3,3l) _______________DD (f2,2l) _________________DD (ontology, "http://gate.ac.uk/tests/demo.owl"), (class, "Businessman") ____________________D (ontology, "http://gate.ac.uk/tests/demo.owl"), (class, "Country") 0-------------1--------------2 12345678901234567890
 
Fields inherited from class gate.jape.functest.BaseJapeTests
DEFAULT_DATA_FILE, transducerType
 
Constructor Summary
TestConstraints(String name)
           
 
Method Summary
 void doCommonTest(String japeFilePath, String docFilePath, String[] expectedResults, int[] expectedStartOffsets, int[] expectedEndOffsets, BaseJapeTests.AnnotationCreator annocreator)
           
static void main(String[] args)
           
protected static void parseJapeString(String japeRules)
          Fast routine for parsing a small string of JAPE rules.
static junit.framework.Test suite()
           
 void test000TransduceEmptyDoc()
          Try to transduce on empty document
 void test811MatchStringInEmptyAnnotSet()
          GATE Tao:8.1.1 Trying to match string features on document with no annotations
 void test811MatchText()
          GATE Tao:8.1.1
 void test812MatchAnnot()
          GATE Tao: 8.1.2
 void test812MatchNegativeAnnotations()
          GATE Tao: 8.1.2 Matching negation on annotation (e.g {!
 void test812MatchNegativeAnnotationsInEmptyAnnotSet()
          GATE Tao: 8.1.2 Trying to match annotations on document with no annotations
 void test813OpContains()
          GATE Tao: 8.1.3 LHS Operators: contains
 void test813OpContainWithinNoMatch()
          GATE Tao: 8.1.3 LHS Operators: contains & within in document with no annotations
 void test813OpEqualsDoubleNegative()
          GATE Tao: 8.1.3 Operator: == Case: Negative real number
 void test813OpEqualsDoublePositive()
          GATE Tao: 8.1.3 Operator: == Case: Positive real number
 void test813OpEqualsIntegerNatural()
          GATE Tao: 8.1.3 Operator: == Case: Natural number
 void test813OpEqualsIntegerNegative()
          GATE Tao: 8.1.3 Operator: == Case: Negative integer
 void test813OpEqualsStringEmptyFeature()
          Gate Tao: 8.1.3 Operator: == Case: Emty String feature
 void test813OpEqualsStringSpecialChars()
          Gate Tao: 8.1.3 Operator: == Case: Special characters in the rule and text (quote here)
 void test813OpGreaterEqualsNegativeDouble()
          GATE Tao: 8.1.3 Operator: >= Case: Negative Real Number
 void test813OpGreaterEqualsNegativeInteger()
          GATE Tao: 8.1.3 Operator: >= Case: Negative Integer
 void test813OpGreaterEqualsPositiveDouble()
          GATE Tao: 8.1.3 Operator: >= Case: Positive Real Number
 void test813OpGreaterEqualsString()
          GATE Tao: 8.1.3 Operator: >= Case: String
 void test813OpGreaterThanNaturalNumber()
          GATE Tao: 8.1.3 Operator: > Case: Natural Number
 void test813OpGreaterThanNegativeDouble()
          GATE Tao: 8.1.3 Operator: > Case: Negative Real Number
 void test813OpGreaterThanNegativeInteger()
          GATE Tao: 8.1.3 Operator: > Case: Negative Integer
 void test813OpGreaterThanPositiveDouble()
          GATE Tao: 8.1.3 Operator: > Case: Positive Real Number
 void test813OpGreaterThanString()
          GATE Tao: 8.1.3 Operator: > Case: String
 void test813OpGreaterЕqualsPositiveInteger()
          GATE Tao: 8.1.3 Operator: >= Case: Positive Integer
 void test813OpWithin()
          GATE Tao: 8.1.3 LHS Operators: within
 void test814MetaLeftCleanString()
          GATE Tao: 8.1.4 Meta-Property: LHS cleanString
 void test814MetaLeftLength()
          GATE Tao: 8.1.4 Meta-Property: LHS length
 void test814MetaLeftString()
          GATE Tao: 8.1.4 Meta-Property: LHS string
 void test814MetaRightString()
          GATE Tao: 8.1.4 Meta-Property: RHS string
 void test815MultiPatternActionsNested()
          GATE Tao: 8.1.5 Multiple Patterns/Actions - Nested
 void test815MultiPatternActionsSequential()
          GATE Tao: 8.1.5 Multiple Patterns/Actions - Sequential
 void test816Macro()
          GATE Tao: 8.1.6 LHS Macros
 void test817ContextForeAndAft()
          GATE Tao: 8.1.7 Contexts
 void test818ContextBeginsAt()
          GATE Tao: 8.1.8 Contexts
 void testBadCompare()
           
 void testBadPattern()
           
 void testCustomPredicates()
           
 void testCustomPredicatesWithConstraints()
           
 void testGoodOperators()
           
 void testKleeneOperators()
           
 void testMetaPropertyAccessors()
           
 void testRanges()
           
 
Methods inherited from class gate.jape.functest.BaseJapeTests
compareEndOffsets, compareResults, compareStartOffsets, doTest, doTest, doTest, setUpGate
 
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

basicAnnotCreator

protected BaseJapeTests.AnnotationCreator basicAnnotCreator
Visually, this creates an annot set like this: 0-------------1--------------2 12345678901234567890 _AA (f1,"atext"), (f2,"2"), (f3,3) _B (f1,"btext), (f2,"2"), (f4,"btext4") ___BB (f1,"btext), (f2,"2"), (f4,"btext4") ______B (f1,"cctext"), (f2,"2"), (f3,3l), (f4,"ctext4") ______CC (f1,"cctext"), (f2,"2"), (f3,3l), (f4,"ctext4") ________CC (f1,"cctext"), (f2,"1"), (f4,"ctext4") _____________DD (f1,"dtext"), (f3,3l) _______________DD (f2,2l) _________________DD (ontology, "http://gate.ac.uk/tests/demo.owl"), (class, "Businessman") ____________________D (ontology, "http://gate.ac.uk/tests/demo.owl"), (class, "Country") 0-------------1--------------2 12345678901234567890

Constructor Detail

TestConstraints

public TestConstraints(String name)
Method Detail

test000TransduceEmptyDoc

public void test000TransduceEmptyDoc()
                              throws Exception
Try to transduce on empty document

Throws:
Exception

test811MatchText

public void test811MatchText()
                      throws Exception
GATE Tao:8.1.1

Throws:
Exception

test811MatchStringInEmptyAnnotSet

public void test811MatchStringInEmptyAnnotSet()
                                       throws Exception
GATE Tao:8.1.1 Trying to match string features on document with no annotations

Throws:
Exception

test812MatchAnnot

public void test812MatchAnnot()
                       throws Exception
GATE Tao: 8.1.2

Throws:
Exception

test812MatchNegativeAnnotationsInEmptyAnnotSet

public void test812MatchNegativeAnnotationsInEmptyAnnotSet()
                                                    throws Exception
GATE Tao: 8.1.2 Trying to match annotations on document with no annotations

Throws:
Exception

test812MatchNegativeAnnotations

public void test812MatchNegativeAnnotations()
                                     throws Exception
GATE Tao: 8.1.2 Matching negation on annotation (e.g {!Lookup}) on a document with annotations

Throws:
Exception

test813OpContains

public void test813OpContains()
                       throws Exception
GATE Tao: 8.1.3 LHS Operators: contains

Throws:
Exception

test813OpWithin

public void test813OpWithin()
                     throws Exception
GATE Tao: 8.1.3 LHS Operators: within

Throws:
Exception

test813OpContainWithinNoMatch

public void test813OpContainWithinNoMatch()
                                   throws Exception
GATE Tao: 8.1.3 LHS Operators: contains & within in document with no annotations

Throws:
Exception

test813OpEqualsStringSpecialChars

public void test813OpEqualsStringSpecialChars()
                                       throws Exception
Gate Tao: 8.1.3 Operator: == Case: Special characters in the rule and text (quote here)

Throws:
Exception

test813OpEqualsStringEmptyFeature

public void test813OpEqualsStringEmptyFeature()
                                       throws Exception
Gate Tao: 8.1.3 Operator: == Case: Emty String feature

Throws:
Exception

test813OpEqualsIntegerNatural

public void test813OpEqualsIntegerNatural()
                                   throws Exception
GATE Tao: 8.1.3 Operator: == Case: Natural number

Throws:
Exception

test813OpEqualsIntegerNegative

public void test813OpEqualsIntegerNegative()
                                    throws Exception
GATE Tao: 8.1.3 Operator: == Case: Negative integer

Throws:
Exception

test813OpEqualsDoublePositive

public void test813OpEqualsDoublePositive()
                                   throws Exception
GATE Tao: 8.1.3 Operator: == Case: Positive real number

Throws:
Exception

test813OpEqualsDoubleNegative

public void test813OpEqualsDoubleNegative()
                                   throws Exception
GATE Tao: 8.1.3 Operator: == Case: Negative real number

Throws:
Exception

test813OpGreaterThanString

public void test813OpGreaterThanString()
                                throws Exception
GATE Tao: 8.1.3 Operator: > Case: String

Throws:
Exception

test813OpGreaterThanNaturalNumber

public void test813OpGreaterThanNaturalNumber()
                                       throws Exception
GATE Tao: 8.1.3 Operator: > Case: Natural Number

Throws:
Exception

test813OpGreaterThanNegativeInteger

public void test813OpGreaterThanNegativeInteger()
                                         throws Exception
GATE Tao: 8.1.3 Operator: > Case: Negative Integer

Throws:
Exception

test813OpGreaterThanPositiveDouble

public void test813OpGreaterThanPositiveDouble()
                                        throws Exception
GATE Tao: 8.1.3 Operator: > Case: Positive Real Number

Throws:
Exception

test813OpGreaterThanNegativeDouble

public void test813OpGreaterThanNegativeDouble()
                                        throws Exception
GATE Tao: 8.1.3 Operator: > Case: Negative Real Number

Throws:
Exception

test813OpGreaterEqualsString

public void test813OpGreaterEqualsString()
                                  throws Exception
GATE Tao: 8.1.3 Operator: >= Case: String

Throws:
Exception

test813OpGreaterЕqualsPositiveInteger

public void test813OpGreaterЕqualsPositiveInteger()
                                           throws Exception
GATE Tao: 8.1.3 Operator: >= Case: Positive Integer

Throws:
Exception

test813OpGreaterEqualsNegativeInteger

public void test813OpGreaterEqualsNegativeInteger()
                                           throws Exception
GATE Tao: 8.1.3 Operator: >= Case: Negative Integer

Throws:
Exception

test813OpGreaterEqualsPositiveDouble

public void test813OpGreaterEqualsPositiveDouble()
                                          throws Exception
GATE Tao: 8.1.3 Operator: >= Case: Positive Real Number

Throws:
Exception

test813OpGreaterEqualsNegativeDouble

public void test813OpGreaterEqualsNegativeDouble()
                                          throws Exception
GATE Tao: 8.1.3 Operator: >= Case: Negative Real Number

Throws:
Exception

test814MetaLeftLength

public void test814MetaLeftLength()
                           throws Exception
GATE Tao: 8.1.4 Meta-Property: LHS length

Throws:
Exception

test814MetaLeftString

public void test814MetaLeftString()
                           throws Exception
GATE Tao: 8.1.4 Meta-Property: LHS string

Throws:
Exception

test814MetaLeftCleanString

public void test814MetaLeftCleanString()
                                throws Exception
GATE Tao: 8.1.4 Meta-Property: LHS cleanString

Throws:
Exception

test814MetaRightString

public void test814MetaRightString()
                            throws Exception
GATE Tao: 8.1.4 Meta-Property: RHS string

Throws:
Exception

test815MultiPatternActionsSequential

public void test815MultiPatternActionsSequential()
                                          throws Exception
GATE Tao: 8.1.5 Multiple Patterns/Actions - Sequential

Throws:
Exception

test815MultiPatternActionsNested

public void test815MultiPatternActionsNested()
                                      throws Exception
GATE Tao: 8.1.5 Multiple Patterns/Actions - Nested

Throws:
Exception

test816Macro

public void test816Macro()
                  throws Exception
GATE Tao: 8.1.6 LHS Macros

Throws:
Exception

test817ContextForeAndAft

public void test817ContextForeAndAft()
                              throws Exception
GATE Tao: 8.1.7 Contexts

Throws:
Exception

test818ContextBeginsAt

public void test818ContextBeginsAt()
                            throws Exception
GATE Tao: 8.1.8 Contexts

Throws:
Exception

testGoodOperators

public void testGoodOperators()
                       throws Exception
Throws:
Exception

testBadCompare

public void testBadCompare()
                    throws Exception
Throws:
Exception

testBadPattern

public void testBadPattern()
                    throws Exception
Throws:
Exception

testMetaPropertyAccessors

public void testMetaPropertyAccessors()
                               throws Exception
Throws:
Exception

testCustomPredicates

public void testCustomPredicates()
                          throws Exception
Throws:
Exception

testCustomPredicatesWithConstraints

public void testCustomPredicatesWithConstraints()
                                         throws Exception
Throws:
Exception

testRanges

public void testRanges()
                throws Exception
Throws:
Exception

testKleeneOperators

public void testKleeneOperators()
                         throws Exception
Throws:
Exception

doCommonTest

public void doCommonTest(String japeFilePath,
                         String docFilePath,
                         String[] expectedResults,
                         int[] expectedStartOffsets,
                         int[] expectedEndOffsets,
                         BaseJapeTests.AnnotationCreator annocreator)
                  throws Exception
Throws:
Exception

parseJapeString

protected static void parseJapeString(String japeRules)
                               throws ParseException
Fast routine for parsing a small string of JAPE rules.

Parameters:
japeRules -
Throws:
ParseException

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)