*/
public void testDecode() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
HtmlAnchor anchor = (HtmlAnchor)page.getDocumentElement().getHtmlElementById(command.getClientId(facesContext));
anchor.click();
externalContext.addRequestParameterMap(orderingList.getClientId(facesContext), "sa1:2");
externalContext.addRequestParameterMap(orderingList.getClientId(facesContext), "0:1");
orderingList.processDecodes(facesContext);
Object submittedValue = orderingList.getSubmittedValue();
assertNotNull(submittedValue);
assertTrue(submittedValue instanceof UIOrderingList.SubmittedValue);
UIOrderingList.SubmittedValue sValue = (UIOrderingList.SubmittedValue) submittedValue;
assertFalse(sValue.isNull());
orderingList.setImmediate(true);
orderingList.addValidator(new Validator() {
public void validate(FacesContext arg0, UIComponent arg1,
Object arg2) throws ValidatorException {
FacesMessage mess = new FacesMessage("Fake test message.");
throw new ValidatorException(mess);
}
});
page = renderView();
anchor = (HtmlAnchor)page.getDocumentElement().getHtmlElementById(command.getClientId(facesContext));
anchor.click();
externalContext.addRequestParameterMap(orderingList.getClientId(facesContext), "sa1:2");
externalContext.addRequestParameterMap(orderingList.getClientId(facesContext), "0:1");
orderingList.processDecodes(facesContext);
assertTrue(facesContext.getMessages().hasNext());
}