Example #1
0
 protected void compareTreeItem(Treeitem item) throws EmulationException {
   Treerow row = null;
   for (Object obj : item.getChildren()) {
     if (obj instanceof Treerow) {
       row = (Treerow) obj;
       break;
     }
   }
   int counter = 0;
   for (Object obj : row.getChildren()) {
     if (obj instanceof Treecell) {
       if (counter >= _values.length) {
         fail(
             "Tree contains more items than specified in file. File: "
                 + _reader.getFileName()
                 + " Row: "
                 + _row);
       }
       assertEquals(
           "Tree item doesn't match. File: " + _reader.getFileName() + " Row: " + _row,
           _values[counter++],
           TreeUtil.getColumnText((Treecell) obj));
     }
   }
   if (counter < _values.length) {
     fail(
         "Tree contains less items than specified in file. File: "
             + _reader.getFileName()
             + " Row: "
             + _row);
   }
   compareTreeChildren(item);
 }
Example #2
0
 public static void storeTree(Tree tree, String treeDumpFile, boolean loadHeader)
     throws EmulationException, IOException {
   FileWriter fw = new FileWriter(treeDumpFile);
   try {
     fw.append(TreeUtil.treeToString(tree, loadHeader));
   } finally {
     fw.close();
   }
 }