Package org.codehaus.xfire.aegis.type

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


        BeanType type = (BeanType) tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = type.getTypeInfo();

        QName name = (QName) info.getElements().next();
        Type custom = info.getType(name);
        assertTrue(custom instanceof MyStringType);
    }
View Full Code Here


        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
        {
            creator.createType(MyService1.class.getDeclaredMethod("getUnmapped", new Class[]{java.util.List.class}), 0);
View Full Code Here

        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());
       
        method = MyService1.class.getDeclaredMethod("getCollection", new Class[]{Integer.TYPE});
        type = creator.createType(method, -1);
View Full Code Here

   
    public void testMapping5() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean5");

        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        Iterator elItr = info.getElements();
        assertFalse(elItr.hasNext());
View Full Code Here

    public void testType() throws Exception
    {
        Method m = CustomTypeService.class.getMethod("doFoo", new Class[] { String.class });
       
        Type type = creator.createType(m, 0);
        tm.register(type);
        assertTrue( type instanceof CustomStringType );
        assertEquals( new QName("urn:xfire:foo", "custom"), type.getSchemaType());
       
        type = creator.createType(m, -1);
        tm.register(type);
        assertTrue( type instanceof CustomStringType );
        assertEquals( new QName("urn:xfire:foo", "custom"), type.getSchemaType());
    }
View Full Code Here

    public void testRegistry() {
        JaxbTypeRegistry registry = new JaxbTypeRegistry();
       
        TypeCreator creator = registry.getTypeCreator();
       
        Type type = creator.createType(BaseUser.class);
        assertTrue(type instanceof JaxbType);
       
        type = creator.createType(Countries.class);
        assertTrue(type instanceof JaxbType);
       
        assertEquals("Countries", type.getSchemaType().getLocalPart());
        assertEquals("http://xfire.codehaus.org/enum",
                     type.getSchemaType().getNamespaceURI());
        assertTrue(type.isAbstract());
    }
View Full Code Here

   
    public void testNillableDefaultTrue() throws Exception
    {
        config.setDefaultNillable( true );

        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertTrue(info.isNillable(new QName(info.getDefaultNamespace(), "bogusProperty")));
    }
View Full Code Here

    }
   
    public void testNillableDefaultFalse() throws Exception
    {
        config.setDefaultNillable( false );
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertFalse(info.isNillable(new QName(info.getDefaultNamespace(), "bogusProperty")));
    }
View Full Code Here

    }
   
    public void testMinOccursDefault0() throws Exception
    {
        config.setDefaultMinOccurs( 0 );
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "bogusProperty")), 0);
    }
View Full Code Here

    }
   
    public void testMinOccursDefault1() throws Exception
    {
        config.setDefaultMinOccurs( 1 );
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "bogusProperty")), 1);
    }
View Full Code Here

TOP

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

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.