001/** 002 * Copyright 2005-2015 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krad.labs.kitchensink; 017 018import org.junit.Test; 019 020/** 021 * Tests the Component section in Rice. 022 * 023 * @author Kuali Rice Team (rice.collab@kuali.org) 024 */ 025public abstract class LabsValidCharsConstraintAft extends LabsKitchenSinkBase { 026 027 /** 028 * /kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&pageId=UifCompView-Page4 029 */ 030 public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&pageId=UifCompView-Page4"; 031 032 @Override 033 protected String getBookmarkUrl() { 034 return BOOKMARK_URL; 035 } 036 037 @Override 038 protected void navigate() throws Exception { 039 navigateToKitchenSink("Validation - Regex"); 040 } 041 042 @Test 043 public void testValidCharsConstraintNav() throws Exception { 044 testValidCharsConstraintIT(); 045 passed(); 046 } 047 048 @Test 049 public void testValidCharsConstraintBookmark() throws Exception { 050 testValidCharsConstraintIT(); 051 passed(); 052 } 053 054 protected void testValidCharsConstraintIT() throws Exception { 055 assertFocusTypeBlurValidation("field50", new String[]{"12.333", "-123.33"}, new String[]{"123.33"}); 056 assertFocusTypeBlurValidation("field51", new String[]{"A"}, new String[]{"-123.33"}); 057 058 // TODO continue to convert to assertFocusTypeBlurValidation 059 assertFocusTypeBlurValidation("field77", new String[]{"1.1"},new String[]{"12"}); 060 assertFocusTypeBlurValidation("field52", new String[]{"5551112222"},new String[]{"555-111-1111"}); 061 assertFocusTypeBlurValidation("field53", new String[]{"1ClassName.java"},new String[]{"ClassName.java"}); 062 assertFocusTypeBlurValidation("field54", new String[]{"aaaaa"},new String[]{"aaaaa@kuali.org"}); 063 assertFocusTypeBlurValidation("field84", new String[]{"aaaaa"},new String[]{"http://www.kuali.org"}); 064 assertFocusTypeBlurValidation("field55", new String[]{"023512"},new String[]{"022812"}); 065 assertFocusTypeBlurValidation("field75", new String[]{"02/35/12"},new String[]{"02/28/12"}); 066 assertFocusTypeBlurValidation("field82", new String[]{"13:22"},new String[]{"02:33"}); 067 assertFocusTypeBlurValidation("field83", new String[]{"25:22"},new String[]{"14:33"}); 068 assertFocusTypeBlurValidation("field56", new String[]{"2020-06-02"},new String[]{"2020-06-02 03:30:30.22"}); 069 assertFocusTypeBlurValidation("field57", new String[]{"0"},new String[]{"2020"}); 070 assertFocusTypeBlurValidation("field58", new String[]{"13"},new String[]{"12"}); 071 assertFocusTypeBlurValidation("field61", new String[]{"5555-444"},new String[]{"55555-4444"}); 072 assertFocusTypeBlurValidation("field62", new String[]{"aa5bb6_a"},new String[]{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"}); 073 assertFocusTypeBlurValidation("field63", new String[]{"#fff555"},new String[]{"aa22 _/"}); 074 assertFocusTypeBlurValidation("field64", new String[]{"AABB55"},new String[]{"ABCDEFGHIJKLMNOPQRSTUVWXY,Z abcdefghijklmnopqrstuvwxy,z"}); 075 assertFocusTypeBlurValidation("field76", new String[]{"AA~BB%"},new String[]{"abcABC %$#@&<>\\{}[]*-+!=.()/\"\"',:;?"}); 076 assertFocusTypeBlurValidation("field65", new String[]{"sdfs$#$# dsffs"},new String[]{"sdfs$#$#sffs"}); 077 assertFocusTypeBlurValidation("field66", new String[]{"abcABCD"},new String[]{"ABCabc"}); 078 assertFocusTypeBlurValidation("field67", new String[]{"(111)B-(222)A"},new String[]{"(12345)-(67890)"}); 079 assertFocusTypeBlurValidation("field68", new String[]{"A.66"},new String[]{"a.4"}); 080 } 081}