1 package org.starobjects.tested.fitnesse.internal.util;
2
3 import fit.Fixture;
4 import fit.Parse;
5 import fit.exception.FitFailureException;
6
7 public final class FitnesseUtil {
8
9 private FitnesseUtil() {}
10
11 public static Parse cell(final Parse row, final int columnNumber) {
12 Parse cell = row.parts;
13 if (cell == null) {
14 return cell;
15 }
16 int i = 0;
17 while (true) {
18 if (columnNumber == i) {
19 return cell;
20 }
21 if (cell.more == null) {
22 return cell;
23 }
24 cell = cell.more;
25 i++;
26 }
27 }
28
29 public static void exception(final Fixture fixture, final Parse cell,
30 final String message) {
31 fixture.exception(cell, new FitFailureException(message));
32 }
33
34 }