Last change
on this file since 17090 was 17090, checked in by simon04, 3 years ago |
fix #18200 - Update to JMockit 1.49 (patch by taylor.smock, modified)
|
-
Property svn:eol-style
set to
native
|
File size:
728 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.testutils.mockers;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.gui.util.GuiHelper;
|
---|
5 |
|
---|
6 | import mockit.Invocation;
|
---|
7 | import mockit.Mock;
|
---|
8 | import mockit.MockUp;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * MockUp that, when applied, should cause calls to the EDT which would normally swallow generated
|
---|
12 | * AssertionErrors to instead re-raise them.
|
---|
13 | */
|
---|
14 | public class EDTAssertionMocker extends MockUp<GuiHelper> {
|
---|
15 | @Mock
|
---|
16 | static void handleEDTException(final Invocation invocation, final Throwable t) throws Throwable {
|
---|
17 | final Throwable cause = t.getCause();
|
---|
18 | if (cause instanceof AssertionError) {
|
---|
19 | throw (AssertionError) cause;
|
---|
20 | }
|
---|
21 |
|
---|
22 | invocation.proceed(t);
|
---|
23 | }
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.