Ajax4JSF in JSFUnit
by Stan Silvert
FYI, I just finished the ajax4jsf support and an example application.
It's really three apps in one. I combined three of the ajax4jsf sample
apps into one WAR and wrote tests for them. You can see this in:
jsfunit/jboss-jsfunit-examples/jboss-jsfunit-examples-ajax4jsf
The only thing left to add to the example is an index page that lets you
run the tests from the browser.
There is no library I have found that adequately handles the javascript
for the A4J components. So for AJAX, you are only testing the server
side and not the dynamic things that would happen in the browser.
The Ajax4jsfClient creates the same HTTP request that would be sent by
the A4J.AJAX.Submit javascript function. After that request, it sends a
second request to the server that does a page refresh, which keeps the
client and server side in sync.
For example, I have a page with this form:
<h:form id="form1">
<h:inputText id="input_text" size="50" value="#{textbean.text}">
<a4j:support id="a4jsupport" event="onkeyup" reRender="rep"/>
</h:inputText>
<h:outputText value="#{textbean.text}" id="rep"/>
</h:form>
The code to test the AJAX submit looks something like this:
ClientFacade client = new ClientFacade("/pages/echo.jsf");
Ajax4jsfClient ajaxClient = new Ajax4jsfClient(client);
ServerFacade server = new ServerFacade(client);
client.setParameter("input_text", "foo");
ajaxClient.fireAjaxEvent("a4jsupport");
assertEquals("foo", server.getManagedBeanValue("#{textbean.text}"));
Stan
17 years, 4 months
Demo target platform
by Jonathan Prindiville
Before anything significant, development-wise, happens with this demo
application[1], I thought I should ask:
Does anyone have any preferences/requests as to the target platform (by
'platform' I mean any combination of application servers and JDK versions)?
Jon
[1] http://jira.jboss.com/jira/browse/JSFUNIT-6
17 years, 5 months