summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-09-29 14:11:59 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-09-29 15:11:59 +0300
commit3c7a9514117b348336b89306de735d92c8e9f463 (patch)
tree8f0eccfc3afa3cc47a97f565719295dd28926951 /uitest
parent241b7fadca23259f300ed0e09cb2c27c8b55dcaf (diff)
downloadvaadin-framework-3c7a9514117b348336b89306de735d92c8e9f463.tar.gz
vaadin-framework-3c7a9514117b348336b89306de735d92c8e9f463.zip
Use StandardCharsets.UTF_8 (#10113)
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java11
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutWithMissingSlot.java4
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/window/WindowCloseShortcuts.java4
-rw-r--r--uitest/src/main/java/com/vaadin/tests/declarative/DeclarativeEditor.java5
4 files changed, 12 insertions, 12 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java b/uitest/src/main/java/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java
index 898e01cb0c..e6fd9791b4 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java
@@ -1,8 +1,9 @@
package com.vaadin.tests.components.browserframe;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
import com.vaadin.server.StreamResource;
import com.vaadin.tests.components.TestBase;
@@ -100,13 +101,7 @@ public class BrowserFrameIsVisible extends TestBase {
sb.append("\n");
}
- try {
- return new ByteArrayInputStream(
- sb.toString().getBytes("UTF-8"));
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- return null;
- }
+ return new ByteArrayInputStream(sb.toString().getBytes(UTF_8));
}
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutWithMissingSlot.java b/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutWithMissingSlot.java
index ba5c468a44..d108e2b457 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutWithMissingSlot.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/customlayout/CustomLayoutWithMissingSlot.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.tests.components.customlayout;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -34,7 +36,7 @@ public class CustomLayoutWithMissingSlot extends AbstractTestUIWithLog {
try {
cl = new CustomLayout(new ByteArrayInputStream(
"<div>First: <div location='first'></div><p>Second: <div location='second'></div><p>"
- .getBytes("UTF-8")));
+ .getBytes(UTF_8)));
cl.addComponent(new TextField("This should be visible"), "first");
Button button = new Button(
"This button is visible, together with one label");
diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/WindowCloseShortcuts.java b/uitest/src/main/java/com/vaadin/tests/components/window/WindowCloseShortcuts.java
index c2b7cbf91c..43307223ad 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/window/WindowCloseShortcuts.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/window/WindowCloseShortcuts.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.tests.components.window;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collections;
@@ -145,7 +147,7 @@ public class WindowCloseShortcuts extends AbstractTestUI {
DesignContext dc = new DesignContext();
dc.setRootComponent(window);
Design.write(dc, outputStream);
- design = outputStream.toString("UTF-8");
+ design = outputStream.toString(UTF_8.name());
} catch (Exception e) {
return;
}
diff --git a/uitest/src/main/java/com/vaadin/tests/declarative/DeclarativeEditor.java b/uitest/src/main/java/com/vaadin/tests/declarative/DeclarativeEditor.java
index e0c5c899b2..cab0e68f06 100644
--- a/uitest/src/main/java/com/vaadin/tests/declarative/DeclarativeEditor.java
+++ b/uitest/src/main/java/com/vaadin/tests/declarative/DeclarativeEditor.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.tests.declarative;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -95,12 +97,11 @@ public class DeclarativeEditor extends UI {
try {
Design.write(treeHolder.getComponent(0), o);
disableEvents = true;
- editor.setValue(o.toString("UTF-8"));
+ editor.setValue(o.toString(UTF_8.name()));
disableEvents = false;
} catch (IOException e1) {
e1.printStackTrace();
}
-
}
private void addValueChangeListeners(Component component) {