Пример #1
0
 @Test
 @Ignore
 public void testNullValue() throws InvalidExpressionException {
   Entity rootEntity = record.getRootEntity();
   Entity item = addItem(rootEntity, null, 5.5d);
   RealAttribute total = (RealAttribute) item.get("total", 0);
   assertEquals(Double.valueOf(0d), total.getValue().getValue());
 }
Пример #2
0
  @Test
  @Ignore
  public void testUpdateAttribute() throws InvalidExpressionException {
    Entity rootEntity = record.getRootEntity();
    Entity item = addItem(rootEntity, 10, 5.5d);

    RealAttribute total = (RealAttribute) item.get("total", 0);
    RealValue calculatedTotal = total.getValue();
    assertEquals(new RealValue(55d, null), calculatedTotal);

    // change dependent attribute
    IntegerAttribute qty = (IntegerAttribute) item.get("qty", 0);
    qty.setNumber(20);
    //		qty.clearDependentCalculatedAttributes();

    calculatedTotal = total.getValue();
    assertEquals(new RealValue(110d, null), calculatedTotal);
  }
Пример #3
0
 @Test
 @Ignore
 public void testNotNullValues() throws InvalidExpressionException {
   Entity rootEntity = record.getRootEntity();
   Entity item = addItem(rootEntity, 10, 5.5d);
   RealAttribute total = (RealAttribute) item.get("total", 0);
   RealValue calculatedTotal = total.getValue();
   assertEquals(new RealValue(55d, null), calculatedTotal);
 }