Package junit.framework

Examples of junit.framework.TestListener


  public void start(final BundleContext bc) throws Exception {
    bt = new BundleTracker(bc, Bundle.ACTIVE, this);
    bt.open();

    TestListener tl = new TestListener() {
      public void addError(Test test, Throwable t) {
      }

      public void addFailure(Test test, AssertionFailedError t) {
      }
View Full Code Here


        RunListener listener = result.createListener();
        RunNotifier notifier = new RunNotifier();
        notifier.addFirstListener(listener);
        TestCase testCase = new TestCase() {
        };
        TestListener adaptingListener = new JUnit38ClassRunner(testCase)
                .createAdaptingListener(notifier);
        adaptingListener.addFailure(testCase, new AssertionFailedError());
        assertEquals(1, result.getFailureCount());
    }
View Full Code Here

    public void testNotifyResult() {
        JUnit4TestAdapter adapter = new JUnit4TestAdapter(ErrorTest.class);
        TestResult result = new TestResult();
        final StringBuffer log = new StringBuffer();
        result.addListener(new TestListener() {

            public void startTest(junit.framework.Test test) {
                log.append(" start ").append(test);
            }
View Full Code Here

 
  public void testNotifyResult() {
    JUnit4TestAdapter adapter= new JUnit4TestAdapter(ErrorTest.class);
    TestResult result= new TestResult();
    final StringBuffer log= new StringBuffer();
    result.addListener(new TestListener() {
   
      public void startTest(junit.framework.Test test) {
        log.append(" start " + test);
      }
   
View Full Code Here

    result.addListener(getListener(notifier));
    fTest.run(result);
  }

  private TestListener getListener(final RunNotifier notifier) {
    return new TestListener() {
      public void endTest(Test test) {
        // TODO: uncovered
        notifier.fireTestFinished(asDescription(test));
      }
View Full Code Here

     * as a failure not an error.
     *
     * @since Ant 1.7
     */
    private TestListener wrapListener(final TestListener testListener) {
        return new TestListener() {
            public void addError(Test test, Throwable t) {
                if (junit4 && t instanceof AssertionFailedError) {
                    // JUnit 4 does not distinguish between errors and failures
                    // even in the JUnit 3 adapter.
                    // So we need to help it a bit to retain compatibility for JUnit 3 tests.
View Full Code Here

        }

        public void run(final TestResult result)
        {
            TestResult subResult = new TestResult();
            subResult.addListener(new TestListener()
            {
                public void addError(Test subtest, Throwable throwable)
                {
                    Test dummyTest = createDummyTest(subtest);
                    result.addError(dummyTest, throwable);
View Full Code Here

    result.addListener(getListener(notifier));
    fTest.run(result);
  }

  private TestListener getListener(final RunNotifier notifier) {
    return new TestListener() {
      public void endTest(Test test) {
        // TODO: uncovered
        notifier.fireTestFinished(asDescription(test));
      }
View Full Code Here

     * as a failure not an error.
     *
     * @since Ant 1.7
     */
    private TestListener wrapListener(final TestListener testListener) {
        return new TestListener() {
            public void addError(Test test, Throwable t) {
                if (junit4 && t instanceof AssertionFailedError) {
                    // JUnit 4 does not distinguish between errors and failures
                    // even in the JUnit 3 adapter.
                    // So we need to help it a bit to retain compatibility for JUnit 3 tests.
View Full Code Here

     * as a failure not an error.
     *
     * @since Ant 1.7
     */
    private TestListener wrapListener(final TestListener testListener) {
        return new TestListener() {
            public void addError(Test test, Throwable t) {
                if (junit4 && t instanceof AssertionFailedError) {
                    // JUnit 4 does not distinguish between errors and failures
                    // even in the JUnit 3 adapter.
                    // So we need to help it a bit to retain compatibility for JUnit 3 tests.
View Full Code Here

TOP

Related Classes of junit.framework.TestListener

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.