Package com.example.ipo.sdo

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);
View Full Code Here


        Element element = (Element) node;
        Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespaceURI());
        Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName());
        DataObject po = new Node2DataObject().transform(node, reversedContext);
        Assert.assertTrue(po instanceof PurchaseOrderType);
        PurchaseOrderType orderType = (PurchaseOrderType)po;
        Assert.assertEquals("San Jose", orderType.getBillTo().getCity());
    }
View Full Code Here

        reversedContext = new TransformationContextImpl();
        reversedContext.setSourceDataType(getTargetDataType());
        reversedContext.setTargetDataType(getSourceDataType());
       
        PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
        USAddress address = SdoFactory.INSTANCE.createUSAddress();
        address.setCity("San Jose");
        address.setStreet("123 ABC St");
        address.setState("CA");
        address.setStreet("95131");
        po.setBillTo(address);
        dataObject = (DataObject) po;
    }
View Full Code Here

        reversedContext = new TransformationContextImpl();
        reversedContext.setSourceDataType(getTargetDataType());
        reversedContext.setTargetDataType(getSourceDataType());
       
        PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
        USAddress address = SdoFactory.INSTANCE.createUSAddress();
        address.setCity("San Jose");
        address.setStreet("123 ABC St");
        address.setState("CA");
        address.setStreet("95131");
        po.setBillTo(address);
        dataObject = (DataObject) po;
    }
View Full Code Here

    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

        reversedContext = new TransformationContextImpl();
        reversedContext.setSourceDataType(getTargetDataType());
        reversedContext.setTargetDataType(getSourceDataType());
       
        PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
        USAddress address = SdoFactory.INSTANCE.createUSAddress();
        address.setCity("San Jose");
        address.setStreet("123 ABC St");
        address.setState("CA");
        address.setStreet("95131");
        po.setBillTo(address);
        dataObject = (DataObject) po;
    }
View Full Code Here

        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

        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

        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

        reversedContext = new TransformationContextImpl();
        reversedContext.setSourceDataType(getTargetDataType());
        reversedContext.setTargetDataType(getSourceDataType());
       
        PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
        USAddress address = SdoFactory.INSTANCE.createUSAddress();
        address.setCity("San Jose");
        address.setStreet("123 ABC St");
        address.setState("CA");
        address.setStreet("95131");
        po.setBillTo(address);
        dataObject = (DataObject) po;
    }
View Full Code Here

TOP

Related Classes of com.example.ipo.sdo.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.