diff options
author | Artur Signell <artur@vaadin.com> | 2016-10-12 22:44:00 +0300 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2016-12-09 09:39:00 +0200 |
commit | a48e26b9b897a721527d5731a44a587294cdb4ea (patch) | |
tree | cced106ec6ece884b878a1bd496071e1f22104d3 /shared/src/test/java/com/vaadin | |
parent | 4ea2151053469f1092afaeab29587353c001e887 (diff) | |
download | vaadin-framework-a48e26b9b897a721527d5731a44a587294cdb4ea.tar.gz vaadin-framework-a48e26b9b897a721527d5731a44a587294cdb4ea.zip |
Make UPPER_CASE_PROPERTY_IDS more human friendly by default (#20380)
Change-Id: I9bd845a08fa3c440f05d102ccf8920dfc1c95b6b
Diffstat (limited to 'shared/src/test/java/com/vaadin')
-rw-r--r-- | shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java b/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java index 6d8cab4fea..791637e1b1 100644 --- a/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java +++ b/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java @@ -150,4 +150,32 @@ public class SharedUtilTest { SharedUtil.getDuplicates(new Object[] { 1.2, "a", 1.2 })); } + @Test + public void propertyIdToHumanFriendly() { + Assert.assertEquals("", SharedUtil.propertyIdToHumanFriendly("")); + Assert.assertEquals("First Name", + SharedUtil.propertyIdToHumanFriendly("firstName")); + Assert.assertEquals("First Name", + SharedUtil.propertyIdToHumanFriendly("FirstName")); + Assert.assertEquals("First Name", + SharedUtil.propertyIdToHumanFriendly("FIRST_NAME")); + Assert.assertEquals("Firstname", + SharedUtil.propertyIdToHumanFriendly("FIRSTNAME")); + + Assert.assertEquals("2015 Q3", + SharedUtil.propertyIdToHumanFriendly("2015_Q3")); + Assert.assertEquals("Column X", + SharedUtil.propertyIdToHumanFriendly("_COLUMN_X")); + Assert.assertEquals("Column X", + SharedUtil.propertyIdToHumanFriendly("__COLUMN_X")); + Assert.assertEquals("1column Foobar", + SharedUtil.propertyIdToHumanFriendly("1COLUMN_FOOBAR")); + Assert.assertEquals("Result 2015", + SharedUtil.propertyIdToHumanFriendly("RESULT_2015")); + Assert.assertEquals("2015result", + SharedUtil.propertyIdToHumanFriendly("2015RESULT")); + Assert.assertEquals("Result2015", + SharedUtil.propertyIdToHumanFriendly("RESULT2015")); + + } } |