de.fuberlin.wiwiss.d2rq
Class RDQLTestFramework

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byde.fuberlin.wiwiss.d2rq.TestFramework
              extended byde.fuberlin.wiwiss.d2rq.RDQLTestFramework
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ExpressionTest, RDQLTest

public class RDQLTestFramework
extends TestFramework

Functional tests that exercise a ModelD2RQ by running RDQL queries against it. For notes on running the tests, see AllTests. Each test method runs one RDQL query and automatically compares the actual results to the expected results. For some tests, only the number of returned triples is checked. For others, the returned values are compared against expected values. If a test fails, the dump() method can be handy. It shows the actual results returned by a query on System.out. To see debug information, uncomment the enableDebug() call in the setUp() method.

Author:
Richard Cyganiak

Field Summary
static boolean compareQueryHandlers
           
protected static Logger differenceLogger
           
protected static Logger differentLogger
           
protected static Logger logger
           
protected  ModelD2RQ model
           
protected static Logger performanceLogger
           
protected  java.lang.String queryString
           
protected static Logger rdqlLogger
           
protected  java.util.Set results
           
protected static Logger rsLogger
           
protected static Logger separator
           
 
Fields inherited from class de.fuberlin.wiwiss.d2rq.TestFramework
D2RQMap, NS, xsdString, xsdYear
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
RDQLTestFramework(java.lang.String arg0)
           
 
Method Summary
protected  void assertResult(java.util.Map map)
           
protected  void assertResultCount(int count)
           
protected  boolean containsAll(com.hp.hpl.jena.rdql.ResultBinding actual, java.util.Map expected)
           
protected  void dump()
           
private  java.lang.String printArray(java.lang.String[] a)
           
private  java.lang.String printCollection(java.util.Collection c)
           
private  java.lang.String printMap(java.util.Map m)
           
private  java.lang.String printObject(java.lang.Object obj)
           
protected  void rdql(java.lang.String rdql)
           
static java.util.Set resultBindingsToMaps(java.util.Set b)
           
static java.util.Map resultBindingToMap(com.hp.hpl.jena.rdql.ResultBinding b)
           
 void runTest()
           
protected  void setUp()
           
protected  void tearDown()
           
 
Methods inherited from class de.fuberlin.wiwiss.d2rq.TestFramework
getD2RQMap, getNS, run, setD2RQMap, setNS
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runBare, setName, 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

model

protected ModelD2RQ model

results

protected java.util.Set results

queryString

protected java.lang.String queryString

separator

protected static Logger separator

logger

protected static Logger logger

performanceLogger

protected static Logger performanceLogger

rdqlLogger

protected static Logger rdqlLogger

differentLogger

protected static Logger differentLogger

differenceLogger

protected static Logger differenceLogger

rsLogger

protected static Logger rsLogger

compareQueryHandlers

public static boolean compareQueryHandlers
Constructor Detail

RDQLTestFramework

public RDQLTestFramework(java.lang.String arg0)
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class TestFramework
Throws:
java.lang.Exception

runTest

public void runTest()
             throws java.lang.Throwable
Overrides:
runTest in class TestFramework
Throws:
java.lang.Throwable

printObject

private java.lang.String printObject(java.lang.Object obj)

printArray

private java.lang.String printArray(java.lang.String[] a)

printCollection

private java.lang.String printCollection(java.util.Collection c)

printMap

private java.lang.String printMap(java.util.Map m)

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class TestFramework
Throws:
java.lang.Exception

rdql

protected void rdql(java.lang.String rdql)

assertResultCount

protected void assertResultCount(int count)

assertResult

protected void assertResult(java.util.Map map)

resultBindingsToMaps

public static java.util.Set resultBindingsToMaps(java.util.Set b)

resultBindingToMap

public static java.util.Map resultBindingToMap(com.hp.hpl.jena.rdql.ResultBinding b)

containsAll

protected boolean containsAll(com.hp.hpl.jena.rdql.ResultBinding actual,
                              java.util.Map expected)

dump

protected void dump()