From a838d982040995d1207df26ea51ba41e7cf01f2e Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Fri, 22 Sep 2017 10:27:00 +0300 Subject: Replace CRLF with LF (#10062) After this change, .gitattributes will take care of keeping native line endings. * Replace CRLF with LF in non-Java files --- .../tests/components/grid/GridDetailsReattach.java | 74 ++++---- .../tests/push/MakeComponentVisibleWithPush.java | 208 ++++++++++----------- .../components/grid/GridDetailsReattachTest.java | 68 +++---- 3 files changed, 175 insertions(+), 175 deletions(-) (limited to 'uitest') diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java index 0328d87d07..13fb835658 100755 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsReattach.java @@ -1,37 +1,37 @@ -package com.vaadin.tests.components.grid; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Button; -import com.vaadin.ui.Grid; -import com.vaadin.ui.Label; -import com.vaadin.ui.VerticalLayout; - -public class GridDetailsReattach extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - final VerticalLayout verticalMain = new VerticalLayout(); - - final VerticalLayout layoutWithGrid = new VerticalLayout(); - - Grid grid = new Grid<>("Grid"); - grid.addColumn(String::toString).setCaption("Foo"); - grid.setHeight("150px"); - grid.setItems("Foo"); - grid.setDetailsGenerator(str -> new Label("AnyDetails")); - grid.setDetailsVisible("Foo", true); - layoutWithGrid.addComponent(grid); - - Button addCaptionToLayoutWithGridButton = new Button( - "Add caption to 'layoutWithGrid' layout"); - addCaptionToLayoutWithGridButton.addClickListener(e -> layoutWithGrid - .setCaption("Caption added to 'layoutWithGrid' layout")); - layoutWithGrid.addComponent(addCaptionToLayoutWithGridButton); - - verticalMain.addComponent(layoutWithGrid); - - addComponent(verticalMain); - - } -} +package com.vaadin.tests.components.grid; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Grid; +import com.vaadin.ui.Label; +import com.vaadin.ui.VerticalLayout; + +public class GridDetailsReattach extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final VerticalLayout verticalMain = new VerticalLayout(); + + final VerticalLayout layoutWithGrid = new VerticalLayout(); + + Grid grid = new Grid<>("Grid"); + grid.addColumn(String::toString).setCaption("Foo"); + grid.setHeight("150px"); + grid.setItems("Foo"); + grid.setDetailsGenerator(str -> new Label("AnyDetails")); + grid.setDetailsVisible("Foo", true); + layoutWithGrid.addComponent(grid); + + Button addCaptionToLayoutWithGridButton = new Button( + "Add caption to 'layoutWithGrid' layout"); + addCaptionToLayoutWithGridButton.addClickListener(e -> layoutWithGrid + .setCaption("Caption added to 'layoutWithGrid' layout")); + layoutWithGrid.addComponent(addCaptionToLayoutWithGridButton); + + verticalMain.addComponent(layoutWithGrid); + + addComponent(verticalMain); + + } +} diff --git a/uitest/src/main/java/com/vaadin/tests/push/MakeComponentVisibleWithPush.java b/uitest/src/main/java/com/vaadin/tests/push/MakeComponentVisibleWithPush.java index 2bc93317e8..82e1594f29 100644 --- a/uitest/src/main/java/com/vaadin/tests/push/MakeComponentVisibleWithPush.java +++ b/uitest/src/main/java/com/vaadin/tests/push/MakeComponentVisibleWithPush.java @@ -1,104 +1,104 @@ -package com.vaadin.tests.push; - -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.annotations.Push; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Button; -import com.vaadin.ui.Grid; -import com.vaadin.ui.UI; -import com.vaadin.ui.VerticalLayout; - -@Push -public class MakeComponentVisibleWithPush extends AbstractTestUI { - - private VerticalLayout rootLayout; - private Grid grid; - private SearchThread searchThread; - private List data; - - @Override - protected void setup(VaadinRequest request) { - data = new ArrayList<>(); - - rootLayout = new VerticalLayout(); - setContent(rootLayout); - - grid = new Grid(); - grid.addColumn(Person::getName); - grid.setVisible(false); - rootLayout.addComponent(grid); - - Button doUpdateButton = new Button("Do Update", event -> { - try { - doUpdate(); - } catch (InterruptedException e) { - } - }); - - rootLayout.addComponent(doUpdateButton); - } - - private void doUpdate() throws InterruptedException { - - cancelSuggestThread(); - - grid.setVisible(false); - grid.setItems(data); - - UI ui = UI.getCurrent(); - searchThread = new SearchThread(ui); - searchThread.start(); - - } - - class SearchThread extends Thread { - private UI ui; - - public SearchThread(UI ui) { - this.ui = ui; - } - - @Override - public void run() { - data = new ArrayList(data); - data.add(new Person("Person " + (data.size() + 1))); - - if (!searchThread.isInterrupted()) { - ui.access(() -> { - grid.setItems(data); - grid.setVisible(true); - }); - } - } - - } - - private void cancelSuggestThread() { - - if ((searchThread != null) && !searchThread.isInterrupted()) { - searchThread.interrupt(); - searchThread = null; - } - } - - class Person { - - private String name; - - public Person(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - } - -} +package com.vaadin.tests.push; + +import java.util.ArrayList; +import java.util.List; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Grid; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +@Push +public class MakeComponentVisibleWithPush extends AbstractTestUI { + + private VerticalLayout rootLayout; + private Grid grid; + private SearchThread searchThread; + private List data; + + @Override + protected void setup(VaadinRequest request) { + data = new ArrayList<>(); + + rootLayout = new VerticalLayout(); + setContent(rootLayout); + + grid = new Grid(); + grid.addColumn(Person::getName); + grid.setVisible(false); + rootLayout.addComponent(grid); + + Button doUpdateButton = new Button("Do Update", event -> { + try { + doUpdate(); + } catch (InterruptedException e) { + } + }); + + rootLayout.addComponent(doUpdateButton); + } + + private void doUpdate() throws InterruptedException { + + cancelSuggestThread(); + + grid.setVisible(false); + grid.setItems(data); + + UI ui = UI.getCurrent(); + searchThread = new SearchThread(ui); + searchThread.start(); + + } + + class SearchThread extends Thread { + private UI ui; + + public SearchThread(UI ui) { + this.ui = ui; + } + + @Override + public void run() { + data = new ArrayList(data); + data.add(new Person("Person " + (data.size() + 1))); + + if (!searchThread.isInterrupted()) { + ui.access(() -> { + grid.setItems(data); + grid.setVisible(true); + }); + } + } + + } + + private void cancelSuggestThread() { + + if ((searchThread != null) && !searchThread.isInterrupted()) { + searchThread.interrupt(); + searchThread = null; + } + } + + class Person { + + private String name; + + public Person(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsReattachTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsReattachTest.java index a6fa1dae94..5f0ebc6178 100755 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsReattachTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsReattachTest.java @@ -1,34 +1,34 @@ -package com.vaadin.tests.components.grid; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.parallel.TestCategory; -import com.vaadin.tests.tb3.MultiBrowserTest; - -@TestCategory("grid") -public class GridDetailsReattachTest extends MultiBrowserTest { - - @Before - public void setUp() { - setDebug(true); - } - - @Test - public void clickToAddCaption() { - openTestURL(); - Assert.assertTrue("Grid details don't exist", hasDetailsElement()); - $(ButtonElement.class).first().click(); - Assert.assertTrue("Grid details don't exist after deattach and reattach",hasDetailsElement() ); - } - - private final By locator = By.className("v-grid-spacer"); - - private boolean hasDetailsElement() { - return !findElements(locator).isEmpty(); - } - -} +package com.vaadin.tests.components.grid; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.parallel.TestCategory; +import com.vaadin.tests.tb3.MultiBrowserTest; + +@TestCategory("grid") +public class GridDetailsReattachTest extends MultiBrowserTest { + + @Before + public void setUp() { + setDebug(true); + } + + @Test + public void clickToAddCaption() { + openTestURL(); + Assert.assertTrue("Grid details don't exist", hasDetailsElement()); + $(ButtonElement.class).first().click(); + Assert.assertTrue("Grid details don't exist after deattach and reattach",hasDetailsElement() ); + } + + private final By locator = By.className("v-grid-spacer"); + + private boolean hasDetailsElement() { + return !findElements(locator).isEmpty(); + } + +} -- cgit v1.2.3