use of org.kie.workbench.common.forms.model.TypeInfo in project kie-wb-common by kiegroup.
the class FieldManagerTest method testCompatiblefields.
protected void testCompatiblefields(boolean addFieldType) {
for (Class clazz : basicTypesSupported) {
TypeInfo typeInfo = new TypeInfoImpl(clazz.isEnum() ? TypeKind.ENUM : TypeKind.BASE, clazz.getName(), false);
FieldDefinition fieldDefinition = fieldManager.getDefinitionByDataType(typeInfo);
Assertions.assertThat(fieldDefinition).isNotNull();
if (addFieldType) {
fieldDefinition.setStandaloneClassName(typeInfo.getClassName());
}
Collection<String> compatibles = fieldManager.getCompatibleFields(fieldDefinition);
Assertions.assertThat(compatibles).isNotNull().isNotEmpty();
}
}
use of org.kie.workbench.common.forms.model.TypeInfo in project kie-wb-common by kiegroup.
the class FieldManagerTest method testGetFieldByTypeInfo.
@Test
public void testGetFieldByTypeInfo() {
for (Class clazz : basicTypesSupported) {
TypeInfo typeInfo = new TypeInfoImpl(clazz.isEnum() ? TypeKind.ENUM : TypeKind.BASE, clazz.getName(), false);
checkFieldExists(typeInfo);
}
for (Class clazz : basicMultipleTypesSupported) {
TypeInfo typeInfo = new TypeInfoImpl(TypeKind.BASE, clazz.getName(), true);
checkFieldExists(typeInfo);
}
// check nested form
checkFieldExists(new TypeInfoImpl(TypeKind.OBJECT, Object.class.getName(), false));
// check multiple subform
checkFieldExists(new TypeInfoImpl(TypeKind.OBJECT, Object.class.getName(), true));
}
Aggregations