aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Motornyi <elmot@vaadin.com>2018-05-02 13:34:10 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-05-02 13:34:10 +0300
commitc4d621c7772347f1b90c94d566c894b7434cb7f1 (patch)
tree896e04c4002ccec28d60995fb9534acbd91d211d
parent494dac9ec2f509777a1a31579c3aaaf84b158709 (diff)
downloadvaadin-framework-c4d621c7772347f1b90c94d566c894b7434cb7f1.tar.gz
vaadin-framework-c4d621c7772347f1b90c94d566c894b7434cb7f1.zip
Enable formatting in testbench-api module (#10852)
-rw-r--r--server/src/main/java/com/vaadin/ui/ComponentRootSetter.java9
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/colorpicker/HexPatternParsingTest.java3
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/tree/TreeDeclarativeTest.java25
-rw-r--r--testbench-api/pom.xml4
-rw-r--r--testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java3
6 files changed, 25 insertions, 21 deletions
diff --git a/server/src/main/java/com/vaadin/ui/ComponentRootSetter.java b/server/src/main/java/com/vaadin/ui/ComponentRootSetter.java
index fe0a8e6a88..92116e49df 100644
--- a/server/src/main/java/com/vaadin/ui/ComponentRootSetter.java
+++ b/server/src/main/java/com/vaadin/ui/ComponentRootSetter.java
@@ -52,7 +52,8 @@ public class ComponentRootSetter implements Serializable {
}
/**
- * Checks if the given custom component or composite may accept a root component.
+ * Checks if the given custom component or composite may accept a root
+ * component.
* <p>
* For internal use only.
*
@@ -63,11 +64,11 @@ public class ComponentRootSetter implements Serializable {
*
*/
public static boolean canSetRoot(Component customComponent) {
- if(customComponent instanceof CustomComponent) {
+ if (customComponent instanceof CustomComponent) {
return true;
}
- if(customComponent instanceof Composite) {
- return ((Composite)customComponent).getCompositionRoot() == null;
+ if (customComponent instanceof Composite) {
+ return ((Composite) customComponent).getCompositionRoot() == null;
}
return false;
}
diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
index 8c7af4273a..ea593041ab 100644
--- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
@@ -209,4 +209,4 @@ public class ColorPickerPreview extends CssLayout implements HasValue<Color> {
.concat("' is not in any recognized format");
}
-} \ No newline at end of file
+}
diff --git a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/HexPatternParsingTest.java b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/HexPatternParsingTest.java
index a79e928ddf..5b0755ca1e 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/HexPatternParsingTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/HexPatternParsingTest.java
@@ -36,7 +36,8 @@ public class HexPatternParsingTest {
public static Collection<Object[]> hexdata() {
Object[][] validValues = { { "#000000", 0, 0, 0, true },
{ "#ffffff", 255, 255, 255, true },
- { "#FF00ff", 255, 0, 255, true }, { "#aa90e3",170,144,227, true },
+ { "#FF00ff", 255, 0, 255, true },
+ { "#aa90e3", 170, 144, 227, true },
{ "#016953", 1, 105, 83, true },
{ "#bC64D0", 188, 100, 208, true },
{ "#F100FF", 241, 0, 255, true },
diff --git a/server/src/test/java/com/vaadin/tests/server/component/tree/TreeDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/tree/TreeDeclarativeTest.java
index 0e51c93d1d..bd499425aa 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/tree/TreeDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/tree/TreeDeclarativeTest.java
@@ -149,22 +149,19 @@ public class TreeDeclarativeTest
public void testUpdateExisting() {
Tree tree = new Tree();
- String treeDesign =
- "<vaadin-tree selection-mode=\"MULTI\">" +
- "<node item=\"A\">A</node>" +
- "<node item=\"B\">B</node>" +
- "<node item=\"AA\" parent=\"A\">AA</node>" +
- "</vaadin-tree>";
+ String treeDesign = "<vaadin-tree selection-mode=\"MULTI\">"
+ + "<node item=\"A\">A</node>" + "<node item=\"B\">B</node>"
+ + "<node item=\"AA\" parent=\"A\">AA</node>" + "</vaadin-tree>";
Design.read(new ByteArrayInputStream(treeDesign.getBytes()), tree);
- Object[] items = tree.getDataProvider().
- fetchChildren(new HierarchicalQuery(null, null)).toArray();
- assertArrayEquals(new Object[]{"A", "B"}, items);
- Object[] itemsA = tree.getDataProvider().
- fetchChildren(new HierarchicalQuery(null, "A")).toArray();
- assertArrayEquals(new Object[]{"AA"}, itemsA);
- long countB = tree.getDataProvider().
- fetchChildren(new HierarchicalQuery(null, "B")).count();
+ Object[] items = tree.getDataProvider()
+ .fetchChildren(new HierarchicalQuery(null, null)).toArray();
+ assertArrayEquals(new Object[] { "A", "B" }, items);
+ Object[] itemsA = tree.getDataProvider()
+ .fetchChildren(new HierarchicalQuery(null, "A")).toArray();
+ assertArrayEquals(new Object[] { "AA" }, itemsA);
+ long countB = tree.getDataProvider()
+ .fetchChildren(new HierarchicalQuery(null, "B")).count();
assertEquals(0L, countB);
assertTrue(tree.getSelectionModel() instanceof SelectionModel.Multi);
}
diff --git a/testbench-api/pom.xml b/testbench-api/pom.xml
index ac0e2e7b02..e07dad1ca7 100644
--- a/testbench-api/pom.xml
+++ b/testbench-api/pom.xml
@@ -36,6 +36,10 @@
<build>
<plugins>
<plugin>
+ <groupId>net.revelc.code.formatter</groupId>
+ <artifactId>formatter-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java
index c9c91a9be6..2f78e01f13 100644
--- a/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java
+++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java
@@ -462,7 +462,8 @@ public class GridElement extends AbstractComponentElement {
Optional<WebElement> toggleButton = getDriver()
.findElement(By.className("v-grid-sidebar-content"))
.findElements(By.className("column-hiding-toggle")).stream()
- .filter(element -> element.getText().equals(toggleCaption)).findAny();
+ .filter(element -> element.getText().equals(toggleCaption))
+ .findAny();
if (toggleButton.isPresent()) {
toggleButton.ifPresent(element -> element.click());
} else {