public class TestGroupByRewriter extends TestCase2
GroupByRewriter
.
Note: This test suite is actually written at the
GroupByRewriter.rewrite(IValueExpression, IVariableFactory, LinkedHashMap)
and
GroupByRewriter.rewrite(IConstraint, IVariableFactory, LinkedHashMap)
level (those are static methods). This is good, but we do not have unit tests
at the GroupByRewriter
level.
TestCase2.MyProperties, TestCase2.RandomType
_randomType, log
Constructor and Description |
---|
TestGroupByRewriter() |
TestGroupByRewriter(String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
setUp() |
protected void |
tearDown() |
void |
test_constant_not_rewritten()
Test that a bare constant is NOT rewritten.
|
void |
test_eliminate_duplicate_aggregate_expressions()
Test elimination of duplicate
IAggregate expressions. |
void |
test_lift_aggregate_expression_nested_in_aggregateExpr()
Test lifting of nested
IAggregate expressions: |
void |
test_lift_aggregate_expression_nested_in_plain_valueExpr()
Test lifting of
IAggregate expressions within value expressions: |
void |
test_rewrite_lift_bare_aggregate_expression()
Test lifting of bare
IAggregate expression: |
void |
test_variable_not_rewritten()
Test that a bare variable is NOT rewritten.
|
void |
test_with_having()
Test that
IAggregate expressions are also lifted out of a HAVING
clause. |
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, getProperties, 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 TestGroupByRewriter()
public TestGroupByRewriter(String name)
name
- protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public void test_variable_not_rewritten()
SELECT ?x GROUP BY ?x
public void test_constant_not_rewritten()
SELECT 12
public void test_rewrite_lift_bare_aggregate_expression()
IAggregate
expression:
SELECT SUM(?x) as ?yis rewritten as
aggExp := SUM(?x) as ?_0 select := ?_0 as ?y
public void test_with_having()
IAggregate
expressions are also lifted out of a HAVING
clause.
SELECT ?org GROUP BY ?org HAVING sum(?x)>10
public void test_eliminate_duplicate_aggregate_expressions()
IAggregate
expressions.
SELECT SUM(?x) as ?y, SUM(x) as ?z
public void test_lift_aggregate_expression_nested_in_plain_valueExpr()
IAggregate
expressions within value expressions:
SELECT 1+SUM(?x) as ?y
public void test_lift_aggregate_expression_nested_in_aggregateExpr()
IAggregate
expressions:
SELECT SUM(x+MIN(x))
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.