Package co.nubetech.crux.server.functions

Examples of co.nubetech.crux.server.functions.Ceil


  @Test
  public void testApplyFunctionsAggregateFirst() throws CruxException{
    Stack<CruxFunction> xFnStack = new Stack<CruxFunction>();
    SumDoubleAggregator summer = new SumDoubleAggregator();
    xFnStack.push(summer);
    xFnStack.push(new Ceil());
    byte[] value = Bytes.toBytes(new Double(54.5d));
    FunctionUtil.applyAggregateFunctions(value, xFnStack);
    byte[] value1 = Bytes.toBytes(new Double(5.25d));
    FunctionUtil.applyAggregateFunctions(value1, xFnStack);
    assertEquals(59.75d, summer.getAggregate());
View Full Code Here


  @Test
  public void testApplyFunctionsNonAggregateFirst() throws CruxException{
    GroupingAggregationImpl impl = new GroupingAggregationImpl();
    Stack<CruxFunction> xFnStack = new Stack<CruxFunction>();
    SumDoubleAggregator summer = new SumDoubleAggregator();
    xFnStack.push(new Ceil());
    xFnStack.push(summer);
    byte[] value = Bytes.toBytes(new Double(54.5d));
    FunctionUtil.applyAggregateFunctions(value, xFnStack);
    byte[] value1 = Bytes.toBytes(new Double(5.25d));
    FunctionUtil.applyAggregateFunctions(value1, xFnStack);
View Full Code Here

  @Test
  public void testGetSemiAggregatedResultNonAggregateFirst() throws CruxException{
    Stack<CruxFunction> xFnStack = new Stack<CruxFunction>();
    SumDoubleAggregator summer = new SumDoubleAggregator();
    summer.aggregate(Bytes.toBytes(new Double(54.5d)));
    xFnStack.push(new Ceil());
    xFnStack.push(summer);
    assertEquals(54.5d, FunctionUtil.getSemiAggregatedResult(xFnStack));
  }
View Full Code Here

  public void testGetSemiAggResultAggregateFirst() throws CruxException{
    Stack<CruxFunction> xFnStack = new Stack<CruxFunction>();
    SumDoubleAggregator summer = new SumDoubleAggregator();
    summer.aggregate(Bytes.toBytes(new Double(54.5d)));
    xFnStack.push(summer);
    xFnStack.push(new Ceil());
    assertEquals(54.5d, FunctionUtil.getSemiAggregatedResult(xFnStack));
  }
View Full Code Here

  @Test
  public void testGetSimpleFunctionResultWithAggFn() throws CruxException{
    //getSimpleFunctionResult
    Stack<CruxFunction> xFnStack = new Stack<CruxFunction>();
    xFnStack.push(new SumDoubleAggregator());
    xFnStack.push(new Ceil());   
    System.out.println("Value is " + FunctionUtil.getSimpleFunctionResult(Bytes.toBytes(1234.5d),
        xFnStack));
    assertEquals(1235.0d, FunctionUtil.getSimpleFunctionResult(Bytes.toBytes(1234.5d),
        xFnStack));
  }
View Full Code Here

 
  @Test
  public void testGetSimpleFunctionResult() throws CruxException{
    //getSimpleFunctionResult
    Stack<CruxFunction> xFnStack = new Stack<CruxFunction>();
    xFnStack.push(new Ceil());
    System.out.println("Value is " + FunctionUtil.getSimpleFunctionResult(Bytes.toBytes(56.4d),
        xFnStack));
    assertEquals(57d, FunctionUtil.getSimpleFunctionResult( Bytes.toBytes(56.4d),
        xFnStack));
  }
View Full Code Here

TOP

Related Classes of co.nubetech.crux.server.functions.Ceil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.