Package com.example.ipo.jaxb

Examples of com.example.ipo.jaxb.ObjectFactory


    }

    @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

        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

        // 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, null, null);
        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", (copy).getComment());
    }
View Full Code Here

        assertEquals("Comment", (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", (copy).getCity());
View Full Code Here

        TransformationContext tContext1 = createMock(TransformationContext.class);
        expect(tContext1.getSourceDataType()).andReturn(sourceDataType).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

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.