Bug 180392 [DataBinding] Add support for shorts, bytes, and BigDecimal to StringToNumberConverter
We need to add the appropriate API to StringToNumberConverter and NumberToStringConverter for short and bytes as their boxed types are Numbers as well.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
}
	public void testConvertsToLongPrimitive() throws Exception {
		Long input = new Long(1000);
		StringToNumberConverter converter = StringToNumberConverter.toLong(true);
		Long result = (Long) converter.convert(numberIntegerFormat.format(input
				.longValue()));
		assertEquals(input, result);
	}
	public void testConvertsToFloatPrimitive() throws Exception {
		Float input = new Float(1000);
		StringToNumberConverter converter = StringToNumberConverter.toFloat(true);
		Float result = (Float) converter.convert(numberFormat.format(input
				.floatValue()));
		assertEquals(input, result);
	}
	
	public void testReturnsNullBoxedTypeForEmptyString() throws Exception {
		StringToNumberConverter converter = StringToNumberConverter.toInteger(false);
		try {
			assertNull(converter.convert(""));
		} catch (Exception e) {
			fail("exception should not have been thrown");
		}
	}
	public void testThrowsIllegalArgumentExceptionIfAskedToConvertNonString()
			throws Exception {
		StringToNumberConverter converter = StringToNumberConverter.toInteger(false);
		try {
			converter.convert(new Integer(1));
			fail("exception should have been thrown");