facesRequest.release();
}
@Test
public final void testSortingWithClean() throws IOException {
FacesRequest facesRequest = startFacesRequest();
FacesContext facesContext = FacesContext.getCurrentInstance();
AbstractExtendedDataTable component = (AbstractExtendedDataTable) facesContext.getViewRoot().findComponent("table");
ExtendedDataTableRenderer renderer = (ExtendedDataTableRenderer) FacesContext.getCurrentInstance().getRenderKit()
.getRenderer(component.getFamily(), component.getRendererType());
Map<String, Object> column1Attributes = component.findComponent("column1").getAttributes();
Map<String, Object> column2Attributes = component.findComponent("column2").getAttributes();
String clientId = component.getClientId(facesContext);
assertNull(column1Attributes.get("sortOrder"));
assertEquals(SortOrder.ascending, column2Attributes.get("sortOrder"));
facesRequest.withParameter(clientId, clientId);
facesRequest.withParameter(clientId + "rich:sorting", "column1:descending:true");
renderer.doDecode(facesContext, component);
assertEquals(SortOrder.descending, column1Attributes.get("sortOrder"));
assertEquals(SortOrder.unsorted, column2Attributes.get("sortOrder"));
assertTrue(facesContext.getPartialViewContext().getRenderIds().contains(clientId));
facesRequest.release();
}