Examples of TestEvent


Examples of org.bukkit.event.TestEvent

        pm.callEvent(event);
    }

    @Test
    public void testAsyncLocked() throws InterruptedException {
        final Event event = new TestEvent(true);
        Thread secondThread = new Thread(
            new Runnable() {
                public void run() {
                    try {
                        synchronized (pm) {
                            pm.callEvent(event);
                        }
                    } catch (Throwable ex) {
                        store.value = ex;
                    }
                }
            }
        );
        secondThread.start();
        secondThread.join();
        assertThat(store.value, is(instanceOf(IllegalStateException.class)));
        assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
    }
View Full Code Here

Examples of org.bukkit.event.TestEvent

        assertThat(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.", is(((Throwable) store.value).getMessage()));
    }

    @Test
    public void testAsyncUnlocked() throws InterruptedException {
        final Event event = new TestEvent(true);
        Thread secondThread = new Thread(
            new Runnable() {
                public void run() {
                    try {
                        pm.callEvent(event);
View Full Code Here

Examples of org.bukkit.event.TestEvent

        }
    }

    @Test
    public void testSyncUnlocked() throws InterruptedException {
        final Event event = new TestEvent(false);
        Thread secondThread = new Thread(
            new Runnable() {
                public void run() {
                    try {
                        pm.callEvent(event);
View Full Code Here

Examples of org.bukkit.event.TestEvent

        }
    }

    @Test
    public void testSyncLocked() throws InterruptedException {
        final Event event = new TestEvent(false);
        Thread secondThread = new Thread(
            new Runnable() {
                public void run() {
                    try {
                        synchronized (pm) {
View Full Code Here

Examples of org.drools.compiler.integrationtests.facts.TestEvent

     */
    @Test
    public void starImportedFactAlsoDeclaredInDRL() throws Exception {
        AgendaEventListener ael = mock(AgendaEventListener.class);
        ksession.addEventListener(ael);
        ksession.insert(new TestEvent("event 1"));
        ksession.fireAllRules();

        // the rule should have fired exactly once
        verify(ael, times(1)).afterMatchFired(any(AfterMatchFiredEvent.class));
    }
View Full Code Here

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

Examples of org.infinitest.testrunner.TestEvent

  @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

Examples of org.infinitest.testrunner.TestEvent

  @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

Examples of org.infinitest.testrunner.TestEvent

    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

Examples of org.infinitest.testrunner.TestEvent

    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
TOP
Copyright © 2018 www.massapi.com. 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.