Package fitnesse.testsystems

Examples of fitnesse.testsystems.TestResult


  @Test
  public void tableWithSetSymbolReturnVariableInResult() throws Exception {
    makeQueryTableAndBuildInstructions(queryTableHeader + "|1|$A=|\n");
    QueryTable.QueryTableExpectation expectation = qt.new QueryTableExpectation();
    TestResult result = expectation.evaluateExpectation(asList(asList(asList("n", "1"), asList("2n", "2"))));

    assertNotNull(result.getVariablesToStore());
    assertEquals("2", result.getVariablesToStore().get("A"));
  }
View Full Code Here


  @Test
  public void anErrorShouldBeRegisteredIfQueryDoesNotReturnAList() throws Exception {
    makeQueryTableAndBuildInstructions("|a|\n|b|\n");
    QueryTable.QueryTableExpectation expectation = qt.new QueryTableExpectation();
    TestResult result = expectation.evaluateExpectation("String result");

    assertEquals(ExecutionResult.ERROR, result.getExecutionResult());
    assertEquals(1, testContext.getTestSummary().getExceptions());
  }
View Full Code Here

  @Test
  public void ShouldBeIgnoredIfQueryResultIsNull() throws Exception {
    makeQueryTableAndBuildInstructions("|a|\n|b|\n");
    QueryTable.QueryTableExpectation expectation = qt.new QueryTableExpectation();
    TestResult result = expectation.evaluateExpectation(null);

    assertEquals(ExecutionResult.IGNORE, result.getExecutionResult());
  }
View Full Code Here

  @Test
  public void tableWithSetSymbolReturnVariableInResult() throws Exception {
    makeTableTableAndBuildInstructions(tableTableHeader + "|$A=|$B=|$C=|$D=|$E=|$F=|\n");
    TableTable.TableTableExpectation expectation = tt.new TableTableExpectation();
    TestResult result = expectation.evaluateExpectation(asList(asList("pass:1", "ignore:2", "fail:3", "sole:l", "no change", "pass")));

    assertNotNull(result.getVariablesToStore());
    assertEquals("1", result.getVariablesToStore().get("A"));
    assertEquals("2", result.getVariablesToStore().get("B"));
    assertEquals("3", result.getVariablesToStore().get("C"));
    assertEquals("sole:l", result.getVariablesToStore().get("D"));
    assertNull(result.getVariablesToStore().get("E"));
    assertNull(result.getVariablesToStore().get("F"));
  }
View Full Code Here

      this.actual = actual;
      this.expected = expected;
    }

    public boolean matches() {
      TestResult testResult = evaluate();
      return testResult != null && testResult.getExecutionResult() == ExecutionResult.PASS;
    }
View Full Code Here

          if (exceptionResult != null) {
            testExceptionOccurred(a, exceptionResult);
          }
        } else {
          //Normal results
          TestResult testResult = a.getExpectation().evaluateExpectation(returnValue);
          testAssertionVerified(a, testResult);

          //Retrieve variables set during expectation step
          if (testResult != null) {
            Map<String, ?> variables = testResult.getVariablesToStore();
            if (variables != null) {
              List<Instruction> instructions = new ArrayList<Instruction>(variables.size());
              int i = 0;
              for (Entry<String, ?> variable : variables.entrySet()) {
                instructions.add(new AssignInstruction("assign_" + i++, variable.getKey(), variable.getValue()));
View Full Code Here

  @Test
  public void shouldProvideFirstFailure() {
    RunNotifier notifier = mock(RunNotifier.class);
    JUnitRunNotifierResultsListener listener = new JUnitRunNotifierResultsListener(notifier, getClass());

    TestResult testResult = SlimTestResult.fail("Actual", "Expected");

    listener.testAssertionVerified(null, testResult);
    listener.testComplete(mockWikiTestPage(), new TestSummary(0, 1, 0, 0));

    ArgumentCaptor<Failure> argument = ArgumentCaptor.forClass(Failure.class);
View Full Code Here

  @Test
  public void shouldProvideFirstException() {
    RunNotifier notifier = mock(RunNotifier.class);
    JUnitRunNotifierResultsListener listener = new JUnitRunNotifierResultsListener(notifier, getClass());

    TestResult testResult = SlimTestResult.error("Message", "Actual");

    listener.testAssertionVerified(null, testResult);
    listener.testComplete(mockWikiTestPage(), new TestSummary(0, 0, 0, 1));

    ArgumentCaptor<Failure> argument = ArgumentCaptor.forClass(Failure.class);
View Full Code Here

TOP

Related Classes of fitnesse.testsystems.TestResult

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.