Package com.example.ipo.jaxb

Examples of com.example.ipo.jaxb.ObjectFactory


        Assert.assertEquals(new QName("http://www.example.com/IPO", "PurchaseOrderType"), type.getTypeName());
        type = (RuntimeClassInfo)model.getTypeInfo(USAddress.class);
        Assert.assertEquals(new QName("http://www.example.com/IPO", "USAddress"), type.getTypeName());
        RuntimePropertyInfo prop = type.getProperty("state");
        Assert.assertNotNull(prop);
        USAddress address = new ObjectFactory().createUSAddress();
        prop.getAccessor().set(address, USState.CA);
        Assert.assertEquals(USState.CA, address.getState());
    }
View Full Code Here


        // ElementInfo element = new ElementInfo(ELEMENT, null);
        // JAXBElement<?> jaxbElement = handler.create(element, null);
    }

    public void testSetChild() {
        ObjectFactory factory = new ObjectFactory();
        PurchaseOrderType po = factory.createPurchaseOrderType();
        JAXBElement<PurchaseOrderType> wrapper = factory.createPurchaseOrder(po);
        handler.setChild(wrapper, 2, null, "Comment");
    }
View Full Code Here

        JAXBElement<PurchaseOrderType> wrapper = factory.createPurchaseOrder(po);
        handler.setChild(wrapper, 2, null, "Comment");
    }

    public void testGetChildren() {
        ObjectFactory factory = new ObjectFactory();
        PurchaseOrderType po = factory.createPurchaseOrderType();
        po.setComment("Comment");
        JAXBElement<PurchaseOrderType> wrapper = factory.createPurchaseOrder(po);
        List children = handler.getChildren(wrapper);
        assertNotNull(children);
        assertEquals(4, children.size());
        assertEquals("Comment", children.get(2));
        assertNull(children.get(0));
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public void testCopy() {
        ObjectFactory factory = new ObjectFactory();
        PurchaseOrderType poType = factory.createPurchaseOrderType();
        JAXBElement<PurchaseOrderType> po = factory.createPurchaseOrder(poType);
        JAXBElement<PurchaseOrderType> copy = (JAXBElement<PurchaseOrderType>)binding.copy(po);
        assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getName());
    }
View Full Code Here

        assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getName());
    }

    @SuppressWarnings("unchecked")
    public void testCopyNonElement() {
        ObjectFactory factory = new ObjectFactory();
        PurchaseOrderType poType = factory.createPurchaseOrderType();
        poType.setComment("Comment");
        PurchaseOrderType copy = (PurchaseOrderType)binding.copy(poType);
        assertTrue(copy instanceof PurchaseOrderType);
        assertEquals("Comment", ((PurchaseOrderType)copy).getComment());
    }
View Full Code Here

        assertEquals("Comment", ((PurchaseOrderType)copy).getComment());
    }

    @SuppressWarnings("unchecked")
    public void testCopyNonRoot() {
        ObjectFactory factory = new ObjectFactory();
        USAddress address = factory.createUSAddress();
        address.setCity("San Jose");
        USAddress copy = (USAddress)binding.copy(address);
        assertTrue(copy instanceof USAddress);
        assertEquals("San Jose", ((USAddress)copy).getCity());
View Full Code Here

        om.serializeAndConsume(sw);
        System.out.println(sw.toString());
    }

    private JAXBElement<PurchaseOrderType> createPO() {
        ObjectFactory factory = new ObjectFactory();
        PurchaseOrderType type = factory.createPurchaseOrderType();
        JAXBElement<PurchaseOrderType> po = factory.createPurchaseOrder(type);
        type.setItems(factory.createItems());
        type.setComment("123");
        USAddress address = factory.createUSAddress();
        address.setCity("San Jose");
        address.setStreet("ABC St.");
        address.setState(USState.CA);
        type.setShipTo(address);
        return po;
View Full Code Here

        // ElementInfo element = new ElementInfo(ELEMENT, null);
        // JAXBElement<?> jaxbElement = handler.create(element, null);
    }

    public void testSetChild() {
        ObjectFactory factory = new ObjectFactory();
        PurchaseOrderType po = factory.createPurchaseOrderType();
        JAXBElement<PurchaseOrderType> wrapper = factory.createPurchaseOrder(po);
        handler.setChild(wrapper, 2, null, "Comment");
    }
View Full Code Here

        JAXBElement<PurchaseOrderType> wrapper = factory.createPurchaseOrder(po);
        handler.setChild(wrapper, 2, null, "Comment");
    }

    public void testGetChildren() {
        ObjectFactory factory = new ObjectFactory();
        PurchaseOrderType po = factory.createPurchaseOrderType();
        po.setComment("Comment");
        JAXBElement<PurchaseOrderType> wrapper = factory.createPurchaseOrder(po);
        List children = handler.getChildren(wrapper);
        assertNotNull(children);
        assertEquals(4, children.size());
        assertEquals("Comment", children.get(2));
        assertNull(children.get(0));
View Full Code Here

        TransformationContext tContext1 = new TransformationContextImpl();
        tContext1.setSourceDataType(sourceDataType);


        JAXB2Node t1 = new JAXB2Node();
        PurchaseOrderType po = new ObjectFactory().createPurchaseOrderType();
        Node node = t1.transform(po, tContext1);

        Assert.assertNotNull(node);

    }
View Full Code Here

TOP

Related Classes of com.example.ipo.jaxb.ObjectFactory

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.