Package org.eclipse.sapphire.modeling.el

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


   
    @Test
   
    public void testWithList()
    {
        FunctionContext context;
       
        context = new TestFunctionContext( list() );
        testForExpectedValue( context, "${ Sum( Collection ) }", new BigDecimal( "0" ) );

        context = new TestFunctionContext( list( "1" ) );
View Full Code Here


{
    @Test
   
    public void testWithArray()
    {
        FunctionContext context;
       
        context = new TestFunctionContext( new Object[] {} );
        testForExpectedValue( context, "${ Min( Collection ) }", null );

        context = new TestFunctionContext( new Object[] { "1" } );
View Full Code Here

   
    @Test
   
    public void testWithSet()
    {
        FunctionContext context;
       
        context = new TestFunctionContext( set() );
        testForExpectedValue( context, "${ Sum( Collection ) }", new BigDecimal( "0" ) );

        context = new TestFunctionContext( set( "1" ) );
View Full Code Here

   
    @Test
   
    public void testWithList()
    {
        FunctionContext context;
       
        context = new TestFunctionContext( list() );
        testForExpectedValue( context, "${ Min( Collection ) }", null );

        context = new TestFunctionContext( list( "1" ) );
View Full Code Here

    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, "${ Sum( List1 ) }", new BigDecimal( "0" ) );
        testForExpectedValue( context, "${ Sum( List1, 'Value1' ) }", new BigDecimal( "0" ) );
View Full Code Here

   
    @Test
   
    public void testWithSet()
    {
        FunctionContext context;
       
        context = new TestFunctionContext( set() );
        testForExpectedValue( context, "${ Min( Collection ) }", null );

        context = new TestFunctionContext( set( "1" ) );
View Full Code Here

    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, "${ Min( List1 ) }", null );
        testForExpectedValue( context, "${ Min( List1, 'Value1' ) }", null );
View Full Code Here

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

            for( int i = 0, n = inputOperands.size(); i < n; i++ )
            {
                assertSame( inputOperands.get( i ), function.operand( i ) );
            }
           
            testForExpectedValue( new FunctionContext(), function, expectedResult );
        }
View Full Code Here

{
    @Test
   
    public void testLiteral2()
    {
        final FunctionContext context = new FunctionContext();
        testForExpectedValue( context, "${ InstanceOf( 12345, 'java.math.BigInteger' ) }", true );
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.el.FunctionContext

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.