01: package org.drools.base;
02:
03: import java.math.BigDecimal;
04: import java.math.BigInteger;
05:
06: import junit.framework.TestCase;
07:
08: import org.drools.spi.FieldValue;
09:
10: public class FieldFactoryTest extends TestCase {
11:
12: public void testBigDecimal() {
13: final FieldValue val = FieldFactory.getFieldValue("42.42",
14: ValueType.BIG_DECIMAL_TYPE);
15: assertEquals(BigDecimal.class, val.getValue().getClass());
16: assertTrue(val.getValue().equals(new BigDecimal("42.42")));
17: }
18:
19: public void testBigInteger() {
20: final FieldValue val = FieldFactory.getFieldValue("424242",
21: ValueType.BIG_INTEGER_TYPE);
22: assertEquals(BigInteger.class, val.getValue().getClass());
23: assertTrue(val.getValue().equals(new BigInteger("424242")));
24: }
25:
26: }
|