Search in sources :

Example 11 with ViewDefinitionImpl

use of com.qcadoo.view.internal.internal.ViewDefinitionImpl in project qcadoo by qcadoo.

the class ViewDefinitionTest method shouldReturnJsFilePaths.

@Test
public void shouldReturnJsFilePaths() throws Exception {
    // given
    ViewDefinitionImpl viewDefinition = new ViewDefinitionImpl("name", "plugin", mock(DataDefinition.class), true, null);
    AbstractContainerPattern parent = new WindowComponentPattern(getComponentDefinition("test", viewDefinition));
    ComponentPattern form = new FormComponentPattern(getComponentDefinition("test", parent, viewDefinition));
    parent.addChild(form);
    viewDefinition.addComponentPattern(parent);
    viewDefinition.initialize();
    // when
    Set<String> paths = viewDefinition.getJsFilePaths();
    // then
    Assert.assertEquals(1, paths.size());
}
Also used : ViewDefinitionImpl(com.qcadoo.view.internal.internal.ViewDefinitionImpl) WindowComponentPattern(com.qcadoo.view.internal.components.window.WindowComponentPattern) FormComponentPattern(com.qcadoo.view.internal.components.form.FormComponentPattern) AbstractContainerPattern(com.qcadoo.view.internal.patterns.AbstractContainerPattern) FormComponentPattern(com.qcadoo.view.internal.components.form.FormComponentPattern) WindowComponentPattern(com.qcadoo.view.internal.components.window.WindowComponentPattern) ComponentPattern(com.qcadoo.view.internal.api.ComponentPattern) DataDefinition(com.qcadoo.model.api.DataDefinition) Test(org.junit.Test) AbstractPatternTest(com.qcadoo.view.internal.patterns.AbstractPatternTest)

Aggregations

DataDefinition (com.qcadoo.model.api.DataDefinition)11 ViewDefinitionImpl (com.qcadoo.view.internal.internal.ViewDefinitionImpl)11 Test (org.junit.Test)9 AbstractPatternTest (com.qcadoo.view.internal.patterns.AbstractPatternTest)8 InternalViewDefinition (com.qcadoo.view.internal.api.InternalViewDefinition)7 FormComponentPattern (com.qcadoo.view.internal.components.form.FormComponentPattern)6 WindowComponentPattern (com.qcadoo.view.internal.components.window.WindowComponentPattern)6 ComponentPattern (com.qcadoo.view.internal.api.ComponentPattern)5 JSONArray (org.json.JSONArray)2 JSONObject (org.json.JSONObject)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 FieldDefinition (com.qcadoo.model.api.FieldDefinition)1 BelongsToType (com.qcadoo.model.api.types.BelongsToType)1 FieldType (com.qcadoo.model.api.types.FieldType)1 HasManyType (com.qcadoo.model.api.types.HasManyType)1 SecurityRole (com.qcadoo.security.api.SecurityRole)1 ViewDefinitionState (com.qcadoo.view.api.ViewDefinitionState)1 InternalComponentState (com.qcadoo.view.internal.api.InternalComponentState)1 TextInputComponentPattern (com.qcadoo.view.internal.components.TextInputComponentPattern)1 GridComponentPattern (com.qcadoo.view.internal.components.grid.GridComponentPattern)1