Package fitnesse.testsystems.slim

Examples of fitnesse.testsystems.slim.HtmlTableScanner


    return st;
  }

  private ScriptTable makeScriptTable(String tableText, boolean localized) throws Exception {
    WikiPageUtil.setPageContents(root, tableText);
    TableScanner ts = new HtmlTableScanner(root.getHtml());
    Table t = ts.getTable(0);
    SlimTestContextImpl testContext = new SlimTestContextImpl();
    if (localized) return new LocalizedScriptTable(t, "id", testContext);
    else return new ScriptTable(t, "id", testContext);
  }
View Full Code Here


    return qt;
  }

  private QueryTable makeQueryTable(String tableText) throws Exception {
    WikiPageUtil.setPageContents(root, tableText);
    TableScanner ts = new HtmlTableScanner(root.getHtml());
    Table t = ts.getTable(0);
    testContext = new SlimTestContextImpl();
    return constructQueryTable(t);
  }
View Full Code Here

  private ScenarioTable makeScenarioTable(String contents)
      throws Exception {
    String pageContents = "|" + EXTENSION_NAME + "|" + contents + "|\n";
    WikiPageUtil.setPageContents(root, pageContents);

    TableScanner ts = new HtmlTableScanner(root.getHtml());
    Table t = ts.getTable(0);
    SlimTestContextImpl testContext = new SlimTestContextImpl();
    st = new AutoArgScenarioTable(t, "id", testContext);
    instructions.addAll(st.getAssertions());

    return st;
View Full Code Here

    private ScenarioTable makeScenarioTable(String pageContents)
        throws Exception {
        WikiPageUtil.setPageContents(root, pageContents);

        TableScanner ts = new HtmlTableScanner(root.getHtml());
        Table t = ts.getTable(0);
      SlimTestContextImpl testContext = new SlimTestContextImpl();
        st = new ScenarioTable(t, "id", testContext);
        instructions.addAll(st.getAssertions());

        return st;
View Full Code Here

  public void setup() {
    testContext = new SlimTestContextImpl();
  }

  private void assertExpectationMessage(String expected, String value, String message) throws Exception {
    TableScanner ts = new HtmlTableScanner("<table><tr><td>x</td></tr></table>");
    Table t = ts.getTable(0);
    SlimTable slimTable = new DecisionTable(t, "id", testContext);
    SlimTable.RowExpectation expectation = slimTable.new ReturnedValueExpectation(0, 0);
    SlimTestResult testResult = expectation.evaluationMessage(value, expected);
    assertEquals(message, testResult.toString(expected));
    //assertEquals(message, expectation.getEvaluationMessage());
View Full Code Here

  public T createSlimTable(String tableText) {
    try {
      Constructor<T> constructor = getParameterizedClass().getConstructor(Table.class, String.class, SlimTestContext.class);
      WikiPageUtil.setPageContents(root, tableText);
      String html = root.getHtml();
      TableScanner<HtmlTable> ts = new HtmlTableScanner(html);
      Table t = ts.getTable(0);
      SlimTestContextImpl testContext = new SlimTestContextImpl();
      return constructor.newInstance(t, "id", testContext);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

  }

  private SlimTestContextImpl makeTables(String tableText) throws Exception {
    SlimTestContextImpl testContext = new SlimTestContextImpl();
    WikiPageUtil.setPageContents(root, tableText);
    TableScanner ts = new HtmlTableScanner(root.getHtml());
    Table t = ts.getTable(0);
    ScenarioTable st = new ScenarioTable(t, "s_id", testContext);
    t = ts.getTable(1);
    dt = new DecisionTable(t, "did", testContext);
    assertions.addAll(st.getAssertions());
    assertions.addAll(dt.getAssertions());
    return testContext;
  }
View Full Code Here

    return st;
  }

  private ScriptTable makeScriptTable(String tableText) throws Exception {
    WikiPageUtil.setPageContents(root, tableText);
    TableScanner ts = new HtmlTableScanner(root.getHtml());
    Table t = ts.getTable(0);
    SlimTestContextImpl testContext = new SlimTestContextImpl();
    return new HtmlScriptTable(t, "id", testContext);
  }
View Full Code Here

    return tt;
  }

  private TableTable makeTableTable(String tableText) throws Exception {
    WikiPageUtil.setPageContents(root, tableText);
    TableScanner ts = new HtmlTableScanner(root.getHtml());
    Table t = ts.getTable(0);
    SlimTestContextImpl testContext = new SlimTestContextImpl();
    return new TableTable(t, "id", testContext);
  }
View Full Code Here

    SlimTestContextImpl testContext = new SlimTestContextImpl();
    String tableText = "!|" + SCEN_EXTENSION_NAME + "|" + scenarioText + "|\n"
            + "\n"
            + "!|DT:" + scriptText + "|\n";
    WikiPageUtil.setPageContents(root, tableText);
    TableScanner ts = new HtmlTableScanner(root.getHtml());
    Table t = ts.getTable(0);
    ScenarioTable st = new ScenarioTableWithDifferentScript(t, "s_id", testContext);
    t = ts.getTable(1);
    dt = new DecisionTable(t, "did", testContext);
    assertions.addAll(st.getAssertions());
    assertions.addAll(dt.getAssertions());
    return testContext;
  }
View Full Code Here

TOP

Related Classes of fitnesse.testsystems.slim.HtmlTableScanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.