/**
* Testing reading from request with a grouped constraint set.
*/
public void testFormActiveGroupedConstraintValidates() throws Exception {
FormWidget testForm = makeUsualForm();
MockHttpServletRequest notMandatoryMissingRequest = new MockHttpServletRequest();
notMandatoryMissingRequest.addParameter("testForm.__present", "true");
notMandatoryMissingRequest.addParameter("testForm.myCheckBox", "true");
notMandatoryMissingRequest.addParameter("testForm.myLongText", "108");
notMandatoryMissingRequest.addParameter("testForm.myDateTime.date", "11.10.2015");
notMandatoryMissingRequest.addParameter("testForm.myDateTime.time", "01:01");
notMandatoryMissingRequest.addParameter("testForm.hierarchyTest.myTextarea", "blah");
notMandatoryMissingRequest.addParameter("testForm.hierarchyTest.mySelect", "2");
// create helper
ConstraintGroupHelper groupHelper = new ConstraintGroupHelper();
testForm.getElement("myDateTime").setConstraint(groupHelper.createGroupedConstraint(new NotEmptyConstraint(), "active"));
StandardServletInputData input = new StandardServletInputData(notMandatoryMissingRequest);
input.pushScope("testForm");
testForm._getWidget().update(input);
groupHelper.setActiveGroup("active");
assertTrue("Test form must be valid after reading from request", testForm.convertAndValidate());
}