Package org.yaac.server.egql.processor.ProcessData

Examples of org.yaac.server.egql.processor.ProcessData.ProcessDataRecord.lookup()


public class EvaluationWithContextTest {

  @Test
  public void test1() throws Exception {   
    ProcessDataRecord record = mock(ProcessDataRecord.class);
    when(record.lookup("a")).thenReturn(new EvaluationResult(null, null, null, new BigDecimal("1.5")));
   
    assertEquals(new EvaluationResult(new BigDecimal("5.5")), evaluate("4 + a", record));
  }
 
  @Test
View Full Code Here


  }
 
  @Test
  public void test2() throws Exception {   
    ProcessDataRecord record = mock(ProcessDataRecord.class);
    when(record.lookup("a")).thenReturn(new EvaluationResult(null, null, null, new BigDecimal("1.5")));
    when(record.lookup("b")).thenReturn(new EvaluationResult(null, null, null, new BigDecimal("4.5")));
   
    assertEquals(new BigDecimal("3"), evaluate("b / a", record).getPayload());
  }
}
View Full Code Here

 
  @Test
  public void test2() throws Exception {   
    ProcessDataRecord record = mock(ProcessDataRecord.class);
    when(record.lookup("a")).thenReturn(new EvaluationResult(null, null, null, new BigDecimal("1.5")));
    when(record.lookup("b")).thenReturn(new EvaluationResult(null, null, null, new BigDecimal("4.5")));
   
    assertEquals(new BigDecimal("3"), evaluate("b / a", record).getPayload());
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.