Does this test pass? This should be 
      BigDecimal v = (BigDecimal)e.getDataType().toObject(ptr);
as you're casting from an INTEGER to a DECIMAL.

Then the asserEquals should be assertTrue(v.compareTo(BigDecimal.valueOf(1)) == 0);