source: josm/trunk/test/unit/org/openstreetmap/josm/testutils/mockers/WindowMocker.java@ 17360

Last change on this file since 17360 was 14081, checked in by Don-vip, 6 years ago

see #16010 - Ignore tests using JMockit on Java 11+, workaround to https://github.com/jmockit/jmockit1/issues/534

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.testutils.mockers;
3
4import java.awt.Frame;
5import java.awt.GraphicsConfiguration;
6import java.awt.Window;
7
8import mockit.Invocation;
9import mockit.Mock;
10import mockit.MockUp;
11
12/**
13 * MockUp for a {@link Window} which simply (and naively) makes its constructor(s) a no-op. This has
14 * the advantage of removing the isHeadless check. Though if course it also leaves you with
15 * uninitialized objects, and so of course they don't *necessarily* work properly. But often they
16 * work *just enough* to behave how a test needs them to. Exercise left to the reader to discover
17 * the limits here.
18 */
19public class WindowMocker extends MockUp<Window> {
20 @Mock
21 private void $init(final Invocation invocation) {
22 }
23
24 @Mock
25 private void $init(final Invocation invocation, final Window window) {
26 }
27
28 @Mock
29 private void $init(final Invocation invocation, final Frame frame) {
30 }
31
32 @Mock
33 private void $init(final Invocation invocation, final GraphicsConfiguration gc) {
34 }
35
36 @Mock
37 private void $init(final Invocation invocation, final Window window, final GraphicsConfiguration gc) {
38 }
39}
Note: See TracBrowser for help on using the repository browser.