use of org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer in project kie-wb-common by kiegroup.
the class AbstractFormDefinitionGeneratorTest method init.
@Before
public void init() throws Exception {
formDefinitionSerializer = new FormDefinitionSerializerImpl(new FieldSerializer(), new FormModelSerializer(), new TestMetaDataEntryManager());
when(migrationServicesCDIWrapper.getIOService()).thenReturn(ioService);
when(migrationServicesCDIWrapper.getFormDefinitionSerializer()).thenReturn(formDefinitionSerializer);
simpleFileSystemProvider = new SimpleFileSystemProvider();
simpleFileSystemProvider.forceAsDefault();
when(path.toURI()).thenReturn(ROOT_PATH);
when(workspaceProject.getRootPath()).thenReturn(path);
generator = new FormDefinitionGenerator(DataObjectFormAdapter::new, this::getBPMNAdapter);
doInit();
}
use of org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer in project kie-wb-common by kiegroup.
the class FormGenerationIntegrationTest method setup.
@BeforeClass
public static void setup() throws ClassNotFoundException {
FormModelPropertiesUtil.registerBaseType(DOCUMENT_TYPE);
FormModelPropertiesUtil.registerBaseType(DocumentFieldType.DOCUMENT_IMPL_TYPE);
fieldManager = new TestFieldManager() {
{
registerFieldProvider(new DocumentFieldProvider() {
{
doRegisterFields();
}
});
}
};
formSerializer = new FormDefinitionSerializerImpl(new FieldSerializer(), new FormModelSerializer(), new TestMetaDataEntryManager());
ioService = new IOServiceDotFileImpl();
templateGenerator = new StaticFormLayoutTemplateGenerator();
formModelSynchronizationUtil = new FormModelSynchronizationUtilImpl(fieldManager, templateGenerator);
moduleClassLoader = FormGenerationIntegrationTest.class.getClassLoader();
formGenerationProcessDefinitions = TestUtils.getDefinitionsFromResources(FormGenerationIntegrationTest.class, DEFINITION_PATH);
formModelerContent = new FormModelerContent();
formEditorHelper = new FormEditorHelper(fieldManager, null);
}
use of org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer in project kie-wb-common by kiegroup.
the class FormDefinitionIndexerTest method setup.
@Override
public void setup() throws IOException {
FormModelVisitor visitor = mock(FormModelVisitor.class);
FormModelVisitorProvider provider = mock(FormModelVisitorProvider.class);
when(provider.getModelType()).thenReturn(FormModel.class);
when(provider.getVisitor()).thenReturn(visitor);
Instance<FormModelVisitorProvider<?>> providersInstance = mock(Instance.class);
List<FormModelVisitorProvider<?>> providers = Arrays.asList(provider);
when(providersInstance.iterator()).thenReturn(providers.iterator());
indexer = spy(new TestFormDefinitionIndexer(new FormResourceTypeDefinition(new Form()), new FormDefinitionSerializerImpl(new FieldSerializer(), new FormModelSerializer(), new TestMetaDataEntryManager()), providersInstance));
when(indexer.getProviderForModel(any())).thenReturn(provider);
super.setup();
}
Aggregations