diff options
author | Teppo Kurki <teppo.kurki@vaadin.com> | 2015-06-11 13:40:30 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-06-11 14:35:58 +0000 |
commit | 40bfdbf83d2e622aa826c8b66f3e2ad7d29ddb6b (patch) | |
tree | 85bacb36c661dfa794f5a8aee50450ccc944d128 /server/tests | |
parent | f50b536d99cae402a604550a3493f111bab955da (diff) | |
download | vaadin-framework-40bfdbf83d2e622aa826c8b66f3e2ad7d29ddb6b.tar.gz vaadin-framework-40bfdbf83d2e622aa826c8b66f3e2ad7d29ddb6b.zip |
Adds margin support to GridLayout declarative format (#18238)
Change-Id: I5561ccf38f6bac3a304f6e8ab6262cb8bd391021
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java (renamed from server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTest.java) | 16 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java | 9 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java | 10 |
3 files changed, 21 insertions, 14 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTest.java b/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java index d31a93a68b..9fcb64acca 100644 --- a/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java @@ -16,20 +16,16 @@ package com.vaadin.tests.server.component; import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.tests.design.DeclarativeTestBase; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.MarginHandler; -@Ignore -public abstract class DeclarativeMarginTest<L extends Layout & MarginHandler> +public abstract class DeclarativeMarginTestBase<L extends Layout & MarginHandler> extends DeclarativeTestBase<L> { - @Test - public void testMargins() { + protected void testMargins(String componentTag) { for (int i = 0; i < 16; ++i) { boolean top = (i & 1) == 1; @@ -39,7 +35,7 @@ public abstract class DeclarativeMarginTest<L extends Layout & MarginHandler> MarginInfo m = new MarginInfo(top, right, bottom, left); - String design = getMarginTag(top, right, bottom, left); + String design = getMarginTag(componentTag, top, right, bottom, left); // The assertEquals machinery in DeclarativeTestBase uses bean // introspection and MarginInfo is not a proper bean. It ends up @@ -51,9 +47,9 @@ public abstract class DeclarativeMarginTest<L extends Layout & MarginHandler> } } - private String getMarginTag(boolean top, boolean right, boolean bottom, - boolean left) { - String s = "<v-vertical-layout "; + private String getMarginTag(String componentTag, boolean top, + boolean right, boolean bottom, boolean left) { + String s = "<" + componentTag + " "; if (left && right && top && bottom) { s += "margin='true'"; diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java index 38bd68e6e1..28ccfa407c 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java @@ -21,7 +21,7 @@ import java.util.List; import org.junit.Test; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.server.component.DeclarativeMarginTest; +import com.vaadin.tests.server.component.DeclarativeMarginTestBase; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; @@ -35,12 +35,17 @@ import com.vaadin.ui.VerticalLayout; * @author Vaadin Ltd */ public class AbstractOrderedLayoutDeclarativeTest extends - DeclarativeMarginTest<AbstractOrderedLayout> { + DeclarativeMarginTestBase<AbstractOrderedLayout> { private List<String> defaultAlignments = Arrays.asList(new String[] { ":top", ":left" }); @Test + public void testMargins() { + testMargins("v-vertical-layout"); + } + + @Test public void testExpandRatio() { String design = getDesign(1); AbstractOrderedLayout layout = getLayout(1, null); diff --git a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java index 7c9c126707..9d3b5001da 100644 --- a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java @@ -18,13 +18,19 @@ package com.vaadin.tests.server.component.gridlayout; import org.junit.Assert; import org.junit.Test; -import com.vaadin.tests.design.DeclarativeTestBase; +import com.vaadin.tests.server.component.DeclarativeMarginTestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Component; import com.vaadin.ui.GridLayout; import com.vaadin.ui.declarative.DesignContext; -public class GridLayoutDeclarativeTest extends DeclarativeTestBase<GridLayout> { +public class GridLayoutDeclarativeTest extends + DeclarativeMarginTestBase<GridLayout> { + + @Test + public void testMargins() { + testMargins("v-grid-layout"); + } @Test public void testSimpleGridLayout() { |