public class TestQueryEngine extends AbstractQueryEngineTestCase
QueryEngine
against a local database instance.
Note: The BOp
s are unit tested separately. This test suite is focused
on interactions when BOp
s are chained together in a query, such as a
sequence of pipeline joins, a slice applied to a query, etc.
-Dlog4j.configuration=bigdata/src/resources/logging/log4j.properties
TestFederatedQueryEngine
TestCase2.MyProperties, TestCase2.RandomType
log
_randomType
Constructor and Description |
---|
TestQueryEngine() |
TestQueryEngine(String name) |
Modifier and Type | Method and Description |
---|---|
protected int |
doStressTest(long timeout,
int ntrials,
int poolSize) |
Properties |
getProperties()
Reads in the configuration properties for the test from a
variety of resources and returns a properties hierarchy.
|
void |
setUp() |
void |
tearDown() |
void |
test_query_closeIterator()
Test verifies the ability close the iterator draining a result set before
the query has finished executing and also verify that the query is
correctly terminated.
|
void |
test_query_join_withConstraint()
A join with an
IConstraint . |
void |
test_query_join1_multipleChunksIn()
Test the ability run a simple join when multiple binding sets are
submitted as the initial input.
|
void |
test_query_join1_without_StartOp()
Test the ability run a simple join without a
StartOp . |
void |
test_query_join1()
Test the ability run a simple join.
|
void |
test_query_join2_conditionalRoutingFalse()
Unit test for
ConditionalRoutingOp . |
void |
test_query_join2_conditionalRoutingTrue()
Unit test for
ConditionalRoutingOp . |
void |
test_query_join2_optionals()
Unit test for optional join.
|
void |
test_query_join2()
Test the ability run a query requiring two joins.
|
void |
test_query_slice_noLimit()
Unit test runs chunks into a slice without a limit.
|
void |
test_query_slice()
Run a join with a slice.
|
void |
test_query_startRun()
Test the ability to run a query which does nothing and produces no
solutions.
|
void |
test_queryJoin2_concurrentStressTest()
Concurrent stress test of
#test_queryJoin2() which runs a fixed
number of trials on a pool of N=10 threads. |
void |
test_queryJoin2_stressTest()
A stress test of
test_query_join2() which runs a fixed number of
presentations in a single thread. |
void |
test_slice_threadSafe() |
void |
test_startStop()
Starts and stops the
QueryEngine , but does not validate the
semantics of shutdown() versus shutdownNow() since we need to be
evaluating query mixes in order to verify the semantics of those
operations. |
void |
testLatchExecutorProgression()
Test the LatchExecutor to verify reliable progression with multiple threads contending
to add tasks.
|
assertSameSolutions, assertSameSolutions, assertSameSolutions, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, compareGraphs, compareTupleQueryResults, diff
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, toString
public TestQueryEngine()
public TestQueryEngine(String name)
name
- public Properties getProperties()
TestCase2
Properties
object, then the lower levels of the
hierarchy are recursively searched.The hierarchy is constructed from the following properties files in the following order. The first property file in this list corresponds to the top of the property hierarchy. The last property file in this list corresponds to the bottom of the property hierarchy. The property resources are:
getProperties
in class TestCase2
Properties
object that supplies bindings for
property names according to the described hierarchy among
property resources. The returned Properties
is NOT
cached.
TODO This does not handle the recursive truncation of the
class name to search for "test.properties" yet.public void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
public void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public void test_startStop() throws Exception
QueryEngine
, but does not validate the
semantics of shutdown() versus shutdownNow() since we need to be
evaluating query mixes in order to verify the semantics of those
operations.Exception
public void test_query_startRun() throws Exception
Exception
public void test_query_join1_without_StartOp() throws Exception
StartOp
. An empty
binding set[] is fed into the join. The join probes the index once for
"Mary" and binds "Paul" when it does so. There there is one solution,
which is "value=Paul".Exception
public void test_query_join1() throws Exception
Exception
public void test_query_join1_multipleChunksIn() throws Exception
Exception
public void test_query_closeIterator() throws Exception
Note: This is difficult to test without having significant data scale
since there is an implicit race between the consumer and the producer to
close out the query evaluation, but the PipelineDelayOp
can be
used to impose sufficient latency on the pipeline that the test can close
the query buffer iterator first.
Note: This must also be tested in scale-out to make sure that the data backing the solutions is not discarded before the caller can use those data.
This could be handled by: (a) materializing binding set objects out of a
ByteBuffer
rather than using a live decode of the data in that
ByteBuffer
; or by (b) using an special DirectBufferPoolAllocator.IAllocationContext
which is scoped to the query results such that they are not released
until the iterator draining the buffer is closed.
Exception
public void test_query_slice_noLimit() throws Exception
When the IRunningQuery
implementation supports it, the source
data are presented in multiple chunks in order to verify the behavior of
the SliceOp
across multiple (and potentially concurrent)
invocations of that operator.
Exception
public void test_query_slice() throws Exception
Note: While the logic for visiting only the solutions selected by the
slice can be tested against a mock object, the integration by which a
slice halts a query when it is satisfied has to be tested against a
QueryEngine
.
This must also be tested in scale-out to make sure that the data backing
the solutions is not discarded before the caller can use those data.
[This could be handled by materializing binding set objects out of a
ByteBuffer
rather than using a live decode of the data in that
ByteBuffer
.]
Exception
public void test_query_join_withConstraint() throws Exception
IConstraint
.Exception
public void test_query_join2() throws Exception
Exception
public void test_queryJoin2_stressTest() throws Exception
test_query_join2()
which runs a fixed number of
presentations in a single thread.Exception
public void test_queryJoin2_concurrentStressTest() throws Exception
#test_queryJoin2()
which runs a fixed
number of trials on a pool of N=10 threads.Exception
protected int doStressTest(long timeout, int ntrials, int poolSize) throws Exception
timeout
- ntrials
- poolSize
- Exception
public void test_query_join2_optionals() throws Exception
SliceOp
. The 2nd join is marked as optional. Intermediate results
which do not succeed on the optional join are forwarded to the
SliceOp
which is the target specified by the
PipelineOp.Annotations#ALT_SINK_REF
.Exception
public void test_query_join2_conditionalRoutingTrue() throws Exception
ConditionalRoutingOp
. This test case tests when the
condition is true (the joins are not skipped) in which case the test
(and results) are essentially identical to test_query_join2().Exception
public void test_query_join2_conditionalRoutingFalse() throws Exception
ConditionalRoutingOp
. This test case tests when the
condition is false (the joins are skipped).Exception
public void testLatchExecutorProgression() throws InterruptedException
InterruptedException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.