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