Package commonj.sdo

Examples of commonj.sdo.DataGraph


     * createRootObject(uri_string, typeName_string) test with bad parms.
     */
    public void testCreateRootObjectUriTypenameBad2() throws IOException {
        // Create an empty data graph and pass bad parms to createRootObject
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        boolean success = false;
        try {
            dataGraph.createRootObject("http://www.example.com/simple", "Mangled");           
        } catch(NullPointerException npe) {
            fail("createRootObject with mangled type name threw NullPointerException");
        } catch(Exception e) {
            success = true;
        }
View Full Code Here


     * getType(uri_string, typeName_string) test with good parms.
     */
    public void testGetType() throws IOException {
        // Create an empty data graph and get a type, a Quote type
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        Type quoteType = dataGraph.getType("http://www.example.com/simple", "Quote");

        assertNotNull(quoteType);
    }
View Full Code Here

     * getType(uri_string, typeName_string) test with bad URI parm.
     */
    public void testGetTypeBad1() throws IOException {
        // Create an empty data graph and pass bad parms to getType
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        Type quoteType = null;
        try {
            quoteType = dataGraph.getType("http://www.example.com/mangled", "Quote");           
        } catch(Exception e) {
            fail("getType with mangled URI threw an exception: "+e.getMessage());
        }
        assertNull(quoteType);
    }
View Full Code Here

     * getType(uri_string, typeName_string) test with bad type name parm.
     */
    public void testGetTypeBad2() throws IOException {
        // Create an empty data graph and pass bad parms to getType
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        Type quoteType = null;
        try {
            quoteType = dataGraph.getType("http://www.example.com/simple", "Mangled");
        } catch(Exception e) {
            fail("getType with mangled type name threw an exception: "+e.getMessage());
        }
        assertNull(quoteType);
    }
View Full Code Here

     * getType(uri_string, typeName_string) test with null URI parm.
     */
    public void testGetTypeBad3() throws IOException {
        // Create an empty data graph and pass bad parms to getType
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        Type quoteType = null;
        try {
            quoteType = dataGraph.getType(null, "Quote");           
        } catch(Exception e) {
            fail("getType with null URI threw an exception: "+e.getMessage());
        }
        assertNull(quoteType);
    }
View Full Code Here

     * getType(uri_string, typeName_string) test with null type name parm.
     */
    public void testGetTypeBad4() throws IOException {
        // Create an empty data graph and pass bad parms to getType
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        Type quoteType = null;
        try {
            quoteType = dataGraph.getType("http://www.example.com/simple", null);
        } catch(Exception e) {
            fail("getType with null type name threw an exception: "+e.getMessage());
        }
        assertNull(quoteType);
    }
View Full Code Here

    public DataGraph loadDataGraph(InputStream inputStream, Map options, HelperContext scope) throws IOException {
        if (scope == null) {
            scope = HelperProvider.getDefaultContext();
        }
        TypeHelper th = scope.getTypeHelper();
        DataGraph result = null;
    if (th == null || th == TypeHelper.INSTANCE) {
        result = loadDataGraph(inputStream, options);
    } else if (options == null) {
        options = new HashMap();
        registerLoadingScope(options, th);
View Full Code Here

     */
    public void testChangeSummary() throws IOException {
        // Create an empty data graph and add a root object, an instance of type Quote
        //
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        DataObject quote = dataGraph.createRootObject("http://www.example.com/simple", "Quote");

        // Begin logging changes
        //
        ChangeSummary changeSummary = dataGraph.getChangeSummary();
        changeSummary.beginLogging();

        // Modify the data graph in various fun and interesting ways
        //
        quote.setString("symbol", "fbnt");
View Full Code Here

               "DataGraph datagraph = SDOUtil.loadDataGraph(\n"+
               "      ClassLoader.getSystemResourceAsStream(SampleInfrastructure.COMPANY_DATAGRAPH_XML), null);"

            );

            DataGraph datagraph = SDOUtil.loadDataGraph(ClassLoader.getSystemResourceAsStream(SampleInfrastructure.COMPANY_DATAGRAPH_XML), null);

            System.out.println(datagraph);

            commentary(
                "In this case we directly receive an instance of DataGraph and can retrieve the root\n"+
                "business object from the DataGraph\n\n"+
                "DataObject company = datagraph.getRootObject();");
           
            company = datagraph.getRootObject();
            System.out.println(company);           
            System.out.println();
                     
        } catch (Exception e) {
            somethingUnexpectedHasHappened(e);
View Full Code Here

      
        commentary (COMMENTARY_FOR_INTERMEDIATE,
            "Here is the use of the Tuscany API for creating a DataGraph instance\n\n"+
            "DataGraph dataGraph = SDOUtil.createDataGraph();");

        DataGraph dataGraph = SDOUtil.createDataGraph();
       
        commentary(COMMENTARY_FOR_INTERMEDIATE,
            "Now we create a root object of a selected type for the DataGraph wrapper to contain.\n"+
            "This is an example of a DataGraph interface that currently forces us to use the default scope.\n\n"+
            "company = dataGraph.createRootObject(SampleInfrastructure.COMPANY_NAMESPACE, \"CompanyType\");");
       
        DataObject company = dataGraph.createRootObject(SampleInfrastructure.COMPANY_NAMESPACE, "CompanyType");
       
        populateGraph(scope, company);
       
        commentary(COMMENTARY_FOR_INTERMEDIATE,
            "Since the SDO API doesn't currently have a method for serializing the DataGraph instance\n"+
View Full Code Here

TOP

Related Classes of commonj.sdo.DataGraph

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.