richfaces a4j:poll

View: New views
3 Messages — Rating Filter:   Alert me  

richfaces a4j:poll

by Brian Gregory :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm currently working w/ Stan on the JSFUnit project and I've observed some strange behavior using the latest htmlunit w/ richfaces. How does htmlunit deal with javascript threads that are still running (or in a setTimeout()) when the EnclosingWindow navigates away from that page?

For example, I have a page with an a4j:poll control (richfaces) that essentially makes an ajax call periodically to update something on the page. I've put some log output in the action listener function that gets called when the poller fires so I can see it on the console. When I use click() on a navigation link, and then verify the navigation has occurred, I still periodically see the log ouput as if the poll thread is still running.

I've been trying to write a test that illustrates the problem, but I have no idea how I would verify the thread from a test case.

Any ideas about the problem? Or perhaps ideas about how to go about verifying the behavior in a test?
(Is there a way to inspect the thread manager to see if javascript threads that are associated with a page stay around after the page is gone?)

Brian

Re: richfaces a4j:poll

by gredler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Brian,
 
This could very well be a bug. ThreadManager has an activeCount() method that should only be > 0 if there is some JS waiting to be executed... so you could have a first page that invokes setInterval(), causing activeCount() to go up to 1; then navigate to the second page and see if it ever goes back down to 0.
 
Take care,
 
Daniel

On Mon, Jun 30, 2008 at 9:31 PM, Brian Gregory <bgregory@...> wrote:

I'm currently working w/ Stan on the JSFUnit project and I've observed some
strange behavior using the latest htmlunit w/ richfaces. How does htmlunit
deal with javascript threads that are still running (or in a setTimeout())
when the EnclosingWindow navigates away from that page?

For example, I have a page with an a4j:poll control (richfaces) that
essentially makes an ajax call periodically to update something on the page.
I've put some log output in the action listener function that gets called
when the poller fires so I can see it on the console. When I use click() on
a navigation link, and then verify the navigation has occurred, I still
periodically see the log ouput as if the poll thread is still running.

I've been trying to write a test that illustrates the problem, but I have no
idea how I would verify the thread from a test case.

Any ideas about the problem? Or perhaps ideas about how to go about
verifying the behavior in a test?
(Is there a way to inspect the thread manager to see if javascript threads
that are associated with a page stay around after the page is gone?)

Brian
--
View this message in context: http://www.nabble.com/richfaces-a4j%3Apoll-tp18207572p18207572.html
Sent from the HtmlUnit - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user



--
Daniel Gredler
http://daniel.gredler.net/
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: richfaces a4j:poll

by Brian Gregory :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Actually, that is one of the things that was confusing me.

When I load the initial page I get an activeCount() = 1, then I click a button that deactivates the poll control and get an activeCount() = 3?,  and then I navigate away from the page and the number keeps going up. Writing a test that shows the activeCount() increase should be easy.

 

(BTW, We’re using the NicelyResynchronizingAjaxController() )

 

Brian

 

 

From: htmlunit-user-bounces@... [mailto:htmlunit-user-bounces@...] On Behalf Of D&J Gredler
Sent: Tuesday, July 01, 2008 8:28 AM
To: htmlunit-user@...
Subject: Re: [Htmlunit-user] richfaces a4j:poll

 

Hi Brian,

 

This could very well be a bug. ThreadManager has an activeCount() method that should only be > 0 if there is some JS waiting to be executed... so you could have a first page that invokes setInterval(), causing activeCount() to go up to 1; then navigate to the second page and see if it ever goes back down to 0.

 

Take care,

 

Daniel

On Mon, Jun 30, 2008 at 9:31 PM, Brian Gregory <bgregory@...> wrote:


I'm currently working w/ Stan on the JSFUnit project and I've observed some
strange behavior using the latest htmlunit w/ richfaces. How does htmlunit
deal with javascript threads that are still running (or in a setTimeout())
when the EnclosingWindow navigates away from that page?

For example, I have a page with an a4j:poll control (richfaces) that
essentially makes an ajax call periodically to update something on the page.
I've put some log output in the action listener function that gets called
when the poller fires so I can see it on the console. When I use click() on
a navigation link, and then verify the navigation has occurred, I still
periodically see the log ouput as if the poll thread is still running.

I've been trying to write a test that illustrates the problem, but I have no
idea how I would verify the thread from a test case.

Any ideas about the problem? Or perhaps ideas about how to go about
verifying the behavior in a test?
(Is there a way to inspect the thread manager to see if javascript threads
that are associated with a page stay around after the page is gone?)

Brian
--
View this message in context: http://www.nabble.com/richfaces-a4j%3Apoll-tp18207572p18207572.html
Sent from the HtmlUnit - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user




--
Daniel Gredler
http://daniel.gredler.net/


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
LightInTheBox - Buy quality products at wholesale price