Example #1
0
 public void testToLongWithLargeValue() {
   try {
     ScalarValue value = string(" 9223372036854775808");
     value.toLong();
     fail();
   } catch (FastException e) {
     assertEquals(FastConstants.R4_NUMERIC_VALUE_TOO_LARGE, e.getCode());
   }
 }
Example #2
0
 public void testToIntWithLargeValue() {
   try {
     ScalarValue value = string("2147483648");
     value.toInt();
     fail();
   } catch (FastException e) {
     assertEquals(FastConstants.R4_NUMERIC_VALUE_TOO_LARGE, e.getCode());
   }
 }
Example #3
0
 public void testToString() {
   ScalarValue value = string("1234abcd");
   assertEquals("1234abcd", value.toString());
 }
Example #4
0
 public void testToDouble() {
   ScalarValue value = string("  -1.234 ");
   assertEquals(-1.234, value.toDouble(), .001);
 }
Example #5
0
 public void testToLong() {
   ScalarValue value = string("2147483648");
   assertEquals(2147483648L, value.toLong());
 }
Example #6
0
 public void testToInt() {
   ScalarValue value = string("32768");
   assertEquals(32768, value.toInt());
 }
Example #7
0
 public void testToShort() {
   ScalarValue value = string("128");
   assertEquals((short) 0x80, value.toShort());
 }
Example #8
0
 public void testToByte() {
   ScalarValue value = string("5");
   assertEquals(0x05, value.toByte());
 }