Search in sources :

Example 16 with WindowComponentPattern

use of com.qcadoo.view.internal.components.window.WindowComponentPattern 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

WindowComponentPattern (com.qcadoo.view.internal.components.window.WindowComponentPattern)16 Test (org.junit.Test)12 InternalViewDefinition (com.qcadoo.view.internal.api.InternalViewDefinition)11 DataDefinition (com.qcadoo.model.api.DataDefinition)9 TextInputComponentPattern (com.qcadoo.view.internal.components.TextInputComponentPattern)9 FieldDefinition (com.qcadoo.model.api.FieldDefinition)6 ComponentPattern (com.qcadoo.view.internal.api.ComponentPattern)4 FormComponentPattern (com.qcadoo.view.internal.components.form.FormComponentPattern)3 BelongsToType (com.qcadoo.model.api.types.BelongsToType)2 HasManyType (com.qcadoo.model.api.types.HasManyType)2 ModuleException (com.qcadoo.plugin.api.ModuleException)2 ViewDefinitionImpl (com.qcadoo.view.internal.internal.ViewDefinitionImpl)2 ViewDefinitionParserException (com.qcadoo.view.internal.xml.ViewDefinitionParserException)2 ViewDefinitionParserNodeException (com.qcadoo.view.internal.xml.ViewDefinitionParserNodeException)2 IOException (java.io.IOException)2 JSONObject (org.json.JSONObject)2 Node (org.w3c.dom.Node)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 ComponentDefinition (com.qcadoo.view.internal.ComponentDefinition)1 ContainerPattern (com.qcadoo.view.internal.api.ContainerPattern)1