Source Code Cross Referenced for FixedPointValidationPatternTest.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » core » datadictionary » validation » fieldlevel » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » org.kuali.core.datadictionary.validation.fieldlevel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006 The Kuali Foundation.
003:         * 
004:         * Licensed under the Educational Community License, Version 1.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/ecl1.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:         */
016:        package org.kuali.core.datadictionary.validation.fieldlevel;
017:
018:        import org.junit.Test;
019:        import org.kuali.test.KNSTestBase;
020:
021:        public class FixedPointValidationPatternTest extends KNSTestBase {
022:            // Unlike its superclass, FixedPointValidationPattern does not use Spring.
023:            FixedPointValidationPattern pattern;
024:
025:            @Override
026:            @Test
027:            public final void setUp() throws Exception {
028:                super .setUp();
029:
030:                pattern = new FixedPointValidationPattern();
031:                pattern.setPrecision(2);
032:                pattern.setScale(1);
033:            }
034:
035:            @Test
036:            public final void testDefaultAllows_empty() {
037:                assertFalse(pattern.matches(""));
038:            }
039:
040:            @Test
041:            public final void testDefaultAllows_positive1() {
042:                assertTrue(pattern.matches(".1"));
043:            }
044:
045:            @Test
046:            public final void testDefaultAllows_positive2() {
047:                assertTrue(pattern.matches("0.1"));
048:            }
049:
050:            @Test
051:            public final void testDefaultAllows_positive3() {
052:                assertTrue(pattern.matches("1.1"));
053:            }
054:
055:            @Test
056:            public final void testDefaultAllows_positive4() {
057:                assertTrue(pattern.matches("1"));
058:            }
059:
060:            @Test
061:            public final void testDefaultAllows_positive5() {
062:                assertTrue(pattern.matches("1.0"));
063:            }
064:
065:            @Test
066:            public final void testDefaultAllows_negative1() {
067:                assertFalse(pattern.matches("-.1"));
068:            }
069:
070:            @Test
071:            public final void testDefaultAllows_negative2() {
072:                assertFalse(pattern.matches("-0.1"));
073:            }
074:
075:            @Test
076:            public final void testDefaultAllows_negative3() {
077:                assertFalse(pattern.matches("-1.1"));
078:            }
079:
080:            @Test
081:            public final void testDefaultAllows_negative4() {
082:                assertFalse(pattern.matches("-1"));
083:            }
084:
085:            @Test
086:            public final void testDefaultAllows_negative5() {
087:                assertFalse(pattern.matches("-1.0"));
088:            }
089:
090:            @Test
091:            public final void testDefaultAllows_invalid1() {
092:                assertFalse(pattern.matches("-."));
093:            }
094:
095:            @Test
096:            public final void testDefaultAllows_invalid2() {
097:                assertFalse(pattern.matches("1."));
098:            }
099:
100:            @Test
101:            public final void testDefaultAllows_invalid3() {
102:                assertFalse(pattern.matches("-1."));
103:            }
104:
105:            @Test
106:            public final void testDefaultAllows_invalid4() {
107:                assertFalse(pattern.matches("12."));
108:            }
109:
110:            @Test
111:            public final void testDefaultAllows_invalid5() {
112:                assertFalse(pattern.matches("1245678901234567890123.23"));
113:            }
114:
115:            @Test
116:            public final void testDefaultAllows_invalid6() {
117:                assertFalse(pattern.matches("123"));
118:            }
119:
120:            @Test
121:            public final void testAllowNegative_positive1() {
122:                assertTrue(pattern.matches(".1"));
123:            }
124:
125:            @Test
126:            public final void testAllowNegative_positive2() {
127:                pattern.setAllowNegative(true);
128:
129:                assertTrue(pattern.matches("0.1"));
130:            }
131:
132:            @Test
133:            public final void testAllowNegative_positive3() {
134:                pattern.setAllowNegative(true);
135:
136:                assertTrue(pattern.matches("1.1"));
137:            }
138:
139:            @Test
140:            public final void testAllowNegative_positive4() {
141:                pattern.setAllowNegative(true);
142:
143:                assertTrue(pattern.matches("1"));
144:            }
145:
146:            @Test
147:            public final void testAllowNegative_positive5() {
148:                pattern.setAllowNegative(true);
149:
150:                assertTrue(pattern.matches("1.0"));
151:            }
152:
153:            @Test
154:            public final void testAllowNegative_negative1() {
155:                pattern.setAllowNegative(true);
156:
157:                assertTrue(pattern.matches("-.1"));
158:            }
159:
160:            @Test
161:            public final void testAllowNegative_negative2() {
162:                pattern.setAllowNegative(true);
163:
164:                assertTrue(pattern.matches("-0.1"));
165:            }
166:
167:            @Test
168:            public final void testAllowNegative_negative3() {
169:                pattern.setAllowNegative(true);
170:
171:                assertTrue(pattern.matches("-1.1"));
172:            }
173:
174:            @Test
175:            public final void testAllowNegative_negative4() {
176:                pattern.setAllowNegative(true);
177:
178:                assertTrue(pattern.matches("-1"));
179:            }
180:
181:            @Test
182:            public final void testAllowNegative_negative5() {
183:                pattern.setAllowNegative(true);
184:
185:                assertTrue(pattern.matches("-1.0"));
186:            }
187:
188:            @Test
189:            public final void testAllowNegative_invalid1() {
190:                pattern.setAllowNegative(true);
191:
192:                assertFalse(pattern.matches("-."));
193:            }
194:
195:            @Test
196:            public final void testAllowNegative_invalid2() {
197:                pattern.setAllowNegative(true);
198:
199:                assertFalse(pattern.matches("1."));
200:            }
201:
202:            @Test
203:            public final void testAllowNegative_invalid3() {
204:                pattern.setAllowNegative(true);
205:
206:                assertFalse(pattern.matches("-1."));
207:            }
208:
209:            @Test
210:            public final void testAllowNegative_invalid4() {
211:                pattern.setAllowNegative(true);
212:
213:                assertFalse(pattern.matches("-12."));
214:            }
215:
216:            @Test
217:            public final void testAllowNegative_invalid5() {
218:                pattern.setAllowNegative(true);
219:
220:                assertFalse(pattern.matches("-1.23"));
221:            }
222:
223:            @Test
224:            public final void testAllowNegative_invalid6() {
225:                pattern.setAllowNegative(true);
226:
227:                assertFalse(pattern.matches("123."));
228:            }
229:
230:            @Test
231:            public final void testAllowNegative_invalid7() {
232:                pattern.setAllowNegative(true);
233:
234:                assertFalse(pattern.matches(".123"));
235:            }
236:
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.