コード例 #1
0
ファイル: Fixture.java プロジェクト: raboof/fitnesse
 public void handleBlankCell(Parse cell, TypeAdapter a) {
   try {
     cell.addToBody(gray(a.toString(a.get())));
   } catch (Exception e) {
     cell.addToBody(gray("error"));
   }
 }
コード例 #2
0
ファイル: Fixture.java プロジェクト: raboof/fitnesse
    private void compareCellToResult(TypeAdapter a, Parse theCell) {
      typeAdapter = a;
      cell = theCell;

      try {
        result = typeAdapter.get();
        expected = parseCell();
        if (expected instanceof Unparseable) tryRelationalMatch();
        else compare();
      } catch (Exception e) {
        exception(cell, e);
      }
    }
コード例 #3
0
ファイル: RowFixture.java プロジェクト: SamuelFare/fitnesse
 protected Map<Object, Object> cSort(List<?> list, int col) {
   TypeAdapter a = columnBindings[col].adapter;
   Map<Object, Object> result = new ConcurrentHashMap<Object, Object>(list.size());
   for (Object row : list) {
     try {
       a.target = row;
       Object key = a.get();
       bin(result, key, row);
     } catch (Exception e) {
       // surplus anything with bad keys, including null
       surplus.add(row);
     }
   }
   return result;
 }
コード例 #4
0
ファイル: RowFixture.java プロジェクト: SamuelFare/fitnesse
 protected Parse buildCells(Object row) {
   if (row == null) {
     Parse nil = new Parse("td", "null", null, null);
     nil.addToTag(" colspan=" + columnBindings.length);
     return nil;
   }
   Parse root = new Parse(null, null, null, null);
   Parse next = root;
   for (Binding columnBinding : columnBindings) {
     next = next.more = new Parse("td", "&nbsp;", null, null);
     TypeAdapter a = columnBinding.adapter;
     if (a == null) {
       ignore(next);
     } else {
       try {
         a.target = row;
         next.body = gray(escape(a.toString(a.get())));
       } catch (Exception e) {
         exception(next, e);
       }
     }
   }
   return root.more;
 }