Examples of PurchaseOrderType


Examples of com.example.ipo.jaxb.PurchaseOrderType

        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

Examples of com.example.ipo.jaxb.PurchaseOrderType

    @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

Examples of com.example.ipo.jaxb.PurchaseOrderType

    }

    @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

Examples of com.example.ipo.jaxb.PurchaseOrderType

        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

Examples of com.example.ipo.jaxb.PurchaseOrderType

        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

Examples of com.example.ipo.jaxb.PurchaseOrderType

        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

Examples of com.example.ipo.sdo.PurchaseOrderType

    public final void testTransform() {
        String xml = new DataObject2String().transform(dataObject, context);
        Assert.assertTrue(xml.indexOf("<city>San Jose</city>") != -1);
        DataObject po = new String2DataObject().transform(xml, reversedContext);
        Assert.assertTrue(po instanceof PurchaseOrderType);
        PurchaseOrderType orderType = (PurchaseOrderType)po;
        Assert.assertEquals("San Jose", orderType.getBillTo().getCity());
    }
View Full Code Here

Examples of com.example.ipo.sdo.PurchaseOrderType

        assertEquals(new QName("http://www.example.com/IPO", "USAddress"), ((XMLType)dataType.getLogical())
            .getTypeName());
    }

    public final void testCopyRoot() {
        PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
        po.setComment("Comment");
        Object copy = binding.copy(po, null, null, null, null);
        assertTrue(copy instanceof PurchaseOrderType);
        assertTrue(po != copy);
        assertTrue(context.getEqualityHelper().equal((DataObject)po, (DataObject)copy));
        assertEquals("Comment", ((PurchaseOrderType)copy).getComment());
View Full Code Here

Examples of com.example.ipo.sdo.PurchaseOrderType

        assertTrue(context.getEqualityHelper().equal((DataObject)address, (DataObject)copy));
        assertEquals("San Jose", ((USAddress)copy).getCity());
    }

    public final void testCopyXMLDocument() {
        PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
        po.setComment("Comment");
        XMLDocument doc =
            context.getXMLHelper().createDocument((DataObject)po,
                                                  ORDER_QNAME.getNamespaceURI(),
                                                  ORDER_QNAME.getLocalPart());
        Object copy = binding.copy(doc, null, null, null, null);
View Full Code Here

Examples of com.example.ipo.sdo.PurchaseOrderType

        Element element = (Element) node;
        Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespaceURI());
        Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName());
        DataObject po = new Node2DataObject(new DefaultExtensionPointRegistry()).transform(node, reversedContext);
        Assert.assertTrue(po instanceof PurchaseOrderType);
        PurchaseOrderType orderType = (PurchaseOrderType)po;
        Assert.assertEquals("San Jose", orderType.getBillTo().getCity());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.