{
@Test
public void testMessageFunction()
{
final TestElement element = TestElement.TYPE.instantiate();
final FunctionContext context = new ModelElementFunctionContext( element );
final FunctionResult fr = ExpressionLanguageParser.parse( "${ IntegerValue.Validation.Message }" ).evaluate( context );
try
{
assertEquals( "ok", fr.value() );
element.setIntegerValue( 3 );
assertEquals( "ok", fr.value() );
element.setIntegerValue( "abc" );
assertEquals( "\"abc\" is not a valid integer", fr.value() );
element.setIntegerValue( 4 );
assertEquals( "ok", fr.value() );
}
finally
{
fr.dispose();