Package org.eclipse.sapphire.tests.modeling.el.functions.severity

Examples of org.eclipse.sapphire.tests.modeling.el.functions.severity.TestElement


{
    @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();
View Full Code Here


   
    @Test

    public void testMessageFunctionNull()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Message( null ) }" ).evaluate( context );
       
        try
View Full Code Here

   
    @Test

    public void testMessageFunctionWrongType()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Message( 'abc' ) }" ).evaluate( context );
       
        try
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.tests.modeling.el.functions.severity.TestElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.