aboutsummaryrefslogtreecommitdiffstats
path: root/shared/tests
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2014-03-21 10:18:57 +0200
committerSauli Tähkäpää <sauli@vaadin.com>2014-03-21 10:19:47 +0200
commitd90416ce1bf53b18e14b951e27f36d7323b3f3d3 (patch)
tree68dbf239394a179e69394b27794d77f8bb9c5752 /shared/tests
parent91b40555d6232a7562c50063416f58e0b544437d (diff)
parent49973354b22e8aba9cc71f83571020b0414c54e0 (diff)
downloadvaadin-framework-d90416ce1bf53b18e14b951e27f36d7323b3f3d3.tar.gz
vaadin-framework-d90416ce1bf53b18e14b951e27f36d7323b3f3d3.zip
Merge commit '49973354b22e8aba9cc71f83571020b0414c54e0'
Conflicts: shared/ivy.xml Change-Id: I2aa7cc35953fdc7441d1a5b15a7bf0a34a97db7f
Diffstat (limited to 'shared/tests')
-rw-r--r--shared/tests/src/com/vaadin/shared/util/SharedUtilTests.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/shared/tests/src/com/vaadin/shared/util/SharedUtilTests.java b/shared/tests/src/com/vaadin/shared/util/SharedUtilTests.java
new file mode 100644
index 0000000000..b593032bd6
--- /dev/null
+++ b/shared/tests/src/com/vaadin/shared/util/SharedUtilTests.java
@@ -0,0 +1,43 @@
+package com.vaadin.shared.util;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class SharedUtilTests {
+
+ private SharedUtil sut;
+
+ @Before
+ public void setup() {
+ sut = new SharedUtil();
+ }
+
+ @Test
+ public void trailingSlashIsTrimmed() {
+ assertThat(sut.trimTrailingSlashes("/path/"), is("/path"));
+ }
+
+ @Test
+ public void noTrailingSlashForTrimming() {
+ assertThat(sut.trimTrailingSlashes("/path"), is("/path"));
+ }
+
+ @Test
+ public void trailingSlashesAreTrimmed() {
+ assertThat(sut.trimTrailingSlashes("/path///"), is("/path"));
+ }
+
+ @Test
+ public void emptyStringIsHandled() {
+ assertThat(sut.trimTrailingSlashes(""), is(""));
+ }
+
+ @Test
+ public void rootSlashIsTrimmed() {
+ assertThat(sut.trimTrailingSlashes("/"), is(""));
+ }
+
+}