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");
quote.setString("companyName", "FlyByNightTechnology");
quote.setBigDecimal("price", new BigDecimal("1000.0"));
quote.setBigDecimal("open1", new BigDecimal("1000.0"));
quote.setBigDecimal("high", new BigDecimal("1000.0"));
quote.setBigDecimal("low", new BigDecimal("1000.0"));
quote.setDouble("volume", 1000);
quote.setDouble("change1", 1000);
DataObject child = quote.createDataObject("quotes");
child.setBigDecimal("price", new BigDecimal("2000.0"));
// Stop logging changes and print the resulting data graph to stdout
//
changeSummary.endLogging();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SDOUtil.saveDataGraph(dataGraph, baos, null);
assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));