public void testGetDataObject() {
   DataCollection allItems = getDefaultCollection();
   int count = 0;
   while (allItems.next()) {
     DataObject obj = allItems.getDataObject();
     assertEquals("Somehow failed to retrieve a Node?", "Node", obj.getObjectType().getName());
     count++;
   }
   assertTrue("No data objects?", count > 0);
 }
  protected void setUp() {
    DataObject parent = getSession().create("examples.Node");
    m_nodeType = parent.getObjectType();
    parent.set("id", new BigDecimal(0));
    parent.set("name", "Root");
    parent.save();

    for (int i = 1; i < 10; i++) {
      DataObject child = getSession().create("examples.Node");
      child.set("id", new BigDecimal(i));
      child.set("name", "child" + i);
      child.set("parent", parent);
      child.save();
      parent.save();

      parent = child;
    }
  }
Ejemplo n.º 3
0
  public ProjectEvent(Object source, DataObject contextObject, String action) {

    this(source, contextObject.getObjectType(), action, contextObject);
  }