You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Anatol Pomozov <an...@epam.com> on 2004/04/05 15:45:44 UTC

Tests are not passed with ognl-2.6.4

  I have tried to replace ognl-2.6.3 with 2.6.4 version and tests were
  failed with the following message

     [java] There was 1 failure:
     [java] 1) testTypeConverter(org.apache.tapestry.junit.TestBindings)junit.framework.AssertionFailedError: Should not be able to call setDateValue(Date)
     [java]     at org.apache.tapestry.junit.TestBindings.testTypeConverter(TestBindings.java:737)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  


  There is a snip of the unit test code

        BoundPage page = new BoundPage();
        MockEngine engine = new MockEngine();
        page.setEngine(engine);

        ExpressionBinding binding = new ExpressionBinding(_resolver, page, "dateValue", null);
        Date date = new Date();

        try {
            // try without a converter first, which should fail
            binding.setObject(date);
            fail("Should not be able to call setDateValue(Date)");
            //There exception throws ^^^^^^^^^^^^
        }
        catch (BindingException expected) {
            assertTrue(true);
        }

        ......
        public class BoundPage extends MockPage
        {
               public void setDateValue(Timestamp dateValue) {
                      _dateValue = dateValue;
               }
        }



        
I also have tried ognl-2.6.5 - the same.

-- 
Best regards,
 anatol


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Tests are not passed with ognl-2.6.4

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
I forwarded this message to Drew, aka Mr. OGNL.

That test case is the one I created - I'll try to look at it further  
tomorrow but there is an obvious regression (or misunderstanding) if it  
works with 2.6.3, but not later versions.

	Erik


On Apr 5, 2004, at 9:45 AM, Anatol Pomozov wrote:

>   I have tried to replace ognl-2.6.3 with 2.6.4 version and tests were
>   failed with the following message
>
>      [java] There was 1 failure:
>      [java] 1)  
> testTypeConverter(org.apache.tapestry.junit.TestBindings)junit.framewor 
> k.AssertionFailedError: Should not be able to call setDateValue(Date)
>      [java]     at  
> org.apache.tapestry.junit.TestBindings.testTypeConverter(TestBindings.j 
> ava:737)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
> Method)
>      [java]     at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja 
> va:39)
>      [java]     at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> rImpl.java:25)
>
>
>   There is a snip of the unit test code
>
>         BoundPage page = new BoundPage();
>         MockEngine engine = new MockEngine();
>         page.setEngine(engine);
>
>         ExpressionBinding binding = new ExpressionBinding(_resolver,  
> page, "dateValue", null);
>         Date date = new Date();
>
>         try {
>             // try without a converter first, which should fail
>             binding.setObject(date);
>             fail("Should not be able to call setDateValue(Date)");
>             //There exception throws ^^^^^^^^^^^^
>         }
>         catch (BindingException expected) {
>             assertTrue(true);
>         }
>
>         ......
>         public class BoundPage extends MockPage
>         {
>                public void setDateValue(Timestamp dateValue) {
>                       _dateValue = dateValue;
>                }
>         }
>
>
>
>
> I also have tried ognl-2.6.5 - the same.
>
> -- 
> Best regards,
>  anatol
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org