1 package org.codehaus.xfire.type;
2
3 import javax.xml.namespace.QName;
4
5 import junit.framework.TestCase;
6
7 import org.codehaus.xfire.type.CustomTypeMapping;
8 import org.codehaus.xfire.type.basic.StringType;
9
10
11 /***
12 * CustomTypeMappingTest
13 *
14 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
15 */
16 public class CustomTypeMappingTest
17 extends TestCase
18 {
19 public void testTM() throws Exception
20 {
21 CustomTypeMapping mapping = new CustomTypeMapping();
22
23 QName qname = new QName( "urn:soap", "String" );
24
25 mapping.register( String.class, qname, new StringType() );
26
27 assertTrue( mapping.isRegistered( String.class, qname ) );
28
29 assertNotNull( mapping.getType( String.class, qname ) );
30
31
32 CustomTypeMapping child = new CustomTypeMapping( mapping );
33
34 assertTrue( child.isRegistered( String.class, qname ) );
35
36 assertNotNull( child.getType( String.class, qname ) );
37 }
38 }