Search in sources :

Example 1 with FieldSerializer

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();
}
Also used : SimpleFileSystemProvider(org.uberfire.java.nio.fs.file.SimpleFileSystemProvider) FieldSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer) FormDefinitionSerializerImpl(org.kie.workbench.common.forms.services.backend.serialization.impl.FormDefinitionSerializerImpl) FormModelSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FormModelSerializer) TestMetaDataEntryManager(org.kie.workbench.common.forms.fields.test.TestMetaDataEntryManager) Before(org.junit.Before)

Example 2 with FieldSerializer

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);
}
Also used : FieldSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer) IOServiceDotFileImpl(org.uberfire.io.impl.IOServiceDotFileImpl) StaticFormLayoutTemplateGenerator(org.kie.workbench.common.forms.commons.shared.layout.impl.StaticFormLayoutTemplateGenerator) DocumentFieldProvider(org.kie.workbench.common.forms.jbpm.model.authoring.document.provider.DocumentFieldProvider) FormDefinitionSerializerImpl(org.kie.workbench.common.forms.services.backend.serialization.impl.FormDefinitionSerializerImpl) FormModelerContent(org.kie.workbench.common.forms.editor.model.FormModelerContent) FormModelSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FormModelSerializer) TestFieldManager(org.kie.workbench.common.forms.fields.test.TestFieldManager) FormEditorHelper(org.kie.workbench.common.forms.editor.client.editor.FormEditorHelper) TestMetaDataEntryManager(org.kie.workbench.common.forms.fields.test.TestMetaDataEntryManager) FormModelSynchronizationUtilImpl(org.kie.workbench.common.forms.editor.service.shared.model.impl.FormModelSynchronizationUtilImpl) BeforeClass(org.junit.BeforeClass)

Example 3 with FieldSerializer

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();
}
Also used : FieldSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer) FormResourceTypeDefinition(org.kie.workbench.common.forms.editor.type.FormResourceTypeDefinition) Form(org.guvnor.common.services.project.categories.Form) FormDefinitionSerializerImpl(org.kie.workbench.common.forms.services.backend.serialization.impl.FormDefinitionSerializerImpl) FormModelSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FormModelSerializer) TestMetaDataEntryManager(org.kie.workbench.common.forms.fields.test.TestMetaDataEntryManager)

Aggregations

TestMetaDataEntryManager (org.kie.workbench.common.forms.fields.test.TestMetaDataEntryManager)3 FieldSerializer (org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer)3 FormDefinitionSerializerImpl (org.kie.workbench.common.forms.services.backend.serialization.impl.FormDefinitionSerializerImpl)3 FormModelSerializer (org.kie.workbench.common.forms.services.backend.serialization.impl.FormModelSerializer)3 Form (org.guvnor.common.services.project.categories.Form)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1 StaticFormLayoutTemplateGenerator (org.kie.workbench.common.forms.commons.shared.layout.impl.StaticFormLayoutTemplateGenerator)1 FormEditorHelper (org.kie.workbench.common.forms.editor.client.editor.FormEditorHelper)1 FormModelerContent (org.kie.workbench.common.forms.editor.model.FormModelerContent)1 FormModelSynchronizationUtilImpl (org.kie.workbench.common.forms.editor.service.shared.model.impl.FormModelSynchronizationUtilImpl)1 FormResourceTypeDefinition (org.kie.workbench.common.forms.editor.type.FormResourceTypeDefinition)1 TestFieldManager (org.kie.workbench.common.forms.fields.test.TestFieldManager)1 DocumentFieldProvider (org.kie.workbench.common.forms.jbpm.model.authoring.document.provider.DocumentFieldProvider)1 IOServiceDotFileImpl (org.uberfire.io.impl.IOServiceDotFileImpl)1 SimpleFileSystemProvider (org.uberfire.java.nio.fs.file.SimpleFileSystemProvider)1