Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.ExpressionEvaluator


    }

    public void test_Read_Fail()
    {
        Fixture f = new Fixture();
        ExpressionEvaluator ee = create();

        try
        {
            ee.read(f, "bar");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to read OGNL expression");
View Full Code Here


    public void test_Write()
    {
        Fixture f = new Fixture("Foo");

        ExpressionEvaluator ee = create();
        trainIntialize(ee);
       
        ee.write(f, "value", "Bar");

        assertEquals("Bar", f.getValue());
    }
View Full Code Here

    }

    public void test_Write_Fail()
    {
        Fixture f = new Fixture();
        ExpressionEvaluator ee = create();

        try
        {
            ee.write(f, "class", "Foo");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to update OGNL expression");
View Full Code Here

        return spec;
    }

    public void test_Is_Constant_Fail()
    {
        ExpressionEvaluator ee = create();

        try
        {
            ee.isConstant("@foo@BAR");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Error evaluating OGNL expression");
View Full Code Here

        assertNotSame(c1, c2);
    }

    public void test_Compiled_Caching()
    {
        ExpressionEvaluator evaluator = newMock(ExpressionEvaluator.class);
        ExpressionCacheImpl ec = new ExpressionCacheImpl();
        ec.setEvaluator(evaluator);
       
        BasicObject target = new BasicObject();
        OgnlContext context = new OgnlContext();
       
        expect(evaluator.createContext(target)).andReturn(context);
       
        replay();
       
        Node e1 = (Node)ec.getCompiledExpression(target, "value");
       
View Full Code Here

   
    // fails only when running from command line, must be threading issue
    @Test(enabled = false)
    public void test_Clear_Cache()
    {
        ExpressionEvaluator evaluator = newMock(ExpressionEvaluator.class);
        ExpressionCacheImpl ec = new ExpressionCacheImpl();
        ec.setEvaluator(evaluator);
       
        BasicObject target = new BasicObject();
        OgnlContext context = new OgnlContext();
       
        expect(evaluator.createContext(target)).andReturn(context).anyTimes();
       
        replay();
       
        Node e1 = (Node)ec.getCompiledExpression(target, "value");
       
View Full Code Here

    public void testRead()
    {
        Fixture f = new Fixture("Foo");

        ExpressionEvaluator ee = create();

        assertEquals("Foo", ee.read(f, "value"));
    }
View Full Code Here

    public void testReadFail()
    {
        Fixture f = new Fixture();

        ExpressionEvaluator ee = create();

        try
        {
            ee.read(f, "bar");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to read OGNL expression");
View Full Code Here

    public void testWrite()
    {
        Fixture f = new Fixture("Foo");

        ExpressionEvaluator ee = create();

        ee.write(f, "value", "Bar");

        assertEquals("Bar", f.getValue());
    }
View Full Code Here

    public void testWriteFail()
    {
        Fixture f = new Fixture();

        ExpressionEvaluator ee = create();

        try
        {
            ee.write(f, "class", "Foo");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to update OGNL expression");
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.ExpressionEvaluator

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.