• UsingComponentIDs

    Assigning Component ID's The first thing to know about writing a JSFUnit test is that you should get into the habit of assigning component ID's to your components on a JSF page.  For every JSF component (except &...
    Profile Photo
    last modified by ssilvert
  • Using JSFUnit with Servlet 3.0

    JSFUnit 1.2 takes advantage of new features in Servlet 3.0 to make setting up and running JSFUnit tests faster and easier.  To take advantage of these features: Use a Servlet 3.0 container Use the Servlet 2.5 o...
    Profile Photo
    last modified by ssilvert
  • JSFUnitWithRichFaces

    Introduction RichFaces/Ajax4jsf is the first Ajax component library to be supported by JSFUnit.  Our plan is to make sure that all of the popular JSF libraries work well with JSFUnit. RichFaces and JSFUnit Since ...
    Profile Photo
    last modified by ssilvert
  • GettingStartedGuide

    Getting Started Guide There is a "Getting Started Guide" on the JSFUnit web site.  Click Here   The hardest part about using JSFUnit is preparing your WAR. You have to add several jar files, plus you need t...
    Profile Photo
    last modified by ssilvert
  • RunningJSFUnit

    Running JSFUnit TestsFirst Prepare your WAR If you are not using JBoss AS 5, you will need to prepare your WAR file when you build it using the Ant instructions or Maven instructions.  If you are using JBoss AS 5...
    Profile Photo
    last modified by ssilvert
  • JSFUnitTestingSecurePages

    Testing Secure Pages  Most applications have at least some pages that require authenticated access.  So you will need your test to log in to the application before you start testing the secure page.  J...
    Profile Photo
    last modified by ssilvert
  • Using JSFUnit with Eclipse

    Running JSFUnit tests inside Eclipse is actually quite simple!   The following instructions assume the following: You can run JUnit tests within eclipse already You have successfully run a JSFUnit test on you...
    Profile Photo
    last modified by ssilvert
  • JSFUnitWithAnt

    The jsfunitwar Ant task JSFUnit provides an Ant task that takes your WAR and "jsfunifies" it.  That is, it adds filters and servlets to the web.xml and it adds jars to WEB-INF/lib.  Here are the attributes f...
    Profile Photo
    last modified by ssilvert
  • JSFUnitWithASMicrocontainer

    JBoss AS 5 Microcontainer Deployer For JBoss AS 5, you can use the JSFUnit deployer. This allows you to add JSFUnit testing without a single change to any part of your WAR.  This makes using JSFUnit far easier be...
    Profile Photo
    last modified by ssilvert
  • Use JSFUnit for testing of multipart/form-data file inputs

    Tomahawk provides an t:inputFileUpload tag for uploading of files using <input type="file"/> element and multipart/form-data HTML form. Apparently I didn't found how to provide the value for the input element us...
    Profile Photo
    last modified by ssilvert
  • WorkingWithStubs

    The stub library is a port of the Shale Test Framework.  The only major difference is that the word "mock" has been replaced with "stub", see Mocks Aren't Stubs for why this decision was made.    The ...
    Profile Photo
    last modified by ssilvert
  • JSFUnitSessionAndThreads

    The HttpSession JSFUnit tests use the HttpSession as a conduit for the FacesContext.  Here is what happens behind the scenes during a JSFUnit test: JUnit calls Cactus to run your test from the container. The J...
    Profile Photo
    last modified by ssilvert
  • AjaxWithJSFUnit

    JSFUnit should work perfectly fine with AJAX-enabled applications.  This is because we rely on HTMLUnit to act as a "headless browser".  So anytime a browser event (like onchange or onclick) is fired, the co...
    Profile Photo
    last modified by ssilvert
  • Using the HtmlUnit API with JSFUnit

    JSFUnit uses HtmlUnit as a headless browser to fill in forms, submit requests, and execute javascript.  For most client tasks, you can use the JSFClientSessionAPI object and let HtmlUnit run "under the covers".&#...
    Profile Photo
    last modified by ssilvert
  • JSFServerSessionAPI

    The JSFServerSession Class JSFUnit's JSFServerSession provides access to server-side objects needed to examine the entire state of a JSF application.   To see the full javadoc for this class, click here.   ...
    Profile Photo
    last modified by ssilvert
  • Using "select" components (Listbox, Radio, Menu, etc)

    "Select" components such as <h:selectOneMenu> or <h:selectManyListbox> allow you to select one or more items in a component.  The JSF components <f:selectItem> and <f:selectItems> allow yo...
    Profile Photo
    last modified by ssilvert
  • JSFClientSessionAPI

    The JSFClientSession class JSFUnit's JSFClientSession class is used to impersonate a browser and its user input during a test.   To see the full javadoc for this class, click here.   Getting a JSFClientSe...
    Profile Photo
    last modified by ssilvert
  • JSFSessionAPI

    Using the JSFSession API The JSFSession is the starting point for most JSFUnit tests.  The javadoc for JSFSession is here     You create the JSFSession object by passing a partial JSF URL into the cons...
    Profile Photo
    last modified by ssilvert
  • JSFUnitOnWebSphere

    Workaround needed for WebSphere users WebSphere prepends a cache ID to the jsessionid.  The cache ID is used for session affinity and it is enabled by default.  As of now, it is unknown how this behavior can...
    Profile Photo
    last modified by ssilvert
  • JSFUnit FAQ

    Does JSFUnit work with RichFaces? Yes.  See JSFUnitWithRichFaces   Does JSFUnit work with Tomahawk? Yes.  We don't have any tests for Tomahawk in the JSFUnit test suite, but developers in the community ...
    Profile Photo
    last modified by ssilvert