Examples of define()


Examples of commonj.sdo.helper.TypeHelper.define()

    // Define a global property - price
    DataObject priceProperty = globalType.createDataObject("property");
    priceProperty.set("name", "price");
    priceProperty.set("type", decimalType);
   
    types.define(globalType);
   
    // Create DataObject instances
    DataObject openQuote = factory.create("http://www.example.com/open", "OpenQuote");
   
    assertTrue(openQuote.getType().isOpen());
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

        HelperContext context = SDOUtil.createHelperContext();
        URL url = getClass().getResource("/ipo.xsd");
        Assert.assertNotNull(url);
        InputStream is = url.openStream();
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(is, url.toExternalForm());
        TypeHelper typeHelper = context.getTypeHelper();
        Type type = typeHelper.getType("http://www.example.com/IPO", "PurchaseOrderType");
        Assert.assertNotNull(type);
        /*
        SDOContextHelper.generateSchema(context, Arrays.asList(type));
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

                    URLConnection connection = new URL(wsdlURL).openConnection();
                    connection.setUseCaches(false);
                    InputStream xsdInputStream = connection.getInputStream();
                    try {
                        XSDHelper xsdHelper = importSDO.getHelperContext().getXSDHelper();
                        xsdHelper.define(xsdInputStream, wsdlURL);
                    } finally {
                        xsdInputStream.close();
                    }
                    importSDO.setUnresolved(false);
                } else {
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

        assertEquals(5, children.size());
    }

    public void testWrapper() throws Exception {
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        Operation op = new OperationImpl();
        List children = handler.getChildren(document, op, true);
        assertEquals(5, children.size());
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

    }
   
    public void testCreate() {
        HelperContext context = HelperProvider.getDefaultContext();
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        ElementInfo element = new ElementInfo(new QName("http://www.example.com/wrapper", "op"), null);
        Operation op = new OperationImpl();
        WrapperInfo wrapperInfo = new WrapperInfo(SDODataBinding.NAME, element, null, null, null);
        op.setWrapper(wrapperInfo);
        DataObject wrapper = (DataObject) handler.create(op, true);
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

      for (Iterator iter = getXsdMetaData().iterator(); iter.hasNext();)
      {
        XSDMetaData metadata = (XSDMetaData)iter.next();
        URL url = getClass().getResource(metadata.getLocation());
        InputStream inputStream = url.openStream();
        xsdHelper.define(inputStream, url.toString());
      }

      XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
      for (Iterator iter = getTypeMetaData().iterator(); iter.hasNext();)
      {
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

            // Load the WSDL file
            File inputFile = new File(wsdlFileName).getAbsoluteFile();
            InputStream inputStream = new FileInputStream(inputFile);
           
            // Define SDO metadata
            xsdHelper.define(inputStream, inputFile.toURI().toString());

            if (targetDirectory == null) {
                targetDirectory = new File(wsdlFileName).getCanonicalFile().getParent();
            } else {
                targetDirectory = new File(targetDirectory).getCanonicalPath();
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

    private static final String TEST_MODEL = "/simple.xsd";
    private URL modelURL;

    public void testDefineWithLocation() throws IOException {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper());
        List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
        assertEquals(2, types.size());
    }

    public void testDefineWithNoLocation() {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper());
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

        assertEquals(2, types.size());
    }

    public void testDefineWithNoLocation() {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper());
        List types = xsdHelper.define(getClass().getResourceAsStream(TEST_MODEL), null);
        assertEquals(2, types.size());
    }

    public void testDuplicateDefineWithLocation() throws IOException {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper());
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper.define()

        assertEquals(2, types.size());
    }

    public void testDuplicateDefineWithLocation() throws IOException {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper());
        List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
        assertEquals(2, types.size());

        List types2 = xsdHelper.define(modelURL.openStream(), modelURL.toString());
        assertEquals(0, types2.size());
    }
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.