Bug 175859 [DataBinding] Use MessageFormat for validation hints
The default hints produced by String2IntegerPrimitiveValidator and its peers are not very pleasant. They print extremely long numbers, are missing spaces, etc. For I18n, these hints should be produced via MessageFormat patterns, rather than with a hard-coded structure. This would also allow clients to override the messages by providing replacement patterns in a fragment. Boris, are there any issues with using java.text.MessageFormat under Foundation profiles? Should an ICU equivalent be used instead?
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
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");
		} catch (IllegalArgumentException e) {
		}
	}
	
	/**
	 * Asserts a use case where the integer starts with a valid value but ends
	 * in an unparsable format.
	 * 
	 * @throws Exception
	 */
	public void testInvalidInteger() throws Exception {
		StringToNumberConverter converter = StringToNumberConverter
				.toInteger(false);
		try {
			converter.convert("1 1 1");
			fail("exception should have been thrown");
		} catch (IllegalArgumentException e) {
		}
	}
}