Search in sources :

Example 1 with FormModelSynchronizationUtilImpl

use of org.kie.workbench.common.forms.editor.service.shared.model.impl.FormModelSynchronizationUtilImpl 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 2 with FormModelSynchronizationUtilImpl

use of org.kie.workbench.common.forms.editor.service.shared.model.impl.FormModelSynchronizationUtilImpl in project kie-wb-common by kiegroup.

the class BPMNVFSFormDefinitionGeneratorServiceTest method setup.

@Before
public void setup() throws IOException {
    when(projectService.resolveModule(any())).thenReturn(module);
    when(projectClassLoaderHelper.getModuleClassLoader(module)).thenReturn(this.getClass().getClassLoader());
    source = mock(Path.class);
    simpleFileSystemProvider = new SimpleFileSystemProvider();
    simpleFileSystemProvider.forceAsDefault();
    when(source.toURI()).thenReturn("default:///src/main/resources/test.frm");
    when(commentedOptionFactory.makeCommentedOption(anyString())).then(invocationOnMock -> new CommentedOption("1", invocationOnMock.getArguments()[0].toString()));
    formModelHandlerManager = new TestFormModelHandlerManager(projectService, projectClassLoaderHelper, fieldManager, dataObjectFinderService);
    service = new BPMNVFSFormDefinitionGeneratorService(fieldManager, formModelHandlerManager, formFinderService, formSerializer, ioService, commentedOptionFactory, new FormModelSynchronizationUtilImpl(fieldManager, templateGenerator));
}
Also used : Path(org.uberfire.backend.vfs.Path) SimpleFileSystemProvider(org.uberfire.java.nio.fs.file.SimpleFileSystemProvider) CommentedOption(org.uberfire.java.nio.base.options.CommentedOption) TestFormModelHandlerManager(org.kie.workbench.common.forms.jbpm.server.service.formGeneration.test.TestFormModelHandlerManager) FormModelSynchronizationUtilImpl(org.kie.workbench.common.forms.editor.service.shared.model.impl.FormModelSynchronizationUtilImpl) Before(org.junit.Before)

Aggregations

FormModelSynchronizationUtilImpl (org.kie.workbench.common.forms.editor.service.shared.model.impl.FormModelSynchronizationUtilImpl)2 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 TestFieldManager (org.kie.workbench.common.forms.fields.test.TestFieldManager)1 TestMetaDataEntryManager (org.kie.workbench.common.forms.fields.test.TestMetaDataEntryManager)1 DocumentFieldProvider (org.kie.workbench.common.forms.jbpm.model.authoring.document.provider.DocumentFieldProvider)1 TestFormModelHandlerManager (org.kie.workbench.common.forms.jbpm.server.service.formGeneration.test.TestFormModelHandlerManager)1 FieldSerializer (org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer)1 FormDefinitionSerializerImpl (org.kie.workbench.common.forms.services.backend.serialization.impl.FormDefinitionSerializerImpl)1 FormModelSerializer (org.kie.workbench.common.forms.services.backend.serialization.impl.FormModelSerializer)1 Path (org.uberfire.backend.vfs.Path)1 IOServiceDotFileImpl (org.uberfire.io.impl.IOServiceDotFileImpl)1 CommentedOption (org.uberfire.java.nio.base.options.CommentedOption)1 SimpleFileSystemProvider (org.uberfire.java.nio.fs.file.SimpleFileSystemProvider)1