Ignore:
Timestamp:
2018-10-14T17:30:28+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #16841 - MergeLayerActionTest, DownloadWmsAlongTrackActionTest: fix for non-headless mode by properly mocking dialogs (patch by ris)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/testutils/mockers/JOptionPaneSimpleMocker.java

    r14052 r14332  
    134134    }
    135135
     136    /**
     137     * Target for overriding, similar to {@link #getMockResultForMessage} except with the implication it
     138     * will only be invoked once per dialog display, therefore ideal opportunity to perform any mutating
     139     * actions, e.g. making a selection on a widget.
     140     * @param message message
     141     */
     142    protected void act(final Object message) {
     143        // Override in sub-classes
     144    }
     145
    136146    protected Object[] getInvocationLogEntry(
    137147        final Object message,
     
    162172    ) {
    163173        try {
     174            this.act(message);
    164175            final Object result = this.getMockResultForMessage(message);
    165176            if (selectionValues == null) {
     
    216227    ) {
    217228        try {
     229            this.act(message);
    218230            // why look up a "result" for a message dialog which can only have one possible result? it's
    219231            // a good opportunity to assert its contents
     
    263275    ) {
    264276        try {
     277            this.act(message);
    265278            final Object result = this.getMockResultForMessage(message);
    266279            if (!(result instanceof Integer && Ints.contains(optionTypePermittedResults.get(optionType), (int) result))) {
Note: See TracChangeset for help on using the changeset viewer.