Package org.codehaus.xfire.aegis.type

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


   
    public void testExtensibleDefaultTrue() throws Exception
    {
        config.setDefaultExtensibleElements( true );
        config.setDefaultExtensibleAttributes( true );
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.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 );
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();
        assertFalse(info.isExtensibleElements());
        assertFalse(info.isExtensibleAttributes());
    }
View Full Code Here

        assertEquals(smallEnum.VALUE1, value);
    }

    public void testAutoCreation() throws Exception
    {
        Type type = (Type) tm.getTypeCreator().createType(smallEnum.class);
       
        assertTrue( type instanceof EnumType );
    }
View Full Code Here

        assertTrue( type instanceof EnumType );
    }
   
    public void testTypeAttributeOnEnum() throws Exception
    {
        Type type = (Type) tm.getTypeCreator().createType(TestEnum.class);
       
        assertEquals("urn:xfire:foo", type.getSchemaType().getNamespaceURI());
       
        assertTrue( type instanceof EnumType );
    }
View Full Code Here

    }
   
   
    public void testNillable() throws Exception
    {
        Type type = tm.getTypeCreator().createType(EnumBean.class);

        tm.register(type);
       
        Element root = new Element("root");
        JDOMWriter writer = new JDOMWriter(root);
       
        type.writeObject(new EnumBean(), writer, new MessageContext());

        JDOMReader reader = new JDOMReader(root);
        Object value = type.readObject(reader, new MessageContext());
       
        assertTrue(value instanceof EnumBean);
        EnumBean bean = (EnumBean) value;
        assertNull(bean.getCurrency());
    }
View Full Code Here

    public void testType() throws Exception
    {
        Method m = MapService.class.getMethod("getMap", new Class[0]);
       
        Type type = creator.createType(m, -1);
        tm.register(type);
        assertTrue( type instanceof MapType );
       
        MapType mapType = (MapType) type;
        QName keyName = mapType.getKeyName();
       
        type = mapType.getKeyType();
        assertNotNull(type);
        assertTrue(type.getTypeClass().isAssignableFrom(String.class));
       
        type = mapType.getValueType();
        assertNotNull(type);
        assertTrue(type.getTypeClass().isAssignableFrom(Integer.class));
    }
View Full Code Here

    public void testRecursiveType() throws Exception
    {
        Method m = MapService.class.getMethod("getMapOfCollections", new Class[0]);
       
        Type type = creator.createType(m, -1);
        tm.register(type);
        assertTrue( type instanceof MapType );
       
        MapType mapType = (MapType) type;
        QName keyName = mapType.getKeyName();
View Full Code Here

   
    public void testPDType() throws Exception
    {
        PropertyDescriptor pd =
            Introspector.getBeanInfo(MapDTO.class, Object.class).getPropertyDescriptors()[0];
        Type type = creator.createType(pd);
        tm.register(type);
        assertTrue( type instanceof MapType );
       
        MapType mapType = (MapType) type;
        QName keyName = mapType.getKeyName();
       
        type = mapType.getKeyType();
        assertNotNull(type);
        assertTrue(type.getTypeClass().isAssignableFrom(String.class));
       
        type = mapType.getValueType();
        assertNotNull(type);
        assertTrue(type.getTypeClass().isAssignableFrom(Integer.class));
    }
View Full Code Here

        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();
        assertTrue( type instanceof MapType );
       
        MapType mapType = (MapType) type;
       
        deps = dto.getDependencies();
        assertEquals(1, deps.size());
       
        type = mapType.getKeyType();
        assertNotNull(type);
        assertTrue(type.getTypeClass().isAssignableFrom(String.class));
       
        type = mapType.getValueType();
        assertNotNull(type);
        assertTrue(type.getTypeClass().isAssignableFrom(Integer.class));
    }
View Full Code Here

        DefaultTypeMappingRegistry registry = new DefaultTypeMappingRegistry();
        registry.createDefaultMappings();
       
        TypeMapping tm = registry.getDefaultTypeMapping();

        Type type = tm.getType(XMLGregorianCalendar.class);
        assertEquals("dateTime", type.getSchemaType().getLocalPart());
       
        MockControl readerControl = MockControl.createControl(MessageReader.class);
        MessageReader reader = (MessageReader) readerControl.getMock();
       
        reader.getValue();
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.