Package org.codehaus.xfire.aegis.type

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


    public void testMapping() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean");

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

        Iterator elItr = info.getElements();
        assertTrue(elItr.hasNext());
        QName el = (QName) elItr.next();
View Full Code Here


    public void testMapping2() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean2");

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

        Iterator elItr = info.getElements();
        assertTrue(elItr.hasNext());
        QName el = (QName) elItr.next();
View Full Code Here

   
    public void testParentWithMapping2() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean2");

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

        Iterator elItr = info.getElements();
        assertTrue(elItr.hasNext());
        QName el = (QName) elItr.next();
View Full Code Here

    public void testListHolder() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean");

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

        Iterator elItr = info.getElements();
        assertTrue(elItr.hasNext());
        QName el = (QName) elItr.next();
        assertEquals("Beans", el.getLocalPart());

        Type beanList = info.getType(el);
        assertTrue( beanList instanceof CollectionType );
    }
View Full Code Here

    public void testListHolderNoName() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean2");

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

        Iterator elItr = info.getElements();
        assertTrue(elItr.hasNext());
        QName el = (QName) elItr.next();
        assertEquals("beans", el.getLocalPart());

        Type beanList = info.getType(el);
        assertTrue( beanList instanceof CollectionType );
    }
View Full Code Here

    public void testDefaultName() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean4");

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

        Iterator attItr = info.getAttributes();
        assertTrue(attItr.hasNext());
        QName el = (QName) attItr.next();
View Full Code Here

    public void testNillable() throws Exception
    {
        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(), "prop1")));
        assertTrue(info.isNillable(new QName(info.getDefaultNamespace(), "prop2")));
    }
View Full Code Here

   
    public void testMinOccurs() throws Exception
    {
        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(), "prop1")), 1);
        assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "prop2")), 0);
    }
View Full Code Here

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

    }
   
    public void testExtensibleOff() throws Exception
    {
        tm.setEncodingStyleURI("urn:xfire:bean-extensibleoff");
        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();
        assertFalse(info.isExtensibleElements());
        assertFalse(info.isExtensibleAttributes());
    }
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.