use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class TestAggregateSymbol method testEquivalenceCaseInsens.
public void testEquivalenceCaseInsens() {
// $NON-NLS-1$
AggregateSymbol test1 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
// $NON-NLS-1$
AggregateSymbol test2 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
int equals = 0;
UnitTestUtil.helpTestEquivalence(equals, test1, test2);
}
use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class TestAggregateSymbol method testNonEquivalenceUsingDiffElements.
public void testNonEquivalenceUsingDiffElements() {
// $NON-NLS-1$
AggregateSymbol test1 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
// $NON-NLS-1$
AggregateSymbol test2 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement2());
int equals = -1;
UnitTestUtil.helpTestEquivalence(equals, test1, test2);
}
use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class TestAggregateSymbol method testNonEquivalence1.
public void testNonEquivalence1() {
// $NON-NLS-1$
AggregateSymbol test1 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
// $NON-NLS-1$
AggregateSymbol test2 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement2());
int equals = -1;
UnitTestUtil.helpTestEquivalence(equals, test1, test2);
}
use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class TestAggregateSymbol method testSelfEquivalence.
public void testSelfEquivalence() {
// $NON-NLS-1$
AggregateSymbol test = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
int equals = 0;
UnitTestUtil.helpTestEquivalence(equals, test, test);
}
use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class TestGroupingNode method testDefect5769.
@Test
public void testDefect5769() throws Exception {
BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
// $NON-NLS-1$
ElementSymbol bigDecimal = new ElementSymbol("value");
bigDecimal.setType(DataTypeManager.DefaultDataClasses.BIG_DECIMAL);
// Set up
GroupingNode node = new GroupingNode(1);
List outputElements = new ArrayList();
// $NON-NLS-1$ //$NON-NLS-2$
outputElements.add(new AggregateSymbol("SUM", false, bigDecimal));
// $NON-NLS-1$ //$NON-NLS-2$
outputElements.add(new AggregateSymbol("AVG", false, bigDecimal));
node.setElements(outputElements);
// $NON-NLS-1$ //$NON-NLS-2$
CommandContext context = new CommandContext("pid", "test", null, null, 1);
List[] data = new List[] { // $NON-NLS-1$
Arrays.asList(new Object[] { new BigDecimal("0.0") }), // $NON-NLS-1$
Arrays.asList(new Object[] { new BigDecimal("1.0") }), // $NON-NLS-1$
Arrays.asList(new Object[] { new BigDecimal("2.0") }), // $NON-NLS-1$
Arrays.asList(new Object[] { new BigDecimal("3.0") }), // $NON-NLS-1$
Arrays.asList(new Object[] { new BigDecimal("4.0") }) };
List[] expected = new List[] { // $NON-NLS-1$ //$NON-NLS-2$
Arrays.asList(new Object[] { new BigDecimal("10.0"), new BigDecimal("2.0") }) };
List symbols = new ArrayList();
symbols.add(bigDecimal);
FakeTupleSource dataSource = new FakeTupleSource(symbols, data);
helpProcess(mgr, node, context, expected, dataSource, null);
}
Aggregations