Package commonj.sdo

Examples of commonj.sdo.ChangeSummary$Setting


    public void testMixedQuoteType() throws IOException {
        QuoteBase quote = CSFactory.INSTANCE.createQuoteBase();
        DataObject dQuote = (DataObject)quote;

        // ChangeSummary csp = quote.getChanges();
        ChangeSummary cs = dQuote.getChangeSummary();
        ChangeSummary csp = quote.getChanges();
        cs.beginLogging();

        assertSame(cs, csp);
       
        quote.setSymbol("fbnt");
View Full Code Here


   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetEChangeSummary(ChangeSummary newEChangeSummary, NotificationChain msgs)
  {
    ChangeSummary oldEChangeSummary = eChangeSummary;
    eChangeSummary = newEChangeSummary;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, oldEChangeSummary, newEChangeSummary);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

  }

  public ChangeSummary getChangeSummary()
  {
    //FB is this the right place to create the resources?
    ChangeSummary changeSummary = getEChangeSummary();
    if (changeSummary == null)
    {
      getRootResource();
      changeSummary = createEChangeSummary();
      setEChangeSummary(changeSummary);
View Full Code Here

  /**
   * @param strProp
   * @param iNewt
   */
  private void testBasicsBody(Property strProp, DataObject iNewt) {
    ChangeSummary cs = iNewt.getChangeSummary();
    cs.beginLogging();

    List co = cs.getChangedDataObjects();
    assertEquals(0, co.size());
    iNewt.set(strProp, "some text");
    assertEquals(0, co.size());
    co = cs.getChangedDataObjects();
    assertEquals(1, co.size());
   
    List oldValues = cs.getOldValues((DataObject)co.get(0));
   
    ChangeSummary.Setting ov1 = (ChangeSummary.Setting)oldValues.get(0);
    Property p = ov1.getProperty();
    assertEquals("strElem", p.getName());
    Object v = ov1.getValue();
    assertEquals(null, v);

    assertTrue(cs.isLogging());
    cs.endLogging();
    assertFalse(cs.isLogging());
   
  }
View Full Code Here

   * @param quote
   */
  private void testDynamicNestedDOBody(DataObject quote) {
    // Begin logging changes
    //
    ChangeSummary changeSummary = quote.getChangeSummary();
    assertNotNull(changeSummary);
    assertFalse(changeSummary.isLogging());
    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"));

    changeSummary.endLogging();
    assertEquals(2, changeSummary.getChangedDataObjects().size())// 2 DataObjects
    assertTrue(changeSummary.getChangedDataObjects().contains(quote));
    assertTrue(changeSummary.getChangedDataObjects().contains(child));
    assertFalse(changeSummary.isCreated(quote));
    assertTrue(changeSummary.isCreated(child));
   
    ChangeSummary.Setting ov = changeSummary.getOldValue(quote, quote.getType().getProperty("symbol"));
    assertNull(ov.getValue());
   

  }
View Full Code Here

     */
    public void testChangeSummary() throws Exception {
        Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "RootQuote");
        DataObject quote = DataFactory.INSTANCE.create(quoteType);

        ChangeSummary cs = quote.getChangeSummary();

        // Begin logging changes
        //
        cs.beginLogging();

        DataObject child = quote.createDataObject("quotes");
        cs.isCreated(child);
        child = quote.createDataObject("quotes");
        assertTrue(cs.isCreated(child));

        // Stop logging changes and print the resulting data graph to stdout
        //
        cs.endLogging();

        cs.isCreated(child);

        cs.undoChanges();

        assertFalse(cs.isCreated(child));
    }
View Full Code Here

     */
    protected final void change(String nameSpace, String beforeUndo, String afterUndo) throws Exception {
        Type quoteType = hc.getTypeHelper().getType(nameSpace, "RootQuote");
        DataObject quote = dataFactory.create(quoteType);
       
        ChangeSummary cs = quote.getChangeSummary();
        ChangeSummary csp = (ChangeSummary)quote.get("changes");

        assertSame(cs, csp);

        quote.setString("symbol", "fbnt");
        quote.setString("companyName", "FlyByNightTechnology");
View Full Code Here

     * Open/any ChangeSummary property test.
     */
    public void testOpenChangeSummary() throws Exception {
        DataObject quote = dataFactory.create(xsdHelper.getGlobalProperty(SequenceTest_NameSpace, SequenceTest_ELEMENT, true).getType());
       
        ChangeSummary cs = quote.getChangeSummary();
        ChangeSummary csp = (ChangeSummary)quote.get("changes");

        assertSame(cs, csp);

        quote.set("symbol", "fbnt");
        Property property = xsdHelper.getGlobalProperty("http://www.example.com/open", "openStockQuote", true);
View Full Code Here

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

   * <!-- end-user-doc -->
   * @generated
   */
  public void setChangeSummary(ChangeSummary newChangeSummary)
  {
    ChangeSummary oldChangeSummary = changeSummary;
    changeSummary = newChangeSummary;
    boolean oldChangeSummary_set_ = changeSummary_set_;
    changeSummary_set_ = true;
    if (isNotifying())
      notify(ChangeKind.SET, INTERNAL_CHANGE_SUMMARY, oldChangeSummary, changeSummary, !oldChangeSummary_set_);
View Full Code Here

TOP

Related Classes of commonj.sdo.ChangeSummary$Setting

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.