[Title] Added unit test for checkForDynamicBoxId
authorchanghyun1.lee <changhyun1.lee@samsung.com>
Thu, 4 Jul 2013 02:50:34 +0000 (11:50 +0900)
committerchanghyun1.lee <changhyun1.lee@samsung.com>
Thu, 4 Jul 2013 02:50:34 +0000 (11:50 +0900)
[Desc.]
[Issue] N_SE-44530

Change-Id: I127cebc7b0f5c47c554b20eb1e421da41fdc42ee

org.tizen.common/test/src/org/tizen/common/util/ValidationUtilTest.java

index ed4377d..2ab3b7c 100755 (executable)
@@ -188,10 +188,30 @@ public class ValidationUtilTest {
             assertTrue(ValidationUtil.checkForVersion(version));
         }
 
-        final String[] invalidedVersions = {"", "0.0.0", "36.1.1", "0.36.1", "111.111.111", "1.0", ".1", "0.1"};
+        final String[] invalidedVersions = {"", "0.0.0", "111.111.111111" };
         for (String version : invalidedVersions) {
             assertFalse(ValidationUtil.checkForVersion(version));
         }
     }
 
+    /**
+     * Test {@link ValidationUtil#checkForDynamicBoxId(String value)}
+     *
+     * @throws Exception in case of failure in test
+     *
+     * @see {@link ValidationUtil#checkForDynamicBoxId(String value)}
+     */
+    @Test
+    public void test_checkForDynamicBoxId() throws Exception {
+        final String[] validedIDS = { "1wfV7ZwO6r.test.test", "1wfV7ZwO6r.test.111", "1wfV7ZwO6r.test.test2222" };
+        for ( String id : validedIDS ) {
+            assertTrue( ValidationUtil.checkForDynamicBoxId( id ) );
+        }
+
+        final String[] invalidedIDS = { "", "1wfV7ZwO6r.test.-1", "1wfV7ZwO6r.test.!test", "1wfV7ZwO6r.test.test test", "1wfV7ZwO6r.test.test!#", "1wfV7ZwO6r." };
+        for ( String id : invalidedIDS ) {
+            assertFalse( ValidationUtil.checkForDynamicBoxId( id ) );
+        }
+    }
+
 }