You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Nick Johnson (JIRA)" <ji...@apache.org> on 2008/05/02 21:08:55 UTC

[jira] Created: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

WicketTester executeAjaxEvent onclick generating non-AJAX response
------------------------------------------------------------------

                 Key: WICKET-1582
                 URL: https://issues.apache.org/jira/browse/WICKET-1582
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.4
         Environment: Wicket 1.3-SNAPSHOT as of today
            Reporter: Nick Johnson


Executing: 
		tester.executeAjaxEvent("linky", "onclick");
		tester.assertComponentOnAjaxResponse(component);
throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).

Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.

I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Nick Johnson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Johnson updated WICKET-1582:
---------------------------------

    Attachment: wicket1582.jar

Simple test case showing nonequivalent behaviour between executeAjaxEvent("foo", "onclick") and clickLink("foo"). 

> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho updated WICKET-1582:
------------------------------------

        Fix Version/s: 1.4-M4
    Affects Version/s: 1.4-M3

> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4, 1.4-M3
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.5, 1.4-M4
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635279#action_12635279 ] 

thrantal edited comment on WICKET-1582 at 9/28/08 8:48 PM:
------------------------------------------------------------------

Nick,

Thanks for reporting!

I now "fixed" this in 1.3.x and trunk by making this possible

{code:java}
        @Test
        public void testClickingAjaxLinkWithOnclick() {
            final WicketTester tester = new WicketTester() {
            @Override
            protected WebRequestCycle resolveRequestCycle() {
                    return setupRequestAndResponse(true);
            }
        };
        tester.startPage(MyPage.class);

        final Component component = tester.getComponentFromLastRenderedPage("spanny");
        assertNotNull(component);
        
        tester.executeAjaxEvent("linky", "onclick");
        tester.assertComponentOnAjaxResponse(component);
{code}

The reasoning can be found in this thread (hard to get the Nabble link right in this Jira without Confluence markup)

http://www.nabble.com/WICKET-1582-blocked-by-WICKET-254-td19521561.html#a19521561

Theoretically, the default could be the other way around, but then it would change the current behaviour and make existing tests fail :/ Anyway I think that in big projects you tend to have common places where WicketTester gets initialised and where you can change this if you want it in all your tests.

Are you happy with this solution and can the issue be closed? Or do you have better ideas?

      was (Author: thrantal):
    Nick,

Thanks for reporting!

I now "fixed" this in 1.3.x and trunk by making this possible

{code:java}
        @Test
        public void testClickingAjaxLinkWithOnclick() {
            final WicketTester tester = new WicketTester() {
            @Override
            protected WebRequestCycle resolveRequestCycle() {
                    return setupRequestAndResponse(true);
            }
        };
        tester.startPage(MyPage.class);

        final Component component = tester.getComponentFromLastRenderedPage("spanny");
        assertNotNull(component);
        
        tester.executeAjaxEvent("linky", "onclick");
        tester.assertComponentOnAjaxResponse(component);
{code}

The reasoning can be found in [this thread|http://www.nabble.com/WICKET-1582-blocked-by-WICKET-254-td19521561.html#a19521561]

http://www.nabble.com/WICKET-1582-blocked-by-WICKET-254-td19521561.html#a19521561

Theoretically, the default could be the other way around, but then it would change the current behaviour and make existing tests fail :/ Anyway I think that in big projects you tend to have common places where WicketTester gets initialised and where you can change this if you want it in all your tests.

Are you happy with this solution and can the issue be closed? Or do you have better ideas?
  
> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.5
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Martijn Dashorst (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martijn Dashorst updated WICKET-1582:
-------------------------------------

    Fix Version/s:     (was: 1.3.4)
                   1.3.5

> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Maurice Marrink
>             Fix For: 1.3.5
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635279#action_12635279 ] 

thrantal edited comment on WICKET-1582 at 9/28/08 8:47 PM:
------------------------------------------------------------------

Nick,

Thanks for reporting!

I now "fixed" this in 1.3.x and trunk by making this possible

{code:java}
        @Test
        public void testClickingAjaxLinkWithOnclick() {
            final WicketTester tester = new WicketTester() {
            @Override
            protected WebRequestCycle resolveRequestCycle() {
                    return setupRequestAndResponse(true);
            }
        };
        tester.startPage(MyPage.class);

        final Component component = tester.getComponentFromLastRenderedPage("spanny");
        assertNotNull(component);
        
        tester.executeAjaxEvent("linky", "onclick");
        tester.assertComponentOnAjaxResponse(component);
{code}

The reasoning can be found in [this thread|http://www.nabble.com/WICKET-1582-blocked-by-WICKET-254-td19521561.html#a19521561]

http://www.nabble.com/WICKET-1582-blocked-by-WICKET-254-td19521561.html#a19521561

Theoretically, the default could be the other way around, but then it would change the current behaviour and make existing tests fail :/ Anyway I think that in big projects you tend to have common places where WicketTester gets initialised and where you can change this if you want it in all your tests.

Are you happy with this solution and can the issue be closed? Or do you have better ideas?

      was (Author: thrantal):
    Nick,

Thanks for reporting!

I now "fixed" this in 1.3.x and trunk by making this possible

{code:java}
        @Test
        public void testClickingAjaxLinkWithOnclick() {
            final WicketTester tester = new WicketTester() {
            @Override
            protected WebRequestCycle resolveRequestCycle() {
                    return setupRequestAndResponse(true);
            }
        };
        tester.startPage(MyPage.class);

        final Component component = tester.getComponentFromLastRenderedPage("spanny");
        assertNotNull(component);
        
        tester.executeAjaxEvent("linky", "onclick");
        tester.assertComponentOnAjaxResponse(component);
{code}

The reasoning can be found in this thread

http://www.nabble.com/WICKET-1582-blocked-by-WICKET-254-td19521561.html#a19521561

Theoretically, the default could be the other way around, but then it would change the current behaviour and make existing tests fail :/ Anyway I think that in big projects you tend to have common places where WicketTester gets initialised and where you can change this if you want it in all your tests.

Are you happy with this solution and can the issue be closed? Or do you have better ideas?
  
> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.5
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner updated WICKET-1582:
------------------------------------

    Fix Version/s: 1.3.4
         Assignee: Maurice Marrink

> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Maurice Marrink
>             Fix For: 1.3.4
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635279#action_12635279 ] 

Timo Rantalaiho commented on WICKET-1582:
-----------------------------------------

Nick,

Thanks for reporting!

I now "fixed" this in 1.3.x and trunk by making this possible

{code:java}
        @Test
        public void testClickingAjaxLinkWithOnclick() {
            final WicketTester tester = new WicketTester() {
            @Override
            protected WebRequestCycle resolveRequestCycle() {
                    return setupRequestAndResponse(true);
            }
        };
        tester.startPage(MyPage.class);

        final Component component = tester.getComponentFromLastRenderedPage("spanny");
        assertNotNull(component);
        
        tester.executeAjaxEvent("linky", "onclick");
        tester.assertComponentOnAjaxResponse(component);
{code}

The reasoning can be found in this thread

http://www.nabble.com/WICKET-1582-blocked-by-WICKET-254-td19521561.html#a19521561

Theoretically, the default could be the other way around, but then it would change the current behaviour and make existing tests fail :/ Anyway I think that in big projects you tend to have common places where WicketTester gets initialised and where you can change this if you want it in all your tests.

Are you happy with this solution and can the issue be closed? Or do you have better ideas?

> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.5
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho reassigned WICKET-1582:
---------------------------------------

    Assignee: Timo Rantalaiho  (was: Maurice Marrink)

> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.5
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1582) WicketTester executeAjaxEvent onclick generating non-AJAX response

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho resolved WICKET-1582.
-------------------------------------

    Resolution: Fixed

Resolving for now to not block releases because of this. Please create a new issue if you're not happy with this workaround.

> WicketTester executeAjaxEvent onclick generating non-AJAX response
> ------------------------------------------------------------------
>
>                 Key: WICKET-1582
>                 URL: https://issues.apache.org/jira/browse/WICKET-1582
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4, 1.4-M3
>         Environment: Wicket 1.3-SNAPSHOT as of today
>            Reporter: Nick Johnson
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.5, 1.4-M4
>
>         Attachments: wicket1582.jar
>
>
> Executing: 
> 		tester.executeAjaxEvent("linky", "onclick");
> 		tester.assertComponentOnAjaxResponse(component);
> throws an exception saying "The Previous response was not an AJAX response. You need to execute an AJAX event, using clickLink, before using this assert" although executeAjaxEvent should be resulting in an AJAX response (and prior to 1.3.3 it did).
> Executing tester.clickLink("linky"), which probably should be equivalent to the above executeAjaxEvent, does work.
> I'll attach a simple testcase demonstrating this behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.