@Test
public void testGetEvaluableFieldNames() throws Exception {

	DDMForm ddmForm = DDMFormTestUtil.createDDMForm();
	ddmForm.addDDMFormField(
		DDMFormTestUtil.createTextDDMFormField(
			"Field0", false, false, false));
	ddmForm.addDDMFormField(
		DDMFormTestUtil.createTextDDMFormField(
			"Field1", false, false, false));
	ddmForm.addDDMFormField(
		DDMFormTestUtil.createTextDDMFormField(
			"Field2", false, false, true));
	DDMFormField ddmFormField3 = DDMFormTestUtil.createTextDDMFormField(
		"Field3", false, false, false);
	ddmFormField3.setVisibilityExpression("equals(Field0, 'Joe')");
	ddmForm.addDDMFormField(ddmFormField3);
	DDMFormField ddmFormField4 = DDMFormTestUtil.createTextDDMFormField(
		"Field4", false, false, false);
	DDMFormFieldValidation ddmFormFieldValidation =
		new DDMFormFieldValidation();
	ddmFormFieldValidation.setDDMFormFieldValidationExpression(
		new DDMFormFieldValidationExpression() {
			{
				setValue("isEmailAddress(Field4)");
			}
		});
	ddmFormField4.setDDMFormFieldValidation(ddmFormFieldValidation);
	ddmForm.addDDMFormField(ddmFormField4);
	Set<String> expectedEvaluableFieldNames = SetUtil.fromArray(
		new String[] {"Field0", "Field2", "Field4"});
	Set<String> actualEvaluableFieldNames =
		_ddmFormTemplateContextFactoryHelper.getEvaluableDDMFormFieldNames(
			ddmForm, new DDMFormLayout());
	Assert.assertEquals(
		expectedEvaluableFieldNames, actualEvaluableFieldNames);
}