public abstract class AbstractTestCase extends TestCase2
Abstract harness for testing under a variety of configurations. In order to
test a specific configuration, create a concrete instance of this class. The
configuration can be described using a mixture of a .properties
file of the same name as the test class and custom code.
When debugging from an IDE, it is very helpful to be able to run a single
test case. You can do this, but you MUST define the property
testClass
as the name test class that has the logic required
to instantiate and configure an appropriate object manager instance for the
test.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractTestCase.StatementVerifier
Helper class verifies that all statements identified by a re-parse of
some RDF/XML file are present in the KB.
|
TestCase2.MyProperties, TestCase2.RandomType
Modifier and Type | Field and Description |
---|---|
protected IV |
NULL
A
null IV reference (NOT a NullIV object). |
_randomType, log
Constructor and Description |
---|
AbstractTestCase() |
AbstractTestCase(String name) |
Modifier and Type | Method and Description |
---|---|
void |
assertEquals(SPO[] expected,
SPO[] actual) |
void |
assertEquals(SPO expected,
SPO actual) |
void |
assertEquals(String msg,
SPO[] expected,
SPO[] actual) |
void |
assertEquals(String msg,
SPO expected,
SPO actual) |
static void |
assertLexiconIndicesConsistent(AbstractTripleStore store)
Verify that TERM2ID and ID2TERM have the same range count and that
all ID2TERM entries resolve a TERM2ID entry and that each TERM2ID
entry leads to an ID2TERM entry.
|
static void |
assertSameSPOs(ISPO[] expected,
IChunkedOrderedIterator<ISPO> actual) |
static void |
assertSameSPOs(String msg,
ISPO[] expected,
IChunkedOrderedIterator<ISPO> actual) |
static void |
assertSameSPOsAnyOrder(AbstractTripleStore store,
ISPO[] expected,
IChunkedOrderedIterator<ISPO> actual)
Verify that the iterator visits the expected
ISPO s in any order
without duplicates. |
static void |
assertSameSPOsAnyOrder(AbstractTripleStore store,
ISPO[] expected,
IChunkedOrderedIterator<ISPO> actual,
boolean ignoreAxioms)
Verify that the iterator visits the expected
ISPO s in any order
without duplicates, optionally ignoring axioms. |
static void |
assertSameStatements(org.openrdf.model.Statement[] expected,
BigdataStatementIterator actual) |
static void |
assertSameStatements(String msg,
org.openrdf.model.Statement[] expected,
BigdataStatementIterator actual) |
static void |
assertStatementIndicesConsistent(AbstractTripleStore db,
int maxerrors)
Validates that the same statements are found in each of the statement
indices.
|
protected void |
checkIfProxy()
This method is invoked from methods that MUST be proxied to this class.
|
Properties |
getProperties()
Returns properties read from a hierarchy of sources.
|
protected abstract AbstractTripleStore |
getStore(Properties properties) |
protected void |
recursiveDelete(File f)
Recursively removes any files and subdirectories and then removes the
file (or directory) itself.
|
protected abstract AbstractTripleStore |
reopenStore(AbstractTripleStore store) |
protected void |
setUp(ProxyTestCase testCase)
Invoked from
TestCase.setUp() for each test in the suite. |
protected void |
tearDown(ProxyTestCase testCase)
Invoked from
TestCase.tearDown() for each test in the suite. |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
public AbstractTestCase()
public AbstractTestCase(String name)
protected void setUp(ProxyTestCase testCase) throws Exception
TestCase.setUp()
for each test in the suite.Exception
protected void tearDown(ProxyTestCase testCase) throws Exception
TestCase.tearDown()
for each test in the suite.Exception
public Properties getProperties()
Returns properties read from a hierarchy of sources. The underlying properties read from those sources are cached, but a new properties object is returned on each invocation (to prevent side effects by the caller).
In general, a test configuration critically relies on both the properties returned by this method and the appropriate properties must be provided either through the command line or in a properties file.
getProperties
in class TestCase2
protected void checkIfProxy()
GenericProxyTestCase
extends this class, as do the concrete
classes that drive the test suite for specific GOM integration test
configuration. Many method on this class must be proxied from
GenericProxyTestCase
to the delegate. Invoking this method from
the implementations of those methods in this class provides a means of
catching omissions where the corresponding method is NOT being delegated.
Failure to delegate these methods means that you are not able to share
properties or object manager instances across tests, which means that you
can not do configuration-based testing of integrations and can also wind
up with mutually inconsistent test fixtures between the delegate and each
proxy test.protected abstract AbstractTripleStore getStore(Properties properties)
protected abstract AbstractTripleStore reopenStore(AbstractTripleStore store)
public static void assertSameSPOs(ISPO[] expected, IChunkedOrderedIterator<ISPO> actual)
public static void assertSameSPOs(String msg, ISPO[] expected, IChunkedOrderedIterator<ISPO> actual)
public static void assertSameSPOsAnyOrder(AbstractTripleStore store, ISPO[] expected, IChunkedOrderedIterator<ISPO> actual)
ISPO
s in any order
without duplicates.store
- Used to resolve term identifiers for messages.expected
- actual
- public static void assertSameSPOsAnyOrder(AbstractTripleStore store, ISPO[] expected, IChunkedOrderedIterator<ISPO> actual, boolean ignoreAxioms)
ISPO
s in any order
without duplicates, optionally ignoring axioms.store
- Used to resolve term identifiers for messages.expected
- actual
- (The iterator will be closed).ignoreAxioms
- public static void assertSameStatements(org.openrdf.model.Statement[] expected, BigdataStatementIterator actual)
public static void assertSameStatements(String msg, org.openrdf.model.Statement[] expected, BigdataStatementIterator actual)
public static void assertLexiconIndicesConsistent(AbstractTripleStore store)
store2
- public static void assertStatementIndicesConsistent(AbstractTripleStore db, int maxerrors)
protected void recursiveDelete(File f)
f
- A file or directory.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.