@@ -0,0 +1,3241 @@
+package com.xaadin.elementfactory;%0A%0Aimport com.vaadin.server.Sizeable;%0Aimport com.vaadin.ui.Button;%0Aimport com.vaadin.ui.HorizontalSplitPanel;%0Aimport com.vaadin.ui.VerticalSplitPanel;%0Aimport com.xaadin.VisualTreeNode;%0Aimport com.xaadin.VisualTreeNodeImpl;%0Aimport org.fest.assertions.data.Offset;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.fest.assertions.api.Assertions.assertThat;%0A%0A/**%0A * Created by Hendrik J%C3%BCrgens on 27.01.14.%0A */%0Apublic class SplitPanelElementFactoryTest %7B%0A%0A    private SplitPanelElementFactory factory;%0A%0A    @Before%0A    public void setUp() %7B%0A        factory = new SplitPanelElementFactory();%0A    %7D%0A%0A    @Test%0A    public void testAddComponentToParent() throws Exception %7B%0A        Button btn1 = new Button();%0A        Button btn2 = new Button();%0A%0A        HorizontalSplitPanel panel = new HorizontalSplitPanel();%0A        VisualTreeNode splitPanelVisualTreeNode = new VisualTreeNodeImpl(panel);%0A%0A        factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn1));%0A        factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn2));%0A%0A        assertThat(panel.getComponentCount()).isEqualTo(2);%0A        assertThat(panel.getFirstComponent()).isSameAs(btn1);%0A        assertThat(panel.getSecondComponent()).isSameAs(btn2);%0A    %7D%0A%0A    @Test%0A    public void testAddComponentToParentWithExpandRatio() throws Exception %7B%0A        Button btn1 = new Button();%0A        Button btn2 = new Button();%0A%0A        HorizontalSplitPanel panel = new HorizontalSplitPanel();%0A        VisualTreeNode splitPanelVisualTreeNode = new VisualTreeNodeImpl(panel);%0A        splitPanelVisualTreeNode.setAdditionalParameter(%22splitPosition%22, %220.65%22);%0A%0A        factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn1));%0A        factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn2));%0A%0A        assertThat(panel.getComponentCount()).isEqualTo(2);%0A        assertThat(panel.getFirstComponent()).isSameAs(btn1);%0A        assertThat(panel.getSecondComponent()).isSameAs(btn2);%0A        assertThat(panel.getSplitPositionUnit()).isEqualTo(Sizeable.Unit.PERCENTAGE);%0A        assertThat(panel.getSplitPosition()).isEqualTo(0.65f * 100.f, Offset.offset(0.01f));%0A    %7D%0A%0A    @Test(expected = ElementFactoryException.class)%0A    public void testAddComponentToParentMoreThanTwoComponents() throws Exception %7B%0A        Button btn1 = new Button();%0A        Button btn2 = new Button();%0A        Button btn3 = new Button();%0A%0A        HorizontalSplitPanel panel = new HorizontalSplitPanel();%0A        VisualTreeNode splitPanelVisualTreeNode = new VisualTreeNodeImpl(panel);%0A%0A        factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn1));%0A        factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn2));%0A        factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn3));%0A    %7D%0A%0A%0A    @Test%0A    public void testIsClassSupportedForElementFactory() throws Exception %7B%0A        assertThat(factory.isClassSupportedForElementFactory(HorizontalSplitPanel.class.getName()));%0A        assertThat(factory.isClassSupportedForElementFactory(VerticalSplitPanel.class.getName()));%0A    %7D%0A%7D%0A

Add SplitPanelElementFactoryTest