diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-20 10:10:02 +0200 |
---|---|---|
committer | Péter Török <31210544+torok-peter@users.noreply.github.com> | 2017-10-20 11:10:02 +0300 |
commit | a9c83ba07e4dec90eb7d6e332b91adde9613ebb4 (patch) | |
tree | 7907a6c389ae740572197d949e27c6fd3c25491c /server/src/test | |
parent | 0a26d0e44169f9643e7d30ba370b8ecbbe128a56 (diff) | |
download | vaadin-framework-a9c83ba07e4dec90eb7d6e332b91adde9613ebb4.tar.gz vaadin-framework-a9c83ba07e4dec90eb7d6e332b91adde9613ebb4.zip |
Use .toLowerCase and .toUpperCase(Locale.ROOT) (#10182)
* Use .toLowerCase and .toUpperCase(Locale.ROOT)
* Spaces
* add spaces after if(
Diffstat (limited to 'server/src/test')
11 files changed, 15 insertions, 13 deletions
diff --git a/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java b/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java index 31c48447a6..cde97441aa 100644 --- a/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java +++ b/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java @@ -79,7 +79,7 @@ public class BinderCustomPropertySetTest { @Override public String getCaption() { - return name.toUpperCase(Locale.ENGLISH); + return name.toUpperCase(Locale.ROOT); } } diff --git a/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java b/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java index 6b3d85900d..00961487d3 100644 --- a/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java +++ b/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java @@ -69,7 +69,7 @@ public class GridValueProvider { upperCasePerson); persons.addFilter(col.getValueProvider(), - value -> value.toUpperCase(Locale.ENGLISH).equals(value)); + value -> value.toUpperCase(Locale.ROOT).equals(value)); List<Person> queryPersons = persons.fetch(new Query<>()) .collect(Collectors.toList()); diff --git a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java index 9f6253067a..de346dd0aa 100644 --- a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java +++ b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java @@ -25,6 +25,7 @@ import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashSet; +import java.util.Locale; import java.util.TimeZone; import org.junit.Before; @@ -290,9 +291,9 @@ public class DesignFormatterTest { formatter.format(new ThemeResource(themePath))); assertEquals(fontAwesomeUrl, formatter.format(FontAwesome.AMBULANCE)); - assertEquals(someOtherFontUrl.toLowerCase(), + assertEquals(someOtherFontUrl.toLowerCase(Locale.ROOT), formatter.format(new GenericFontIcon("SomeOther", 0xf0f9)) - .toLowerCase()); + .toLowerCase(Locale.ROOT)); assertEquals(fileSystemPath, formatter.format(new FileResource(new File(fileSystemPath)))); diff --git a/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java b/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java index 738f0be806..bd0dbbc6e0 100644 --- a/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java +++ b/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java @@ -69,7 +69,7 @@ public class ClasspathHelper { .map(path -> getClassFromFile(path, classesRoot.toPath())) .filter(Objects::nonNull).collect(Collectors.toList()); - } else if (classesRoot.getName().toLowerCase(Locale.ENGLISH) + } else if (classesRoot.getName().toLowerCase(Locale.ROOT) .endsWith(".jar")) { URI uri = URI.create("jar:" + classesRoot.toURI()); FileSystem fileSystem; diff --git a/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java b/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java index 8a31b8cf98..ba2c424a09 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java +++ b/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java @@ -7,6 +7,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Collection; import java.util.HashSet; +import java.util.Locale; import java.util.Set; import org.easymock.EasyMock; @@ -43,7 +44,7 @@ public abstract class AbstractListenerMethodsTestBase { String packageName = "com.vaadin.tests.server"; if (Component.class.isAssignableFrom(c)) { packageName += ".component." - + c.getSimpleName().toLowerCase(); + + c.getSimpleName().toLowerCase(Locale.ROOT); continue; } diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java index 80040804cd..6f18a424b8 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java @@ -69,7 +69,7 @@ public abstract class AbstractLocalDateFieldDeclarativeTest<T extends AbstractLo + "date-out-of-range-message='%s' resolution='%s' " + "date-format='%s' lenient parse-error-message='%s'/>", getComponentTag(), end, start, dateOutOfRange, - resolution.name().toLowerCase(Locale.ENGLISH), dateFormat, + resolution.name().toLowerCase(Locale.ROOT), dateFormat, parseErrorMsg); T component = getComponentClass().newInstance(); diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java index a4768c6f24..61fff27072 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java @@ -74,7 +74,7 @@ public abstract class AbstractLocalDateTimeFieldDeclarativeTest<T extends Abstra + "date-format='%s' lenient parse-error-message='%s'/>", getComponentTag(), DATE_FORMATTER.format(end), DATE_FORMATTER.format(start), dateOutOfRange, - resolution.name().toLowerCase(Locale.ENGLISH), dateFormat, + resolution.name().toLowerCase(Locale.ROOT), dateFormat, parseErrorMsg); T component = getComponentClass().newInstance(); diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java index 7ba3e6aaca..2416620afe 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java @@ -43,7 +43,7 @@ public abstract class AbstractTextFieldDeclarativeTest<T extends AbstractTextFie "<%s maxlength='%d' placeholder='%s' " + "value-change-mode='%s' value-change-timeout='%d'/>", getComponentTag(), maxLength, placeholder, - mode.name().toLowerCase(Locale.ENGLISH), timeout); + mode.name().toLowerCase(Locale.ROOT), timeout); T component = getComponentClass().newInstance(); diff --git a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java index 8ebc620328..a9b23d7af0 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java @@ -74,7 +74,7 @@ public class CustomLayoutTest { field = list.get(0); } else { for (Field fld : list) { - if (fld.getName().toLowerCase(Locale.ENGLISH) + if (fld.getName().toLowerCase(Locale.ROOT) .startsWith("buffer")) { field = fld; break; diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java index 8d1d6c6955..a4f824d6fa 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java @@ -82,9 +82,9 @@ public class GridDeclarativeTest extends AbstractListingDeclarativeTest<Grid> { + "<th plain-text column-ids='id'>Id</th></tr>" + "</thead></table></%s>", getComponentTag(), - heightMode.toString().toLowerCase(Locale.ENGLISH), + heightMode.toString().toLowerCase(Locale.ROOT), frozenColumns, heightByRows, - SelectionMode.MULTI.toString().toLowerCase(Locale.ENGLISH), + SelectionMode.MULTI.toString().toLowerCase(Locale.ROOT), getComponentTag()); testRead(design, grid); diff --git a/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java index e7cab55f94..6cac635c6a 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java @@ -61,7 +61,7 @@ public class RichTextAreaDeclarativeTest int timeout = 67; String design = String.format( "<%s value-change-mode='%s' value-change-timeout='%d'/>", - getComponentTag(), mode.name().toLowerCase(Locale.ENGLISH), + getComponentTag(), mode.name().toLowerCase(Locale.ROOT), timeout); RichTextArea component = new RichTextArea(); |