@Test public void testCreateDDMFormFieldTypeSettingsDDMForm() { DDMForm ddmForm = DDMFormFactory.create(DDMFormFieldTypeSettings.class); Assert.assertNotNull(ddmForm); assertRequiredDDMFormFieldTypeSettings(ddmForm.getDDMFormFieldsMap(false)); }
@Test public void testCreateDefaultDDMFormFieldTypeSettingsDDMForm() { DDMForm ddmForm = DDMFormFactory.create(DefaultDDMFormFieldTypeSettings.class); Assert.assertNotNull(ddmForm); Map<String, DDMFormField> ddmFormFieldsMap = ddmForm.getDDMFormFieldsMap(false); assertRequiredDDMFormFieldTypeSettings(ddmFormFieldsMap); DDMFormField indexTypeDDMFormField = ddmFormFieldsMap.get("indexType"); Assert.assertNotNull(indexTypeDDMFormField); Assert.assertEquals("string", indexTypeDDMFormField.getDataType()); Assert.assertEquals("text", indexTypeDDMFormField.getType()); DDMFormField labelDDMFormField = ddmFormFieldsMap.get("label"); Assert.assertNotNull(labelDDMFormField); Assert.assertEquals("string", labelDDMFormField.getDataType()); Assert.assertEquals("text", labelDDMFormField.getType()); Assert.assertEquals(true, labelDDMFormField.isLocalizable()); DDMFormField localizableDDMFormField = ddmFormFieldsMap.get("localizable"); Assert.assertNotNull(localizableDDMFormField); Assert.assertEquals("boolean", localizableDDMFormField.getDataType()); Assert.assertEquals("checkbox", localizableDDMFormField.getType()); DDMFormField predefinedValueDDMFormField = ddmFormFieldsMap.get("predefinedValue"); Assert.assertNotNull(predefinedValueDDMFormField); Assert.assertEquals("string", predefinedValueDDMFormField.getDataType()); Assert.assertEquals("text", predefinedValueDDMFormField.getType()); Assert.assertEquals(true, predefinedValueDDMFormField.isLocalizable()); DDMFormField readOnlyDDMFormField = ddmFormFieldsMap.get("readOnly"); Assert.assertNotNull(readOnlyDDMFormField); Assert.assertEquals("boolean", readOnlyDDMFormField.getDataType()); Assert.assertEquals("checkbox", readOnlyDDMFormField.getType()); DDMFormField repeatableDDMFormField = ddmFormFieldsMap.get("repeatable"); Assert.assertNotNull(repeatableDDMFormField); Assert.assertEquals("boolean", repeatableDDMFormField.getDataType()); Assert.assertEquals("checkbox", repeatableDDMFormField.getType()); DDMFormField requiredDDMFormField = ddmFormFieldsMap.get("readOnly"); Assert.assertNotNull(requiredDDMFormField); Assert.assertEquals("boolean", requiredDDMFormField.getDataType()); Assert.assertEquals("checkbox", requiredDDMFormField.getType()); DDMFormField showLabelDDMFormField = ddmFormFieldsMap.get("showLabel"); Assert.assertNotNull(showLabelDDMFormField); Assert.assertEquals("boolean", showLabelDDMFormField.getDataType()); Assert.assertEquals("checkbox", showLabelDDMFormField.getType()); DDMFormField tipDDMFormField = ddmFormFieldsMap.get("tip"); Assert.assertNotNull(tipDDMFormField); Assert.assertEquals("string", tipDDMFormField.getDataType()); Assert.assertEquals("text", tipDDMFormField.getType()); Assert.assertEquals(true, tipDDMFormField.isLocalizable()); }