KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > util > typevalidator > test > TypeValidatorRegistryTest


1 /*
2  * Copyright (c) 2003-2004, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.util.typevalidator.test;
8
9
10 import junit.framework.TestCase;
11
12 import com.inversoft.util.typevalidator.EmailTypeValidator;
13 import com.inversoft.util.typevalidator.TypeValidator;
14 import com.inversoft.util.typevalidator.TypeValidatorRegistry;
15
16
17 /**
18  * <p>
19  * This class tests the TypeValidatorRegistry.
20  * </p>
21  *
22  * @author Brian Pontarelli
23  */

24 public class TypeValidatorRegistryTest extends TestCase {
25
26     public TypeValidatorRegistryTest(String JavaDoc name) {
27         super(name);
28     }
29
30
31     /**
32      * Tests that storing of new type validators works.
33      */

34     public void testStore() {
35         TypeValidator v = new EmailTypeValidator();
36         TypeValidatorRegistry.storeTypeValidator("foo", v);
37         TypeValidator v2 = TypeValidatorRegistry.lookupTypeValidator("foo");
38         assertSame(v, v2);
39     }
40 }
41
Popular Tags