Package com.example.ipo.jaxb

Examples of com.example.ipo.jaxb.PurchaseOrderType


        // 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


        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));
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

    @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);
        assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getName());
    }
View Full Code Here

    }

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

        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

    }

    @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, null, null);
        assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getName());
    }
View Full Code Here

    }

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

        expect(tContext1.getSourceOperation()).andReturn(null).anyTimes();
        expect(tContext1.getTargetOperation()).andReturn(null).anyTimes();
        replay(tContext1);

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

        Assert.assertNotNull(node);

    }
View Full Code Here

        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.PurchaseOrderType

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.