ClassCastException when calling methods on mocks configured via Expectations from EDT #318

Closed
wigbam opened this Issue Aug 11, 2016 · 0 comments

Projects

None yet

2 participants

@wigbam
wigbam commented Aug 11, 2016

This issue is related to #181

Easy to reproduce:

@Test
public void testExpectationsFromEDT(final @Mocked java.util.concurrent.Callable<Boolean> b) throws Exception {
    new Expectations() /* @formatter:off */ {{
        b.call(); result = true;
    }}; // @formatter:on

    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
        @Override
        public void run() {
            try {
                org.junit.Assert.assertTrue(b.call());
            } catch (final Exception ex) {
                throw new RuntimeException(ex);
            }
        }
    });
}
@wigbam wigbam changed the title from ClassCastException when calling invoking methods on mocks configured via Expectations from EDT to ClassCastException when calling methods on mocks configured via Expectations from EDT Aug 11, 2016
@rliesenfeld rliesenfeld added the bug label Aug 11, 2016
@rliesenfeld rliesenfeld self-assigned this Aug 11, 2016
@rliesenfeld rliesenfeld added a commit that closed this issue Aug 14, 2016
@rliesenfeld rliesenfeld Fixed occurrence of ClassCastException from mocked interface or abstr…
…act method, when called from the Event Dispatch Thread; closes #318.
feb533c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment