Package com.example.ipo.jaxb

Examples of com.example.ipo.jaxb.ObjectFactory


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


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

        Assert.assertNotNull(node);

    }
View Full Code Here


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


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

        Assert.assertNotNull(node);

    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    @Test
    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, null, null, null, null);
        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());
    }

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

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

    @Test
    public void testCopyNonRoot() {
        ObjectFactory factory = new ObjectFactory();
        USAddress address = factory.createUSAddress();
        address.setCity("San Jose");
        USAddress copy = (USAddress)binding.copy(address, null, null, null, null);
        assertTrue(copy instanceof USAddress);
        assertEquals("San Jose", (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

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.