Package org.codehaus.xfire.aegis.type

Examples of org.codehaus.xfire.aegis.type.CustomTypeMapping


public class CustomTypeMappingTest
    extends TestCase
{
    public void testTM() throws Exception
    {
        CustomTypeMapping mapping = new CustomTypeMapping();
       
        QName qname = new QName( "urn:soap", "String" );
       
        mapping.register( String.class, qname, new StringType() );
       
        assertTrue( mapping.isRegistered( String.class ) );
        assertTrue( mapping.isRegistered( qname ) );
       
        Type type = mapping.getType( String.class );
        assertNotNull( type );
        assertNotNull( mapping.getType( qname ) );

        CustomTypeMapping child = new CustomTypeMapping( mapping );
       
        assertTrue( child.isRegistered( String.class ) );
        assertTrue( child.isRegistered( qname ) );

        assertNotNull( child.getType( String.class ) );
       
        child.removeType(type);
        assertFalse( mapping.isRegistered( String.class ) );
        assertFalse( mapping.isRegistered( qname ) );
    }
View Full Code Here


        super.setUp();
       
        DefaultTypeMappingRegistry registry = new DefaultTypeMappingRegistry(true);
        TypeMapping defaultTM = registry.getDefaultTypeMapping();
       
        tm = new CustomTypeMapping(defaultTM);
        creator = new XMLTypeCreator();
        creator.setConfiguration(new Configuration());
        DefaultTypeCreator next = new DefaultTypeCreator();
        next.setConfiguration(new Configuration());
        creator.setNextCreator(next);
View Full Code Here

    public void testSimpleXMLMapping() throws Exception
    {
        XMLTypeCreator creator = new XMLTypeCreator();
        creator.setNextCreator(new DefaultTypeCreator());
        creator.setConfiguration(new Configuration());
        tm = new CustomTypeMapping(new DefaultTypeMappingRegistry().createDefaultMappings());
        creator.setTypeMapping(tm);
        Type type = creator.createType(MyService1.class.getDeclaredMethod("getCollection", new Class[0]), -1);
        assertTrue("type is not a collection", type instanceof CollectionType);
        assertEquals("unexpected collection type", Double.class, ((CollectionType)type).getComponentType().getTypeClass());
        try
View Full Code Here

    public void testBestMatch() throws Exception
    {
        XMLTypeCreator creator = new XMLTypeCreator();
        creator.setNextCreator(new DefaultTypeCreator());
        creator.setConfiguration(new Configuration());
        tm = new CustomTypeMapping(new DefaultTypeMappingRegistry().createDefaultMappings());
        creator.setTypeMapping(tm);
        Method method = MyService1.class.getDeclaredMethod("getCollection", new Class[0]);
        Type type = creator.createType(method, -1);
        assertTrue("type is not a collection", type instanceof CollectionType);
        assertEquals("unexpected collection return type for method " + method, Double.class, ((CollectionType)type).getComponentType().getTypeClass());
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();
       
        tm = new CustomTypeMapping();
        creator = new Java5TypeCreator();
        creator.setNextCreator(new DefaultTypeCreator());
        creator.setConfiguration(new Configuration());
        tm.setTypeCreator(creator);
    }
View Full Code Here

   
    public void setUp() throws Exception
    {
        super.setUp();
       
        tm = new CustomTypeMapping();
        Java5TypeCreator creator = new Java5TypeCreator();
        creator.setConfiguration(new Configuration());
        tm.setTypeCreator(creator);
    }
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();
       
        tm = new CustomTypeMapping();
        creator = new Java5TypeCreator();
        creator.setConfiguration(new Configuration());
        tm.setTypeCreator(creator);
    }
View Full Code Here

        assertTrue(type.getTypeClass().isAssignableFrom(Integer.class));
    }

    public void testMapDTO()
    {
        CustomTypeMapping tm = new CustomTypeMapping();
        Java5TypeCreator creator = new Java5TypeCreator();
        creator.setConfiguration(new Configuration());
        tm.setTypeCreator(creator);
       
        Type dto = creator.createType(MapDTO.class);
        Set deps = dto.getDependencies();
       
        Type type = (Type) deps.iterator().next();
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();
       
        tm = new CustomTypeMapping();
        creator = new Java5TypeCreator();
        creator.setConfiguration(new Configuration());
        tm.setTypeCreator(creator);
    }
View Full Code Here

        assertTrue(type.getTypeClass().isAssignableFrom(String.class));
    }

    public void testCollectionDTO()
    {
        CustomTypeMapping tm = new CustomTypeMapping();
        Java5TypeCreator creator = new Java5TypeCreator();
        creator.setConfiguration(new Configuration());
        tm.setTypeCreator(creator);
       
        Type dto = creator.createType(CollectionDTO.class);
        Set deps = dto.getDependencies();
       
        Type type = (Type) deps.iterator().next();
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.aegis.type.CustomTypeMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.