aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-09-18 23:16:02 +0200
committerHenri Sara <henri.sara@gmail.com>2017-09-19 14:25:46 +0300
commitf6e082f5172d791a49d98a6b6b7770d3b38c8695 (patch)
tree439c6d53e57e8b24f81f341eb0fc93583a3c42bd /uitest
parentd8baecb239b0d91f477c450d2a08a472b169a08d (diff)
downloadvaadin-framework-f6e082f5172d791a49d98a6b6b7770d3b38c8695.tar.gz
vaadin-framework-f6e082f5172d791a49d98a6b6b7770d3b38c8695.zip
Use String.isEmpty()
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestBench.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/TestBase.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewWithRTE.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/ItemClickEvents.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/ui/MultiFileUploadTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/dd/DDTest5.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRowTest.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/tb3/PrivateTB3Configuration.java4
-rw-r--r--uitest/src/test/java/com/vaadin/tests/tb3/TooltipTest.java2
-rw-r--r--uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java12
12 files changed, 18 insertions, 18 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/TestBench.java b/uitest/src/main/java/com/vaadin/tests/TestBench.java
index 076d02b4be..7de6e4e2c5 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestBench.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestBench.java
@@ -134,7 +134,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication
public void uriFragmentChanged(
UriFragmentChangedEvent source) {
String fragment = source.getUriFragment();
- if (fragment != null && !"".equals(fragment)) {
+ if (fragment != null && !fragment.isEmpty()) {
// try to find a proper test class
// exact match
diff --git a/uitest/src/main/java/com/vaadin/tests/components/TestBase.java b/uitest/src/main/java/com/vaadin/tests/components/TestBase.java
index 9a3906bdc0..9e638682ce 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/TestBase.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/TestBase.java
@@ -22,7 +22,7 @@ public abstract class TestBase extends AbstractTestCase {
window.getContent().setSizeFull();
Label label = new Label(getDescription(), ContentMode.HTML);
- if (label.getValue() == null || "".equals(label.getValue())) {
+ if (label.getValue() == null || label.getValue().isEmpty()) {
// This is only an ugly hack to be screenshot compatible to be able
// to detect real problems when introducing IE font-size/line-height
// fixes
diff --git a/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewWithRTE.java b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
index 069ccef2bb..a411013ae3 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
@@ -30,7 +30,7 @@ public class PopupViewWithRTE extends TestBase {
@Override
public String getMinimizedValueAsHTML() {
String value = rte.getValue();
- if (value == null || "".equals(value)) {
+ if (value == null || value.isEmpty()) {
value = "Initial <b>content</b> for <h3>rte</h3>.";
rte.setValue(value);
rte.setHeight("150px");
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ItemClickEvents.java b/uitest/src/main/java/com/vaadin/tests/components/table/ItemClickEvents.java
index f5e62adfc8..1fbc932374 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/ItemClickEvents.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/ItemClickEvents.java
@@ -123,7 +123,7 @@ public class ItemClickEvents extends AbstractReindeerTestUI {
if (event.isShiftKey()) {
modifiers += "shift ";
}
- if (!"".equals(modifiers)) {
+ if (!modifiers.isEmpty()) {
modifiers = " (" + modifiers.trim() + ")";
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/MultiFileUploadTest.java b/uitest/src/main/java/com/vaadin/tests/components/ui/MultiFileUploadTest.java
index 0533099a54..ffa9b55b3a 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/ui/MultiFileUploadTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/ui/MultiFileUploadTest.java
@@ -39,7 +39,7 @@ public class MultiFileUploadTest extends AbstractTestUIWithLog {
@Override
public void filenameChanged(ChangeEvent event) {
- if (event.getFilename().equals("")) {
+ if (event.getFilename().isEmpty()) {
removeUpload(event.getSource());
} else {
addUpload();
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 e932c02505..a5ad3c3f9c 100644
--- a/uitest/src/main/java/com/vaadin/tests/dd/DDTest5.java
+++ b/uitest/src/main/java/com/vaadin/tests/dd/DDTest5.java
@@ -147,7 +147,7 @@ public class DDTest5 extends TestBase {
String data = (String) dropEvent.getTransferable()
.getData("text/plain");
- if (data == null || "".equals(data)) {
+ if (data == null || data.isEmpty()) {
data = "-- no Text --";
}
cssLayout.addComponent(new WrappedLabel(data));
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java
index 4ec83dc6ec..c4a50bf0d1 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java
@@ -133,7 +133,7 @@ public class ValoThemeUI extends UI {
navigator.addView("dragging", Dragging.class);
String f = Page.getCurrent().getUriFragment();
- if (f == null || f.equals("")) {
+ if (f == null || f.isEmpty()) {
navigator.navigateTo("common");
}
diff --git a/uitest/src/test/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRowTest.java b/uitest/src/test/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRowTest.java
index 49847ae0b6..e20a6dd4ab 100644
--- a/uitest/src/test/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRowTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/elements/treetable/TreeTableElementExpandRowTest.java
@@ -48,7 +48,7 @@ public class TreeTableElementExpandRowTest extends MultiBrowserTest {
TreeTableRowElement row = tree.getRow(rowIndex);
WebElement cell = row.getCell(0);
String errorMessage = "";
- if (extraInfo != null && !extraInfo.equals("")) {
+ if (extraInfo != null && !extraInfo.isEmpty()) {
errorMessage += extraInfo;
}
errorMessage += "Return value of row=" + rowIndex + " cell=0 should be "
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java
index 5985420c93..3d2c8e8481 100644
--- a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -771,7 +771,7 @@ public abstract class AbstractTB3Test extends ParallelTest {
// Remove any possible URL parameters
String pathWithoutQueryParameters = pathWithQueryParameters
.replaceAll("\\?.*", "");
- if ("".equals(pathWithoutQueryParameters)) {
+ if (pathWithoutQueryParameters.isEmpty()) {
return "ROOT";
}
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/test/java/com/vaadin/tests/tb3/PrivateTB3Configuration.java
index abee2c1c2c..aae9b3e13f 100644
--- a/uitest/src/test/java/com/vaadin/tests/tb3/PrivateTB3Configuration.java
+++ b/uitest/src/test/java/com/vaadin/tests/tb3/PrivateTB3Configuration.java
@@ -211,7 +211,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
public static String getConfiguredDeploymentHostname() {
String hostName = getProperty(HOSTNAME_PROPERTY);
- if (hostName == null || "".equals(hostName)) {
+ if (hostName == null || hostName.isEmpty()) {
hostName = findAutoHostname();
}
@@ -232,7 +232,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
String portString = getProperty(PORT_PROPERTY);
int port = 8888;
- if (portString != null && !"".equals(portString)) {
+ if (portString != null && !portString.isEmpty()) {
port = Integer.parseInt(portString);
}
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/TooltipTest.java b/uitest/src/test/java/com/vaadin/tests/tb3/TooltipTest.java
index d58eca573f..9c99818a96 100644
--- a/uitest/src/test/java/com/vaadin/tests/tb3/TooltipTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/tb3/TooltipTest.java
@@ -91,7 +91,7 @@ public abstract class TooltipTest extends MultiBrowserTest {
protected void checkTooltipNotPresent() throws Exception {
try {
WebElement tooltip = getTooltip();
- if (!"".equals(tooltip.getText())
+ if (!tooltip.getText().isEmpty()
|| tooltip.getLocation().getX() > -999) {
Assert.fail("Found tooltip that shouldn't be visible: "
+ tooltip.getText() + " at " + tooltip.getLocation());
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
index aac48dc4d2..bc10780ef6 100644
--- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
+++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
@@ -253,7 +253,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
toggleColumnReordering();
selectMenuPath("Component", "State", "Selection mode", "multi");
List<TestBenchElement> gridHeaderRowCells = getGridHeaderRowCells();
- assertTrue(gridHeaderRowCells.get(0).getText().equals(""));
+ assertTrue(gridHeaderRowCells.get(0).getText().isEmpty());
assertColumnHeader("Column 0", gridHeaderRowCells.get(1));
assertColumnHeader("Column 1", gridHeaderRowCells.get(2));
assertColumnHeader("Column 2", gridHeaderRowCells.get(3));
@@ -263,7 +263,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
// then
gridHeaderRowCells = getGridHeaderRowCells();
- assertTrue(gridHeaderRowCells.get(0).getText().equals(""));
+ assertTrue(gridHeaderRowCells.get(0).getText().isEmpty());
assertColumnHeader("Column 1", gridHeaderRowCells.get(1));
assertColumnHeader("Column 0", gridHeaderRowCells.get(2));
assertColumnHeader("Column 2", gridHeaderRowCells.get(3));
@@ -277,7 +277,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
selectMenuPath("Component", "State", "Selection mode", "multi");
setFrozenColumns(1);
List<TestBenchElement> gridHeaderRowCells = getGridHeaderRowCells();
- assertTrue(gridHeaderRowCells.get(0).getText().equals(""));
+ assertTrue(gridHeaderRowCells.get(0).getText().isEmpty());
assertColumnHeader("Column 0", gridHeaderRowCells.get(1));
assertColumnHeader("Column 1", gridHeaderRowCells.get(2));
assertColumnHeader("Column 2", gridHeaderRowCells.get(3));
@@ -287,7 +287,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
// then
gridHeaderRowCells = getGridHeaderRowCells();
- assertTrue(gridHeaderRowCells.get(0).getText().equals(""));
+ assertTrue(gridHeaderRowCells.get(0).getText().isEmpty());
assertColumnHeader("Column 0", gridHeaderRowCells.get(1));
assertColumnHeader("Column 2", gridHeaderRowCells.get(2));
assertColumnHeader("Column 1", gridHeaderRowCells.get(3));
@@ -301,7 +301,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
selectMenuPath("Component", "State", "Selection mode", "multi");
setFrozenColumns(-1);
List<TestBenchElement> gridHeaderRowCells = getGridHeaderRowCells();
- assertTrue(gridHeaderRowCells.get(0).getText().equals(""));
+ assertTrue(gridHeaderRowCells.get(0).getText().isEmpty());
assertColumnHeader("Column 0", gridHeaderRowCells.get(1));
assertColumnHeader("Column 1", gridHeaderRowCells.get(2));
assertColumnHeader("Column 2", gridHeaderRowCells.get(3));
@@ -311,7 +311,7 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
// then
gridHeaderRowCells = getGridHeaderRowCells();
- assertTrue(gridHeaderRowCells.get(0).getText().equals(""));
+ assertTrue(gridHeaderRowCells.get(0).getText().isEmpty());
assertColumnHeader("Column 1", gridHeaderRowCells.get(1));
assertColumnHeader("Column 0", gridHeaderRowCells.get(2));
assertColumnHeader("Column 2", gridHeaderRowCells.get(3));