Search in sources :

Example 1 with AbstractContainerPattern

use of com.qcadoo.view.internal.patterns.AbstractContainerPattern 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)1 ComponentPattern (com.qcadoo.view.internal.api.ComponentPattern)1 FormComponentPattern (com.qcadoo.view.internal.components.form.FormComponentPattern)1 WindowComponentPattern (com.qcadoo.view.internal.components.window.WindowComponentPattern)1 ViewDefinitionImpl (com.qcadoo.view.internal.internal.ViewDefinitionImpl)1 AbstractContainerPattern (com.qcadoo.view.internal.patterns.AbstractContainerPattern)1 AbstractPatternTest (com.qcadoo.view.internal.patterns.AbstractPatternTest)1 Test (org.junit.Test)1