Package junit.framework

Examples of junit.framework.AssertionFailedError


  @Test
  public void should_write_test_execution_when_test_fails() {
    startSuite();
    junit.framework.Test test = mockTest();
    AssertionFailedError error = errorOrFailure();
    formatter.addFailure(test, error);
    XmlNode root = root();
    assertThatTestCaseNodeWasAddedTo(root);
    XmlNode failureNode = firstTestCaseNodeIn(root).child(0);
    assertThat(failureNode.name()).isEqualTo("failure");
View Full Code Here


  @Test
  public void should_write_test_execution_when_error_is_thrown() {
    startSuite();
    junit.framework.Test test = mockTest();
    AssertionFailedError error = errorOrFailure();
    formatter.addError(test, error);
    XmlNode root = root();
    assertThatTestCaseNodeWasAddedTo(root);
    XmlNode errorNode = firstTestCaseNodeIn(root).child(0);
    assertThat(errorNode.name()).isEqualTo("error");
View Full Code Here

    assertThat(startedTests).hasSize(1);
    assertThat(startedTests.keySet()).containsOnly(test);
  }

  final AssertionFailedError errorOrFailure() {
    return new AssertionFailedError(ERROR_OR_FAILURE_MESSAGE);
  }
View Full Code Here

    try {
      fail();
    } catch (AssertionFailedError e) {
      return;
    }
    throw new AssertionFailedError();
  }
View Full Code Here

      }
    };
    runner.setPrinter(printer);
    TestSuite suite = new TestSuite();
    suite.addTest(new TestCase() { @Override
    public void runTest() {throw new AssertionFailedError();}});
    runner.doRun(suite);
    assertEquals(expected, output.toString());
  }
View Full Code Here

    TestPageRenderer renderer = new TestPageRenderer(handler);
    renderer.redirectToRender = true;

    when(provider.getPageInstance()).thenThrow(
      new AssertionFailedError("no page instance should be created"));

    when(urlRenderer.getBaseUrl()).thenReturn(Url.parse("a"));

    when(requestCycle.mapUrlFor(eq(handler))).thenReturn(Url.parse("b"));
View Full Code Here

        " Component: " + component);
    }

    if (throwException && res.wasFailed())
    {
      throw new AssertionFailedError(res.getMessage());
    }
    return res;
  }
View Full Code Here

    }

    String ajaxLocation = getLastResponse().getHeader("Ajax-Location");
    if (null == ajaxLocation)
    {
      throw new AssertionFailedError("Ajax-Location header should be present when using Ajax");
    }

    int statusCode = getLastResponse().getStatus();
    if (statusCode != 200)
    {
      throw new AssertionFailedError("Expected HTTP status code to be 200 (OK)");
    }
  }
View Full Code Here

   */
  private void assertResult(Result result)
  {
    if (result.wasFailed())
    {
      throw new AssertionFailedError(result.getMessage());
    }
  }
View Full Code Here

      SequenceReport report = (SequenceReport) currentSequences.next();
      if(!sequenceIds.contains(report.getSequenceID())) {
        return report;
      }
    }
    throw new AssertionFailedError("Failed to find a new reply sequence");
  }
View Full Code Here

TOP

Related Classes of junit.framework.AssertionFailedError

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.