jsfunit

JSF unit testing

I'm trying to find a practical unit testing framework for JSF. I know about JSFUnit, but this is very impractical to me. I need to include about 10 JARs to my project, and jump through many other hoops just to get it running. I realize that -- due to the need to simulate a platform and a client -- unit testing web applications is diff...

Error while using JSFUnit/HtmlUnit/CSSParser

We've just recently converted our project to using Maven for builds and dependency management, and after the conversion I'm getting the following exception while trying to run any JSFUnit tests in my project. Exception class=[java.lang.UnsupportedOperationException] com.gargoylesoftware.htmlunit.ScriptException: CSSRule com.steadystate....

jsfunit with junit 4

Hi, We would like to test our web application (jsf 1.2, richfaces 3.3.3) with jsfunit. We are using junit 4.8.1 library for our unit tests. But jsfunit (1.2.0.Final) requires non existing class junit.runner.TestSuiteLoader. If i downgrade to junit 3.8, i can't use annotations in my Test classes any more. Is there a solution for it? Th...

How can i select a value in dropdown list per JSFUnit?

Hi, I would like to change a value in dropdown list (h:selectOneMenu) with id "items". The following causes error client.setValue("items", "1"); java.lang.IllegalArgumentException: This method can not be used on components of type com.gargoylesoftware.htmlunit.html.HtmlSelect I've tried: client.getElement("items").setAttribute("val...

JSFUnit Spring Security

Hi, I'd like to test my secure pages with JSFUnit : My Testclass: public class BasicAuthenticationTest extends ServletTestCase { public static Test suite() { return new TestSuite( BasicAuthenticationTest.class ); } public void testBasicAuth() throws IOException, ServletException { WebClientSpec wcSpec = new WebClientSpec...

JSFUnit with Spring Security Filter

I am trying the example of JSF2+tomcat. When I don't have Spring Security Filter in my web.xml it works fine. <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <u...

DuplicateClientIDException in jsfUnit

Hi! In my test I looking for some components, and checking if they're rendered: UIComponent component = server.findComponent(permossion.getClientId()); assertEquals(hasPermission, "roleCol"); and my page looks like this: <p:treeTable value="#{manageGroupsBean.root}" var="entity" id="table"> <p:column id="role...

Where can I find JSFUnit real-life example?

I'm trying to use JSFUnit framework, but can't understand how to allocate projects/files. How many projects/sub-projects should I have and whether it is possible to have just ONE project, as it normally happens with JUnit and similar frameworks. Would be nice to see some example. I still can't understand whether I need to create a separ...

How can i use embedded Jetty with JSFUnit?

I would like to test my JSF application using JSFUnit and embedded Jetty. How can i do this? Is there any documentation which demonstrates this? I started a jetty server programatically using junit4's @BeforeClass but it seems JSFUnit tries to connect to the server before the static method annotated with @BeforeClass can execute! ...

JSFUnit accessing FacesContext before JSFSession is created

I want to access the JSFUnit FacesContext before I create the JSFSession object. The reason for this is I would like to set a managed bean value before any request/response processing is done. I use this value in a filter. ...

Failed to get the test results for JSFUnit

I am trying to configure JSFUnit to run in my application. We are an ICEFaces app deployed on WAS 6.1. When I create my TestCase and access it from the following URL: localhost:9085/smagui/ServletTestRunner?suite=com.sma.gui.product.JSFUnitTest&xsl=cactus-report.xsl I get a report that says: testInitialPage Error Failed to get the...

Can i use WebSphere 6.1 for JSFunit?

I am doing work on jsfunit, and i am using WebSphere6.1 application server so can anyone give me answer that is it compatible for JSFunit or i need to do some changes in my server configuration? if possible send me the example? Thanks Vinod ...