Examples of FunctionContext


Examples of org.eclipse.sapphire.modeling.el.FunctionContext

   
    @Test

    public void testUnknownType()
    {
        final FunctionContext context = new FunctionContext();
        testForExpectedValue( context, "${ InstanceOf( 12345, 'java.lang.FooBar' ) }", false );
    }
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

    @Test
   
    public void testMatchesFunction()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Value.Matches( '[a-z][a-z0-9]*' ) }" ).evaluate( context );
       
        try
        {
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

    @Test
   
    public void testFailSafeWithBoolean()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        element.setBooleanValue( "abc" );
        element.setBooleanValueWithDefault( "abc" );
       
        assertEquals( "abc", element.getBooleanValue().text() );
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

    @Test
   
    public void testFailSafeWithInteger()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        element.setIntegerValue( "abc" );
        element.setIntegerValueWithDefault( "abc" );
       
        assertEquals( "abc", element.getIntegerValue().text() );
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

    @Test
   
    public void testFailSafeWithEnum()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        element.setEnumValue( "abc" );
        element.setEnumValueWithDefault( "abc" );
       
        assertEquals( "abc", element.getEnumValue().text() );
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

   
    public void GlobalFunction()
    {
        Sapphire.global().remove( "Test" );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Global.Test }" ).evaluate( new FunctionContext() );
       
        try
        {
            assertNull( fr.value() );
           
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

{
    @Test
   
    public void testListToString()
    {
        final FunctionContext context = new FunctionContext();
       
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( list() ), Literal.create( String.class ) ), "" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( list( "x" ) ), Literal.create( String.class ) ), "x" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( list( "x", "y" ) ), Literal.create( String.class ) ), "x,y" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( list( "x", "y", "z" ) ), Literal.create( String.class ) ), "x,y,z" );
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

   
    @Test

    public void testSetToString()
    {
        final FunctionContext context = new FunctionContext();
       
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( set() ), Literal.create( String.class ) ), "" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( set( "x" ) ), Literal.create( String.class ) ), "x" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( set( "x", "y" ) ), Literal.create( String.class ) ), "x,y" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( set( "x", "y", "z" ) ), Literal.create( String.class ) ), "x,y,z" );
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

   
    @Test

    public void testArrayToString()
    {
        final FunctionContext context = new FunctionContext();
       
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( new String[] {} ), Literal.create( String.class ) ), "" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( new String[] { "x" } ), Literal.create( String.class ) ), "x" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( new String[] { "x", "y" } ), Literal.create( String.class ) ), "x,y" );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( new String[] { "x", "y", "z" } ), Literal.create( String.class ) ), "x,y,z" );
View Full Code Here

Examples of org.eclipse.sapphire.modeling.el.FunctionContext

   
    @Test

    public void testStringToList()
    {
        final FunctionContext context = new FunctionContext();
       
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( "" ), Literal.create( List.class ) ), list() );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( "x" ), Literal.create( List.class ) ), list( "x" ) );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( "x,y" ), Literal.create( List.class ) ), list( "x", "y" ) );
        testForExpectedValue( context, FailSafeFunction.create( Literal.create( "x,y,z" ), Literal.create( List.class ) ), list( "x", "y", "z" ) );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.