Package org.infinitest.testrunner

Examples of org.infinitest.testrunner.TestEvent


    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
  }

  private static TestEvent withATest() {
    return new TestEvent(TEST_CASE_STARTING, "", "", "", null);
  }
View Full Code Here


  @Test
  public void shouldCollectFailureEvents() throws Exception {
    AssertionError error = new AssertionError();
    result.createListener().testFailure(new Failure(description, error));
    eventTranslator.testRunFinished(result);
    TestEvent expectedEvent = methodFailed("", getClass().getName(), "methodName", error);
    assertEquals(expectedEvent, getOnlyElement(eventTranslator.getTestResults()));
  }
View Full Code Here

  @Test
  public void shouldCollectErrorEvents() throws Exception {
    Exception error = new NullPointerException();
    result.createListener().testFailure(new Failure(description, error));
    eventTranslator.testRunFinished(result);
    TestEvent expectedEvent = methodFailed("", getClass().getName(), "methodName", error);
    assertEquals(expectedEvent, getOnlyElement(eventTranslator.getTestResults()));
  }
View Full Code Here

    unequals.add(methodFailed("boo", getClass().getName(), "testMethod", new RuntimeException()));
    return unequals;
  }

  private TestEvent eventWithError(Throwable error) {
    return new TestEvent(METHOD_FAILURE, error.getMessage(), TestEventTest.class.getName(), testName.getMethodName(), error);
  }
View Full Code Here

    registry.removeMarker(mock(MarkerInfo.class));
  }

  @Test
  public void shouldRemoveMarkersWhenTestPasses() {
    TestEvent event = failureEvent("my failure message");
    addMarker(event);
    registry.removeMarker(new FakeProblemMarkerInfo(event));

    assertTrue(registry.getMarkers().isEmpty());
  }
View Full Code Here

  }

  @Test
  public void shouldFireEventsToReportFailingResults() {
    TestResults results = runner.runTest(FailingTest.class.getName());
    TestEvent expectedEvent = methodFailed("", FailingTest.class.getName(), "shouldFail", new AssertionError());
    assertEventsEquals(expectedEvent, getOnlyElement(results));
  }
View Full Code Here

  }

  @Test
  public void shouldTreatUninstantiableTestsAsFailures() {
    Iterable<TestEvent> events = runner.runTest(TEST_CLASS.getName());
    TestEvent expectedEvent = methodFailed(null, TEST_CLASS.getName(), "shouldPass", new IllegalStateException());
    assertEventsEquals(expectedEvent, getOnlyElement(events));
  }
View Full Code Here

  }

  @Test
  public void shouldSupportTestNG() {
    Iterable<TestEvent> events = runner.runTest(TestNGTest.class.getName());
    TestEvent expectedEvent = methodFailed(TestNGTest.class.getName(), "shouldFail", new AssertionError("expected [false] but found [true]"));
    assertEventsEquals(expectedEvent, getOnlyElement(events));
  }
View Full Code Here

      public void testCaseComplete(TestCaseEvent event) {
        events.add(event);
      }
    });

    TestEvent startingEvent = testCaseStarting("Test1");
    aggregator.testCaseStarting(startingEvent);
    assertSame(startingEvent, getOnlyElement(events));

    TestCaseEvent completeEvent = new TestCaseEvent("Test1", this, new TestResults());
    aggregator.testCaseComplete(completeEvent);
View Full Code Here

  @Test
  public void shouldNotifyTestCollectorOfTestEvents() {
    FailureListenerSupport listener = new FailureListenerSupport();
    collector.addChangeListener(listener);
    TestEvent failureEvent = methodFailed("message", DEFAULT_TEST_NAME, "methodName", new AssertionError());

    testRun(failureEvent);
    assertEquals(failureEvent, getOnlyElement(collector.getFailures()));
    assertEquals(failureEvent, getOnlyElement(listener.added));
    assertTrue(listener.removed.isEmpty());
View Full Code Here

TOP

Related Classes of org.infinitest.testrunner.TestEvent

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.