Skip to main content

How to test JSF 2.0 apps?

5 replies [Last post]
mpscholz
Offline
Joined: 2003-06-12
Points: 0

One of the most crucial points when developing enterprise systems is testing, both on unit as well as on integration level.
Once the system starts to grow beyond a trivial level of complexity, it's mandatory to have such tests that can be integrated in a automated continuous integration system (Hudson or the likes).

While this topic is pretty well covered for EJB 3.1 components, support for automated testing the web part seems to be still marginal in the JEE universe (in contrast, for instance, to the Ruby on Rails or Spring MVC worlds, where testability might almost be considered as an in-built design pattern).

In particular when it comes to JSF 2.0, I'm still searching for a decent, easy-to-use and effcient way to implement automated unit and integration tests for my the Faces part of my JEE 6 applications.
There's JSFUnit (http://www.jboss.org/jsfunit) - yet, it appears to require the application already deployed in a container (correct me if I'm wrong), which introduces quite some (unneccessary?) complexity and inefficiency into the test setup and execution process.
There's also Arquillian (http://community.jboss.org/docs/DOC-14376) for which I still have to find out whether it is meant or useful for JSF tests.

What are your experiences here? How do you test your JSF 2 applications?
How is JSF 2.0 meant to be tested by its designers?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mpscholz
Offline
Joined: 2003-06-12
Points: 0

Actually, I'd like to test my JSF 2 app without the need to introduce another framework (except for a test framework, of course), in particular not one that simply covers an area that JSF 2 itself is claiming to handle already (like page navigation).

If I'd be required to do so just for the sake of testing JSF reasonably, well, that'd be quite some evidence of incapacity for JSF 2, would it not?

Message was edited by: mpscholz

catplay
Offline
Joined: 2010-05-30
Points: 0

One of the choices which come to mind is Spring webflow. Spring webflow is for management of page flow , navigation and state management. It is not an full fledged MVC framework like JSF 2.0 or Apache Struts.
The deployment approach for JSF libraries is slightly picky.Glassfish provides already JSF 2 libraries. You may need to update them using the update mechanism of Glassfish.

[url=http://www.carpartswarehouse.com/carmodels/CP9/Lincoln/Mark_Series.html]Lincoln Mark Series[/url]

Joel Weight

The current version of spring webflow does not integrate well with jsf 2.

On Sun, May 30, 2010 at 4:45 AM, wrote:

> One of the choices which come to mind is Spring webflow. Spring webflow is
> for management of page flow , navigation and state management. It is not an
> full fledged MVC framework like JSF 2.0 or Apache Struts.
> The deployment approach for JSF libraries is slightly picky.Glassfish
> provides already JSF 2 libraries. You may need to update them using the
> update mechanism of Glassfish.
>
>
> [url=
> http://www.carpartswarehouse.com/carmodels/CP9/Lincoln/Mark_Series.html]LincolnMark Series[/url]
> [Message sent by forum member 'catplay']
>
> http://forums.java.net/jive/thread.jspa?messageID=472001
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>
[att1.html]

Edward Burns

On 5/5/10 11:50 , webtier@javadesktop.org wrote:
> One of the most crucial points when developing enterprise systems is [b]testing[/b], both on unit as well as on integration level.
> Once the system starts to grow beyond a trivial level of complexity, it's [i]mandatory[/i] to have such tests that can be integrated in a automated continuous integration system (Hudson or the likes).
>
> While this topic is pretty well covered for EJB 3.1 components, support for automated testing the web part seems to be still marginal in the JEE universe (in contrast, for instance, to the Ruby on Rails or Spring MVC worlds, where testability might almost be considered as an in-built design pattern).
>
> In particular when it comes to JSF 2.0, I'm still searching for a decent, easy-to-use and effcient way to implement automated unit and integration tests for my the Faces part of my JEE 6 applications.
> There's JSFUnit (http://www.jboss.org/jsfunit) - yet, it appears to require the application already deployed in a container (correct me if I'm wrong), which introduces quite some (unneccessary?) complexity and inefficiency into the test setup and execution process.
> There's also Arquillian (http://community.jboss.org/docs/DOC-14376) for which I still have to find out whether it is meant or useful for JSF tests.

Andreas Hartmann wrote:

AH> Testing has been made as a part of the architecture requirements for
AH> our Applications. We use a modified Version of Folwers "Passive View
AH> Pattern" [http://www.martinfowler.com/eaaDev/PassiveScreen.html] and
AH> the Spring EL-Resolver instead of the JSF Standard EL-Resolver.

AH> With this general foundation we can easily inject Mock Objects of
AH> our Business Services that are called from the JSF Application. So
AH> we are able to Test the logic to call and process a Business Service
AH> from the JSF Application without a running Business Service and we
AH> don't need a Webcontainer for our tests.

AH> We prefer at the moment the XML based configuration and test these
AH> with the Static Analysis Feature of JSFUnit
AH> [http://community.jboss.org/wiki/StaticAnalysis].

AH> Also these tests run perfectly with a continuous integration tool for
AH> JSF 1.2 and JSF 2.0 and are ready for regression tests out of the
AH> box.

AH> For testing the JSF pages it is necessary to deploy the
AH> application. Here we use WebDriver
AH> [http://code.google.com/p/selenium/], maybe in conjunction with
AH> Selenium.

AH> WebDriver operate with native Browser Support and it works really
AH> fine with any JSF Ajax Component Library. You are able to integrate
AH> the WebDriver Test also with in a continuous integration tool but in
AH> this case you must have a look at your test data and maybe prepare
AH> them before executing the tests.

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Edward Burns

I just attended a talk on this topic at the JSF day at JAX 2010. It's
hard to summarize, so I'll forward your thoughtful mail to the
presenter of the talk.

Please excuse the terseness of this response. It was sent from a
mobile device.

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net