コード例 #1
0
ファイル: Fixture.java プロジェクト: raboof/fitnesse
 private void compare() {
   if (typeAdapter.equals(expected, result)) {
     right(cell);
   } else {
     wrong(cell, typeAdapter.toString(result));
   }
 }
コード例 #2
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"));
   }
 }
コード例 #3
0
ファイル: Fixture.java プロジェクト: raboof/fitnesse
 private void handleErrorInCell(TypeAdapter a, Parse cell) {
   try {
     Object result = a.invoke();
     wrong(cell, a.toString(result));
   } catch (IllegalAccessException e) {
     exception(cell, e);
   } catch (Exception e) {
     right(cell);
   }
 }
コード例 #4
0
ファイル: TypeAdapter.java プロジェクト: huenu/fitnesse
 public String toString(Object o) {
   if (o == null) return "";
   int length = Array.getLength(o);
   StringBuffer b = new StringBuffer(5 * length);
   for (int i = 0; i < length; i++) {
     b.append(componentAdapter.toString(Array.get(o, i)));
     if (i < (length - 1)) {
       b.append(", ");
     }
   }
   return b.toString();
 }
コード例 #5
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;
 }