Пример #1
0
 private List<SlimTable> createSlimTables(TableScanner tableScanner) {
   List<SlimTable> allTables = new LinkedList<SlimTable>();
   for (Table table : tableScanner) {
     String tableId = "" + allTables.size();
     SlimTable slimTable = makeSlimTable(table, tableId, this);
     if (slimTable != null) {
       allTables.add(slimTable);
     }
   }
   return allTables;
 }
Пример #2
0
  String processAllTablesOnPage(PageData pageData) throws Exception {
    tableScanner = scanTheTables(pageData);
    allTables = createSlimTables(tableScanner);
    testResults = pageData;

    boolean runAllTablesAtOnce = false;
    String htmlResults = "";
    if (runAllTablesAtOnce || (allTables.size() == 0)) {
      htmlResults = processTablesAndGetHtml(allTables, START_OF_TEST, END_OF_TEST);
    } else {
      List<SlimTable> oneTableList = new ArrayList<SlimTable>(1);
      for (int index = 0; index < allTables.size(); index++) {
        SlimTable theTable = allTables.get(index);
        SlimTable startWithTable = (index == 0) ? START_OF_TEST : theTable;
        SlimTable nextTable =
            (index + 1 < allTables.size()) ? allTables.get(index + 1) : END_OF_TEST;

        oneTableList.add(theTable);
        htmlResults += processTablesAndGetHtml(oneTableList, startWithTable, nextTable);
        oneTableList.clear();
      }
    }
    return htmlResults;
  }