protected void setUp() throws Exception {
   super.setUp();
   this.field1 = FieldFactory.getFieldValue(null);
   this.field2 = FieldFactory.getFieldValue(null);
   this.field3 = FieldFactory.getFieldValue("A");
   this.field4 = FieldFactory.getFieldValue("A");
   this.field5 = FieldFactory.getFieldValue("B");
 }
Esempio n. 2
0
  public void testDate() throws Exception {
    SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
    String s = df.format(df.parse("10-Jul-1974"));
    final FieldValue val =
        FieldFactory.getFieldValue(s, ValueType.DATE_TYPE, new DateFormatsImpl());
    assertEquals(Date.class, val.getValue().getClass());

    Date dt = (Date) val.getValue();
    assertEquals(s, df.format(dt));
  }
Esempio n. 3
0
 public void testBigInteger() {
   final FieldValue val =
       FieldFactory.getFieldValue("424242", ValueType.BIG_INTEGER_TYPE, new DateFormatsImpl());
   assertEquals(BigInteger.class, val.getValue().getClass());
   assertTrue(val.getValue().equals(new BigInteger("424242")));
 }
Esempio n. 4
0
 public void testBigDecimal() {
   final FieldValue val =
       FieldFactory.getFieldValue("42.42", ValueType.BIG_DECIMAL_TYPE, new DateFormatsImpl());
   assertEquals(BigDecimal.class, val.getValue().getClass());
   assertTrue(val.getValue().equals(new BigDecimal("42.42")));
 }