@Test
public void testRadioFieldTemplateContext() throws Exception {

	// Dynamic data mapping form
	DDMForm ddmForm = DDMFormTestUtil.createDDMForm();
	String formFieldLabel = String.format(_HTML_WRAPPER, "label");
	String formFieldOption = String.format(_HTML_WRAPPER, "option");
	String formFieldPredefinedValue = StringBundler.concat(
		StringPool.OPEN_BRACKET,
		String.format(_HTML_WRAPPER, "predefinedValue"),
		StringPool.CLOSE_BRACKET);
	String formFieldTip = String.format(_HTML_WRAPPER, "tip");
	ddmForm.addDDMFormField(
		DDMFormTestUtil.createDDMFormField(
			"Field1", formFieldLabel, "radio", "string", false, false, true,
			formFieldTip, formFieldPredefinedValue, formFieldOption));
	mockDDMFormFieldTypeServicesTracker(
		"radio",
		_ddmFormFieldTemplateContextContributorTestHelper.
			createRadioDDMFormFieldTemplateContextContributor());
	// Dynamic data mapping form layout
	DDMFormLayout ddmFormLayout = new DDMFormLayout();
	ddmFormLayout = createDDMFormLayoutPage(
		ddmFormLayout, "Page 1", "Page 1 Description", "Field1");
	// Template context
	DDMFormPagesTemplateContextFactory ddmFormPagesTemplateContextFactory =
		createDDMFormPagesTemplateContextFactory(
			ddmForm, ddmFormLayout, null, false, true, true);
	List<Object> pages = ddmFormPagesTemplateContextFactory.create();
	Map<String, Object> fieldTemplateContext = getFieldTemplateContext(
		pages);
	List<Map<String, String>> options =
		(List<Map<String, String>>)fieldTemplateContext.get("options");
	Map<String, String> optionField = options.get(0);
	Assert.assertEquals(formFieldLabel, fieldTemplateContext.get("label"));
	Assert.assertEquals(formFieldOption, optionField.get("label"));
	Object predefinedValue = fieldTemplateContext.get("predefinedValue");
	Assert.assertEquals(
		formFieldPredefinedValue, predefinedValue.toString());
	Assert.assertEquals(formFieldTip, fieldTemplateContext.get("tip"));
}