/*
* *************************************************************************************
* Copyright (C) 2008 EsperTech, Inc. All rights reserved. *
* http://esper.codehaus.org *
* http://www.espertech.com *
* ---------------------------------------------------------------------------------- *
* The software in this package is published under the terms of the GPL license *
* a copy of which has been included with this distribution in the license.txt file. *
* *************************************************************************************
*/
package com.espertech.esper.epl.expression;
import com.espertech.esper.support.epl.SupportExprNode;
import com.espertech.esper.support.epl.SupportExprNodeFactory;
public class TestExprStddevNode extends TestExprAggregateNodeAdapter
{
public void setUp() throws Exception
{
super.validatedNodeToTest = makeNode(5, Integer.class);
}
public void testGetType() throws Exception
{
assertEquals(Double.class, validatedNodeToTest.getType());
}
public void testToExpressionString() throws Exception
{
assertEquals("stddev(5)", validatedNodeToTest.toExpressionString());
}
public void testEqualsNode() throws Exception
{
assertTrue(validatedNodeToTest.equalsNode(validatedNodeToTest));
assertFalse(validatedNodeToTest.equalsNode(new ExprSumNode(false, false)));
}
private ExprStddevNode makeNode(Object value, Class type) throws Exception
{
ExprStddevNode stddevNode = new ExprStddevNode(false, false);
stddevNode.addChildNode(new SupportExprNode(value, type));
SupportExprNodeFactory.validate3Stream(stddevNode);
return stddevNode;
}
}