diff options
author | Leif Åstrand <legioth@gmail.com> | 2017-02-01 11:09:04 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-02-01 11:09:04 +0200 |
commit | 07d56a9ca050d976dec4f598ed39471ae369c588 (patch) | |
tree | 167982734c11fa76b39cfad226b8f601174da17a /uitest | |
parent | 601de7e3ba5af6146ab0342bf3a924c9aa08a1b4 (diff) | |
download | vaadin-framework-07d56a9ca050d976dec4f598ed39471ae369c588.tar.gz vaadin-framework-07d56a9ca050d976dec4f598ed39471ae369c588.zip |
Add a maven plugin for formatting according to Eclipse settings
Running formatter:format will format all files in a submodule using an
embedded Eclipse compiler (based on Neon SR1)
according to the regular formatting settings file.
Diffstat (limited to 'uitest')
18 files changed, 80 insertions, 55 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java b/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java index fc9753bc22..215faeab7f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponents.java @@ -29,7 +29,8 @@ public class AbsoluteLayoutResizeComponents extends AbstractReindeerTestUI { * Build test layout for #8255 */ private void addStartWithFullWidth(AbsoluteLayout layout) { - final Panel full = new Panel(new CssLayout(new Label("Start Width 100%"))); + final Panel full = new Panel( + new CssLayout(new Label("Start Width 100%"))); full.setWidth("100%"); full.setId("expanding-panel"); @@ -41,7 +42,8 @@ public class AbsoluteLayoutResizeComponents extends AbstractReindeerTestUI { * Build test layout for #8256 */ private void addStartWithDefinedWidth(AbsoluteLayout layout) { - final Panel small = new Panel(new CssLayout(new Label("Start Width 250px"))); + final Panel small = new Panel( + new CssLayout(new Label("Start Width 250px"))); small.setWidth("250px"); small.setId("small-panel"); @@ -49,18 +51,19 @@ public class AbsoluteLayoutResizeComponents extends AbstractReindeerTestUI { layout.addComponent(expandButton(small), "left: 10x; top: 150px;"); } - /** * Build test layout for #8257 */ private void addStartWithDefinedWidthAbsoluteLayout(AbsoluteLayout layout) { AbsoluteLayout layoutExpading = new AbsoluteLayout(); layoutExpading.setWidth("250px"); - layoutExpading.addComponent(new Panel(new CssLayout(new Label("Start Width 250px")))); + layoutExpading.addComponent( + new Panel(new CssLayout(new Label("Start Width 250px")))); layoutExpading.setId("absolute-expanding"); layout.addComponent(layoutExpading, "right:0;top:200px;"); - layout.addComponent(expandButton(layoutExpading), "left: 10x; top: 250px;"); + layout.addComponent(expandButton(layoutExpading), + "left: 10x; top: 250px;"); } /** @@ -70,7 +73,8 @@ public class AbsoluteLayoutResizeComponents extends AbstractReindeerTestUI { * @return Created Expand Button */ private Button expandButton(Component component) { - Button button = new Button("Change Size", clickEvent -> resizeComponent(component)); + Button button = new Button("Change Size", + clickEvent -> resizeComponent(component)); button.setId(component.getId() + "-button"); return button; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java index a2589ce452..7cb0e63545 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDataSourceReset.java @@ -37,7 +37,8 @@ public class GridDataSourceReset extends AbstractTestUI { persons = createPersons(10, new Random(1)); grid = new Grid<>(); - ListDataProvider<ComplexPerson> provider = DataProvider.ofCollection(persons); + ListDataProvider<ComplexPerson> provider = DataProvider + .ofCollection(persons); grid.setDataProvider(provider); grid.getSelectionModel().select(persons.get(0)); addComponent(new Button("Remove first", event -> { diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataProvider.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataProvider.java index 87da435796..66b73eb87d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataProvider.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataProvider.java @@ -35,7 +35,8 @@ public class RefreshDataProvider extends AbstractReindeerTestUI { Grid<DataObject> grid = new Grid<>(); List<DataObject> data = DataObject.generateObjects(); - ListDataProvider<DataObject> dataProvider = DataProvider.ofCollection(data); + ListDataProvider<DataObject> dataProvider = DataProvider + .ofCollection(data); grid.setDataProvider(dataProvider); grid.setDataProvider(dataProvider); diff --git a/uitest/src/main/java/com/vaadin/tests/dd/DDTest5.java b/uitest/src/main/java/com/vaadin/tests/dd/DDTest5.java index 0e7fd737d0..e932c02505 100644 --- a/uitest/src/main/java/com/vaadin/tests/dd/DDTest5.java +++ b/uitest/src/main/java/com/vaadin/tests/dd/DDTest5.java @@ -52,11 +52,10 @@ public class DDTest5 extends TestBase { HorizontalSortableCssLayoutWithWrappers verticalSortableCssLayoutWithWrappers = new HorizontalSortableCssLayoutWithWrappers(); w.addWindow(verticalSortableCssLayoutWithWrappers); verticalSortableCssLayoutWithWrappers.setPositionX(200); - verticalSortableCssLayoutWithWrappers - .setPositionY(40); /* - * FIXME: subwindow horizontal position does - * not work if only x set - */ + /* + * FIXME: subwindow horizontal position does not work if only x set + */ + verticalSortableCssLayoutWithWrappers.setPositionY(40); Label l; diff --git a/uitest/src/main/java/com/vaadin/tests/elements/CompatibilityElementComponentGetCaptionHorizontal.java b/uitest/src/main/java/com/vaadin/tests/elements/CompatibilityElementComponentGetCaptionHorizontal.java index e980471959..34b3663c7d 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/CompatibilityElementComponentGetCaptionHorizontal.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/CompatibilityElementComponentGetCaptionHorizontal.java @@ -17,8 +17,8 @@ package com.vaadin.tests.elements; import com.vaadin.ui.HorizontalLayout; -public class CompatibilityElementComponentGetCaptionHorizontal extends - CompatibilityElementComponentGetCaptionBase { +public class CompatibilityElementComponentGetCaptionHorizontal + extends CompatibilityElementComponentGetCaptionBase { public CompatibilityElementComponentGetCaptionHorizontal() { mainLayout = new HorizontalLayout(); diff --git a/uitest/src/main/java/com/vaadin/tests/elements/abstracttextfield/CompatibilityAbstractFieldElementSetValueReadOnly.java b/uitest/src/main/java/com/vaadin/tests/elements/abstracttextfield/CompatibilityAbstractFieldElementSetValueReadOnly.java index 2b18a48095..768177683a 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/abstracttextfield/CompatibilityAbstractFieldElementSetValueReadOnly.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/abstracttextfield/CompatibilityAbstractFieldElementSetValueReadOnly.java @@ -20,7 +20,8 @@ import com.vaadin.v7.ui.TextField; import com.vaadin.v7.ui.Tree; import com.vaadin.v7.ui.TwinColSelect; -public class CompatibilityAbstractFieldElementSetValueReadOnly extends AbstractTestUI { +public class CompatibilityAbstractFieldElementSetValueReadOnly + extends AbstractTestUI { AbstractField<?>[] elems = { new ComboBox(), new ListSelect(), new NativeSelect(), new OptionGroup(), new Table(), new Tree(), diff --git a/uitest/src/main/java/com/vaadin/tests/elements/grid/GridUI.java b/uitest/src/main/java/com/vaadin/tests/elements/grid/GridUI.java index b92c667307..a90072c31f 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/grid/GridUI.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/grid/GridUI.java @@ -21,8 +21,8 @@ public class GridUI extends AbstractTestUI { final Grid<Item> grid = new Grid<Item>(); grid.setItems(getMockData(rowCount)); Grid.Column<Item, String> column = grid.addColumn(Item::getFoo) - .setCaption("foo"); - HeaderRow row =grid.addHeaderRowAt(1); + .setCaption("foo"); + HeaderRow row = grid.addHeaderRowAt(1); row.getCell(column).setText("extra row"); grid.addColumn(Item::getBar).setCaption("bar"); diff --git a/uitest/src/main/java/com/vaadin/tests/elements/nativeselect/NativeSelectSetValue.java b/uitest/src/main/java/com/vaadin/tests/elements/nativeselect/NativeSelectSetValue.java index 43fc10cde1..3849439b16 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/nativeselect/NativeSelectSetValue.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/nativeselect/NativeSelectSetValue.java @@ -13,7 +13,6 @@ import com.vaadin.ui.NativeSelect; public class NativeSelectSetValue extends AbstractTestUI { - private int counter = 0; Label lblCounter = new Label("0"); diff --git a/uitest/src/main/java/com/vaadin/tests/elements/notification/NotificationGetTypeAndDescription.java b/uitest/src/main/java/com/vaadin/tests/elements/notification/NotificationGetTypeAndDescription.java index 2b208d3e42..f57d8418ec 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/notification/NotificationGetTypeAndDescription.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/notification/NotificationGetTypeAndDescription.java @@ -11,9 +11,10 @@ import com.vaadin.ui.Notification.Type; public class NotificationGetTypeAndDescription extends AbstractTestUI { private final static Type[] types = { Type.WARNING_MESSAGE, - Type.ERROR_MESSAGE, Type.HUMANIZED_MESSAGE, Type.TRAY_NOTIFICATION }; - public final static String[] type_names = { "warning", "error", - "humanized", "tray_notification" }; + Type.ERROR_MESSAGE, Type.HUMANIZED_MESSAGE, + Type.TRAY_NOTIFICATION }; + public final static String[] type_names = { "warning", "error", "humanized", + "tray_notification" }; public final static String[] captions = { "warningC", "errorC", "humanizedC", "tray_notificationC" }; public final static String[] descriptions = { "warning", "error", diff --git a/uitest/src/main/java/com/vaadin/tests/elements/tabsheet/TabSheetElementTabWithoutCaption.java b/uitest/src/main/java/com/vaadin/tests/elements/tabsheet/TabSheetElementTabWithoutCaption.java index 048baf7404..d0cc9e4eb7 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/tabsheet/TabSheetElementTabWithoutCaption.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/tabsheet/TabSheetElementTabWithoutCaption.java @@ -42,18 +42,18 @@ public class TabSheetElementTabWithoutCaption extends AbstractTestUI { addComponent(ts); // Create a tab sheet that has icons instead of text captions TabSheet ts2 = new TabSheet(); - newTab = ts2.addTab(createTabContent(10), null, new ThemeResource( - "favicon.ico")); + newTab = ts2.addTab(createTabContent(10), null, + new ThemeResource("favicon.ico")); newTab.setClosable(true); - newTab = ts2.addTab(createTabContent(11), null, new ThemeResource( - "window/img/maximize.png")); + newTab = ts2.addTab(createTabContent(11), null, + new ThemeResource("window/img/maximize.png")); newTab.setClosable(false); newTab = ts2.addTab(createTabContent(12)); newTab.setClosable(false); newTab = ts2.addTab(createTabContent(12)); newTab.setClosable(true); - newTab = ts2.addTab(createTabContent(13), null, new ThemeResource( - "window/img/restore.png")); + newTab = ts2.addTab(createTabContent(13), null, + new ThemeResource("window/img/restore.png")); newTab.setClosable(true); addComponent(ts2); } diff --git a/uitest/src/main/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRow.java b/uitest/src/main/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRow.java index cde3fc794b..eedbf705ba 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRow.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRow.java @@ -6,7 +6,6 @@ import com.vaadin.v7.ui.TreeTable; public class TreeTableElementExpandRow extends AbstractTestUI { - TreeTable treeTable = new TreeTable(); public static final String TEST_VALUE = "testValue"; diff --git a/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java b/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java index 90d668cf78..89bb76abe7 100644 --- a/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java +++ b/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java @@ -12,8 +12,7 @@ import com.vaadin.data.provider.Query; * * @author Vaadin Ltd */ -public class ItemDataProvider - extends CallbackDataProvider<String, String> { +public class ItemDataProvider extends CallbackDataProvider<String, String> { public ItemDataProvider(int size) { super(q -> itemStream(q, size).skip(q.getOffset()).limit(q.getLimit()), diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/EmptyEnum.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/EmptyEnum.java index 6e0b97eea7..7bf5ac25ce 100644 --- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/EmptyEnum.java +++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/EmptyEnum.java @@ -22,4 +22,3 @@ package com.vaadin.tests.widgetset.client; public enum EmptyEnum { } - diff --git a/uitest/src/test/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponentsTest.java b/uitest/src/test/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponentsTest.java index 6efee81a04..d25e2088c9 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponentsTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutResizeComponentsTest.java @@ -9,7 +9,6 @@ import org.openqa.selenium.WebElement; import java.util.Optional; - /** * Tests for component positioning after width changes from defined to relative and relative to defined */ @@ -23,20 +22,27 @@ public class AbsoluteLayoutResizeComponentsTest extends MultiBrowserTest { Optional<WebElement> panelWrapper = getComponentWrapper(componentId); - Assert.assertTrue("No wrapper element found for expanding panel [ID: " + componentId + "]", panelWrapper.isPresent()); + Assert.assertTrue("No wrapper element found for expanding panel [ID: " + + componentId + "]", panelWrapper.isPresent()); String left = panelWrapper.get().getCssValue("left"); - Assert.assertEquals("Component wrapper was missing left:0; from its css positioning", "0px", left); + Assert.assertEquals( + "Component wrapper was missing left:0; from its css positioning", + "0px", left); WebElement panelComponent = findElement(By.id(componentId)); - Assert.assertEquals("Panel is not on the left side of the screen", 0, panelComponent.getLocation().getX()); + Assert.assertEquals("Panel is not on the left side of the screen", 0, + panelComponent.getLocation().getX()); // Click button to change component size $(ButtonElement.class).id(componentId + "-button").click(); left = panelWrapper.get().getCssValue("left"); - Assert.assertEquals("Component wrapper did not have its left positioning reset to auto", "auto", left); - Assert.assertNotEquals("Panel is still on the left side of the screen", 0, panelComponent.getLocation().getX()); + Assert.assertEquals( + "Component wrapper did not have its left positioning reset to auto", + "auto", left); + Assert.assertNotEquals("Panel is still on the left side of the screen", + 0, panelComponent.getLocation().getX()); } @Test @@ -47,22 +53,29 @@ public class AbsoluteLayoutResizeComponentsTest extends MultiBrowserTest { Optional<WebElement> panelWrapper = getComponentWrapper(componentId); - Assert.assertTrue("No wrapper element found for panel [ID: " + componentId + "]", panelWrapper.isPresent()); + Assert.assertTrue( + "No wrapper element found for panel [ID: " + componentId + "]", + panelWrapper.isPresent()); String left = panelWrapper.get().getCssValue("left"); - Assert.assertEquals("Component wrapper has a set Left marker", "auto", left); + Assert.assertEquals("Component wrapper has a set Left marker", "auto", + left); WebElement panelComponent = findElement(By.id(componentId)); - Assert.assertNotEquals("Panel is positioned to the left side of the screen", 0, panelComponent.getLocation().getX()); + Assert.assertNotEquals( + "Panel is positioned to the left side of the screen", 0, + panelComponent.getLocation().getX()); // Click button to change component size $(ButtonElement.class).id(componentId + "-button").click(); - left = panelWrapper.get().getCssValue("left"); - Assert.assertEquals("Component wrapper was missing left:0; from its css positioning", "0px", left); + Assert.assertEquals( + "Component wrapper was missing left:0; from its css positioning", + "0px", left); - Assert.assertEquals("Panel is not on the left side of the screen", 0, panelComponent.getLocation().getX()); + Assert.assertEquals("Panel is not on the left side of the screen", 0, + panelComponent.getLocation().getX()); } @Test @@ -73,21 +86,29 @@ public class AbsoluteLayoutResizeComponentsTest extends MultiBrowserTest { Optional<WebElement> panelWrapper = getComponentWrapper(componentId); - Assert.assertTrue("No wrapper element found for AbsoluteLayout [ID: " + componentId + "].", panelWrapper.isPresent()); + Assert.assertTrue("No wrapper element found for AbsoluteLayout [ID: " + + componentId + "].", panelWrapper.isPresent()); String left = panelWrapper.get().getCssValue("left"); - Assert.assertEquals("Component wrapper did not have its left positioning reset to auto", "auto", left); + Assert.assertEquals( + "Component wrapper did not have its left positioning reset to auto", + "auto", left); WebElement panelComponent = findElement(By.id(componentId)); - Assert.assertNotEquals("Panel is positioned to the left side of the screen", 0, panelComponent.getLocation().getX()); + Assert.assertNotEquals( + "Panel is positioned to the left side of the screen", 0, + panelComponent.getLocation().getX()); // Click button to change component size $(ButtonElement.class).id(componentId + "-button").click(); left = panelWrapper.get().getCssValue("left"); - Assert.assertEquals("Component wrapper was missing left:0; from its css positioning", "0px", left); + Assert.assertEquals( + "Component wrapper was missing left:0; from its css positioning", + "0px", left); - Assert.assertEquals("Panel is not on the left side of the screen", 0, panelComponent.getLocation().getX()); + Assert.assertEquals("Panel is not on the left side of the screen", 0, + panelComponent.getLocation().getX()); } /** @@ -99,7 +120,8 @@ public class AbsoluteLayoutResizeComponentsTest extends MultiBrowserTest { private Optional<WebElement> getComponentWrapper(String componentId) { WebElement panelWrapper = null; - for (WebElement wrapper : findElements(By.className("v-absolutelayout-wrapper"))) { + for (WebElement wrapper : findElements( + By.className("v-absolutelayout-wrapper"))) { // Check if this wrapper contains element with the wanted id. if (!wrapper.findElements(By.id(componentId)).isEmpty()) { panelWrapper = wrapper; diff --git a/uitest/src/test/java/com/vaadin/tests/components/ui/PushStateAndReplaceStateTest.java b/uitest/src/test/java/com/vaadin/tests/components/ui/PushStateAndReplaceStateTest.java index a57cbf6ed5..159967af2a 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/ui/PushStateAndReplaceStateTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/ui/PushStateAndReplaceStateTest.java @@ -25,7 +25,7 @@ public class PushStateAndReplaceStateTest extends MultiBrowserTest { driver.navigate().back(); driver.findElement(By.className("v-Notification")).getText() - .contains("Popstate event"); + .contains("Popstate event"); assertUri(getTestUrl()); diff --git a/uitest/src/test/java/com/vaadin/tests/data/ReplaceDataProviderTest.java b/uitest/src/test/java/com/vaadin/tests/data/ReplaceDataProviderTest.java index 7fa495cf24..41731296ac 100644 --- a/uitest/src/test/java/com/vaadin/tests/data/ReplaceDataProviderTest.java +++ b/uitest/src/test/java/com/vaadin/tests/data/ReplaceDataProviderTest.java @@ -46,8 +46,7 @@ public class ReplaceDataProviderTest extends SingleBrowserTest { private void assertCellText(String text, int rowIndex, int colIndex) { String firstCellText = $(GridElement.class).first() - .getCell(rowIndex, colIndex) - .getText(); + .getCell(rowIndex, colIndex).getText(); Assert.assertEquals(text, firstCellText); } } diff --git a/uitest/src/test/java/com/vaadin/tests/elements/CompatibilityComponentElementGetValueTest.java b/uitest/src/test/java/com/vaadin/tests/elements/CompatibilityComponentElementGetValueTest.java index 28ed259840..c2a0c81b6c 100644 --- a/uitest/src/test/java/com/vaadin/tests/elements/CompatibilityComponentElementGetValueTest.java +++ b/uitest/src/test/java/com/vaadin/tests/elements/CompatibilityComponentElementGetValueTest.java @@ -35,7 +35,8 @@ import com.vaadin.tests.tb3.MultiBrowserTest; * the License. */ -public class CompatibilityComponentElementGetValueTest extends MultiBrowserTest { +public class CompatibilityComponentElementGetValueTest + extends MultiBrowserTest { @Before public void init() { diff --git a/uitest/src/test/java/com/vaadin/tests/elements/grid/GridUITest.java b/uitest/src/test/java/com/vaadin/tests/elements/grid/GridUITest.java index 8652972df1..8ac0aae0fe 100644 --- a/uitest/src/test/java/com/vaadin/tests/elements/grid/GridUITest.java +++ b/uitest/src/test/java/com/vaadin/tests/elements/grid/GridUITest.java @@ -83,7 +83,7 @@ public class GridUITest extends MultiBrowserTest { GridElement grid = $(GridElement.class).first(); grid.getHeaderCellByCaption(1, "extra row"); } - + private int checkRows() { int rowCount = 0; for (final GridRowElement row : getRows()) { |