Package org.codehaus.xfire.aegis.type

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


        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 );
       
View Full Code Here


    public void testListofLists() throws Exception
    {
        Method m = ListService.class.getMethod("getListofListofDoubles", new Class[0]);
       
        Type type = creator.createType(m, -1);
        tm.register(type);
        assertTrue( type instanceof CollectionType );
       
        CollectionType colType = (CollectionType) type;
        assertEquals("LotsOfDoubles", colType.getSchemaType().getLocalPart());
       
        type = colType.getComponentType();
        assertTrue( type instanceof CollectionType );
        assertEquals("SomeDoubles", type.getSchemaType().getLocalPart());
       
        colType = (CollectionType) type;
        Type componentType = colType.getComponentType();
        assertTrue(componentType instanceof DoubleType);
    }
View Full Code Here

    public void testNillableDefaultTrue() throws Exception
    {
        config.setDefaultNillable( true );
        tm.setEncodingStyleURI("urn:xfire:bean-nillable");

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

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

    public void testNillableDefaultFalse() throws Exception
    {
        config.setDefaultNillable( false );
        tm.setEncodingStyleURI("urn:xfire:bean-nillable");

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

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

    public void testMinOccursDefault0() throws Exception
    {
        config.setDefaultMinOccurs( 0 );
        tm.setEncodingStyleURI("urn:xfire:bean-minoccurs");

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

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

    public void testMinOccursDefault1() throws Exception
    {
        config.setDefaultMinOccurs( 1 );
        tm.setEncodingStyleURI("urn:xfire:bean-minoccurs");

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

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

    public void testExtensibleDefaultTrue() throws Exception
    {
        config.setDefaultExtensibleElements( true );
        config.setDefaultExtensibleAttributes( true );
        tm.setEncodingStyleURI("urn:xfire:bean-extensible");
        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();
        assertTrue(info.isExtensibleElements());
        assertTrue(info.isExtensibleAttributes());
    }
View Full Code Here

    public void testExtensibleDefaultFalse() throws Exception
    {
        config.setDefaultExtensibleElements( false );
        config.setDefaultExtensibleAttributes( false );
        tm.setEncodingStyleURI("urn:xfire:bean-extensible");
        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();
        assertFalse(info.isExtensibleElements());
        assertFalse(info.isExtensibleAttributes());
    }
View Full Code Here

    }

    public void testBean()
        throws Exception
    {
        Type stringType = mapping.getTypeCreator().createType(String.class);
       
        MapType type = new MapType(new QName("urn:test", "map"), stringType, stringType);
        type.setTypeClass(Map.class);
        type.setTypeMapping(mapping);
       
        assertNotNull(type.getSchemaType());
        assertEquals("entry", type.getEntryName().getLocalPart());
        assertEquals("urn:test", type.getEntryName().getNamespaceURI());
        assertEquals("key", type.getKeyName().getLocalPart());
        assertEquals("urn:test", type.getKeyName().getNamespaceURI());
        assertEquals("value", type.getValueName().getLocalPart());
        assertEquals("urn:test", type.getValueName().getNamespaceURI());

        assertTrue(type.isComplex());
       
        Set deps = type.getDependencies();
        assertEquals(1, deps.size());
        Type stype = (Type) deps.iterator().next();
        assertTrue(stype instanceof StringType);
       
        // Test reading
        ElementReader reader = new ElementReader(getResourceAsStream("/org/codehaus/xfire/aegis/type/collection/Map.xml"));
        //MessageReader creader = reader.getNextElementReader();
View Full Code Here

        BeanType beanType = (BeanType) creator.createType(MapBean.class);
       
        QName mapName = (QName) beanType.getTypeInfo().getElements().next();
       
        Type type = beanType.getTypeInfo().getType(mapName);
        assertTrue(type instanceof MapType);

        assertEquals(new QName(mapping.getEncodingStyleURI(), "string2SimpleBeanMap"), type.getSchemaType());
       
        MapType mapType = (MapType) type;
        assertEquals(SimpleBean.class, mapType.getValueType().getTypeClass());
        assertEquals(String.class, mapType.getKeyType().getTypeClass());
    }
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.