Examples of ModelElementFunctionContext


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

    @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.ModelElementFunctionContext

    @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.ModelElementFunctionContext

    @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.ModelElementFunctionContext

        child.setIntegerProp( 2 );
        child.setStringProp( "DEF" );
        grandchild.setIntegerProp( 3 );
        grandchild.setStringProp( "GHI" );
       
        final FunctionContext context = new ModelElementFunctionContext( root );
       
        test( expr, expected, context );
    }
View Full Code Here

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

   
    protected static void testForExpectedValue( final Element element,
                                                final String expr,
                                                final Object expected )
    {
        testForExpectedValue( new ModelElementFunctionContext( element ), expr, expected );
    }
View Full Code Here

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

    public void testWithModelElementList()
    {
        final TestModelRoot root = TestModelRoot.TYPE.instantiate();
        final ElementList<TestModelElementA> list = root.getList1();
        final FunctionContext context = new ModelElementFunctionContext( root );
       
        TestModelElementA a;
       
        testForExpectedValue( context, "${ Avg( List1 ) }", new BigDecimal( "0" ) );
        testForExpectedValue( context, "${ Avg( List1, 'Value1' ) }", new BigDecimal( "0" ) );
View Full Code Here

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

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

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

                   
                    this.invalidValueMessageFunction = FailSafeFunction.create( ExpressionLanguageParser.parse( this.invalidValueMessage ), String.class, def );
                }
            }
           
            final FunctionResult messageFunctionResult = this.invalidValueMessageFunction.evaluate( new ModelElementFunctionContext( value.element() ) );
           
            try
            {
                return Status.createStatus( this.invalidValueSeverity, (String) messageFunctionResult.value() );
            }
View Full Code Here

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

    @Test
   
    public void testFragmentFunction()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        FunctionResult fr = ExpressionLanguageParser.parse( "${ Value.Fragment( 0, 3 ) }" ).evaluate( context );
       
        try
        {
View Full Code Here

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

    @Test
   
    public void testHeadFunction()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        FunctionResult fr = ExpressionLanguageParser.parse( "${ Value.Head( 3 ) }" ).evaluate( context );
       
        try
        {
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.