summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSun Zhe <31067185+ZheSun88@users.noreply.github.com>2018-10-15 08:42:48 +0300
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>2018-10-17 12:47:34 +0300
commitc7adf840e4849549af5cffc874bbc86a00b8ef3f (patch)
treec28884b78af07b03c07b49753bf8d437e396e210
parent6b972aafe6c8b022be740a86ca5e0d4fab4986bb (diff)
downloadvaadin-framework-c7adf840e4849549af5cffc874bbc86a00b8ef3f.tar.gz
vaadin-framework-c7adf840e4849549af5cffc874bbc86a00b8ef3f.zip
Format the code (#11244)
-rw-r--r--client/src/main/java/com/vaadin/client/connectors/grid/ComponentRendererConnector.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridComponentsVisibility.java10
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsVisibilityTest.java42
-rw-r--r--uitest/src/test/java/com/vaadin/tests/push/BasicPushTest.java15
4 files changed, 38 insertions, 31 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/ComponentRendererConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/ComponentRendererConnector.java
index 649cec0b36..21e663356d 100644
--- a/client/src/main/java/com/vaadin/client/connectors/grid/ComponentRendererConnector.java
+++ b/client/src/main/java/com/vaadin/client/connectors/grid/ComponentRendererConnector.java
@@ -43,7 +43,7 @@ import com.vaadin.ui.renderers.ComponentRenderer;
*/
@Connect(ComponentRenderer.class)
public class ComponentRendererConnector
- extends AbstractGridRendererConnector<String> {
+ extends AbstractGridRendererConnector<String> {
private HashSet<String> knownConnectors = new HashSet<>();
private HandlerRegistration handlerRegistration;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponentsVisibility.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponentsVisibility.java
index 8c8810f7a8..aaa2d98027 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponentsVisibility.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponentsVisibility.java
@@ -24,9 +24,9 @@ public class GridComponentsVisibility extends AbstractTestUIWithLog {
protected void setup(VaadinRequest request) {
Grid<String> grid = new Grid<>();
grid.addColumn(string -> new Label(string), new ComponentRenderer())
- .setId("label").setCaption("Column 0");
+ .setId("label").setCaption("Column 0");
grid.getDefaultHeaderRow().getCell("label")
- .setComponent(new Label("Label"));
+ .setComponent(new Label("Label"));
grid.addComponentColumn(string -> {
if (textFields.containsKey(string)) {
log("Reusing old text field for: " + string);
@@ -41,7 +41,7 @@ public class GridComponentsVisibility extends AbstractTestUIWithLog {
grid.addColumn(string -> {
Button button = new Button("Click Me!",
- event -> toggleFieldVisibility(string));
+ event -> toggleFieldVisibility(string));
button.setId(string.replace(' ', '_').toLowerCase(Locale.ROOT));
return button;
}, new ComponentRenderer()).setId("button").setCaption("Button");
@@ -49,13 +49,13 @@ public class GridComponentsVisibility extends AbstractTestUIWithLog {
grid.setRowHeight(40);
grid.getDefaultHeaderRow().join("textField", "button")
- .setText("Other Components");
+ .setText("Other Components");
addComponent(grid);
grid.setSizeFull();
grid.setItems(IntStream.range(0, 5).boxed()
- .map(i -> "Row " + (i + (counter * 1000))));
+ .map(i -> "Row " + (i + (counter * 1000))));
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsVisibilityTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsVisibilityTest.java
index 14fa82a58e..3e8f806499 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsVisibilityTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsVisibilityTest.java
@@ -23,7 +23,8 @@ public class GridComponentsVisibilityTest extends MultiBrowserTest {
@Test
public void changingVisibilityOfComponentShouldNotThrowClientSideExceptions() {
- testHideComponent(grid -> ThreadLocalRandom.current().nextInt(1, (int) grid.getRowCount() - 1));
+ testHideComponent(grid -> ThreadLocalRandom.current().nextInt(1,
+ (int) grid.getRowCount() - 1));
}
@Test
@@ -31,12 +32,13 @@ public class GridComponentsVisibilityTest extends MultiBrowserTest {
testHideComponent(grid -> (int) grid.getRowCount() - 1);
}
- private void testHideComponent(Function<GridElement, Integer> rowUnderTestSupplier) {
+ private void testHideComponent(
+ Function<GridElement, Integer> rowUnderTestSupplier) {
openTestURL("debug");
GridElement grid = $(GridElement.class).first();
int rowUnderTest = rowUnderTestSupplier.apply(grid);
assertTrue("Text field should be visible", grid.getCell(rowUnderTest, 1)
- .isElementPresent(TextFieldElement.class));
+ .isElementPresent(TextFieldElement.class));
assertOtherConnectorsArePresent(grid, rowUnderTest);
clearDebugMessages();
@@ -57,34 +59,40 @@ public class GridComponentsVisibilityTest extends MultiBrowserTest {
clickVisibilityToggleButton(grid, rowUnderTest);
}
- private void assertOnlyTextFieldOnTestedRowIsNotPresent(GridElement grid, int rowUnderTest) {
- assertFalse("Text field should not be visible", grid.getCell(rowUnderTest, 1)
- .isElementPresent(TextFieldElement.class));
+ private void assertOnlyTextFieldOnTestedRowIsNotPresent(GridElement grid,
+ int rowUnderTest) {
+ assertFalse("Text field should not be visible",
+ grid.getCell(rowUnderTest, 1)
+ .isElementPresent(TextFieldElement.class));
assertOtherConnectorsArePresent(grid, rowUnderTest);
}
- private void assertAllTextFieldsArePresent(GridElement grid, int rowUnderTest) {
+ private void assertAllTextFieldsArePresent(GridElement grid,
+ int rowUnderTest) {
assertTrue("Text field should be visible", grid.getCell(rowUnderTest, 1)
- .isElementPresent(TextFieldElement.class));
+ .isElementPresent(TextFieldElement.class));
assertOtherConnectorsArePresent(grid, rowUnderTest);
}
private void assertNotClientSideErrors() {
assertNoErrorNotifications();
- // Should not log "Widget is still attached to the DOM ..." error message
+ // Should not log "Widget is still attached to the DOM ..." error
+ // message
assertNoDebugMessage(Level.SEVERE);
}
- private void clickVisibilityToggleButton(GridElement grid, int rowUnderTest) {
- grid.getRow(rowUnderTest).getCell(2).findElement(By.className("v-button")).click();
+ private void clickVisibilityToggleButton(GridElement grid,
+ int rowUnderTest) {
+ grid.getRow(rowUnderTest).getCell(2)
+ .findElement(By.className("v-button")).click();
}
- private void assertOtherConnectorsArePresent(GridElement grid, int rowUnderTest) {
+ private void assertOtherConnectorsArePresent(GridElement grid,
+ int rowUnderTest) {
IntStream.range(1, (int) grid.getRowCount())
- .filter(row -> row != rowUnderTest)
- .forEach(row ->
- assertTrue("Text field should be visible", grid.getCell(row, 1)
- .isElementPresent(TextFieldElement.class))
- );
+ .filter(row -> row != rowUnderTest)
+ .forEach(row -> assertTrue("Text field should be visible",
+ grid.getCell(row, 1)
+ .isElementPresent(TextFieldElement.class)));
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/push/BasicPushTest.java b/uitest/src/test/java/com/vaadin/tests/push/BasicPushTest.java
index 1264affcf2..91408fa4b4 100644
--- a/uitest/src/test/java/com/vaadin/tests/push/BasicPushTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/push/BasicPushTest.java
@@ -70,14 +70,13 @@ public abstract class BasicPushTest extends MultiBrowserTest {
protected void waitUntilClientCounterChanges(final int expectedValue) {
waitUntil(input -> {
- try {
- return BasicPushTest
- .getClientCounter(BasicPushTest.this) == expectedValue;
- } catch (NoSuchElementException e) {
- return false;
- }
- },
- 10);
+ try {
+ return BasicPushTest
+ .getClientCounter(BasicPushTest.this) == expectedValue;
+ } catch (NoSuchElementException e) {
+ return false;
+ }
+ }, 10);
}
protected void waitUntilServerCounterChanges() {