Changeset 18723 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2023-05-10T19:18:54+02:00 (18 months ago)
Author:
taylor.smock
Message:

Fix #22432, see #22941: Start migrating from javax to jakarta

Parsson was split out from the JSONP repository in 2021 (see
https://github.com/jakartaee/jsonp-api/issues/285 ). It is the default provider,
and will "just work" without additional configuration.

Many plugins use javax.json, so the scheduled removal of the javax.json
dependencies is set to milestone:"24.12" (see #22941).

Changes between javax.json and jakarta.json 2.0:

  • Rename of javax.json to jakarta.json
  • Some additional bug fixes

This will enable us to move easily to jakarta.json 2.1 in the future.
The changes of note with 2.1 includes:

  • Better handling of duplicated keys
  • Additional APIs around primitive types
  • API to get current event from JsonParser

We cannot currently move to jakarta.json 2.1 since it requires Java 11+.

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/ExpressionTest.java

    r17867 r18723  
    55
    66
    7 import javax.json.Json;
    8 import javax.json.JsonValue;
     7import jakarta.json.Json;
     8import jakarta.json.JsonValue;
    99
    1010import nl.jqno.equalsverifier.EqualsVerifier;
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/LayersTest.java

    r18578 r18723  
    1010import java.util.Locale;
    1111
    12 import javax.json.Json;
    13 import javax.json.JsonObject;
    14 import javax.json.JsonValue;
     12import jakarta.json.Json;
     13import jakarta.json.JsonObject;
     14import jakarta.json.JsonValue;
    1515
    1616import nl.jqno.equalsverifier.EqualsVerifier;
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java

    r18011 r18723  
    2929
    3030import javax.imageio.ImageIO;
    31 import javax.json.Json;
    32 import javax.json.JsonObject;
    33 import javax.json.JsonObjectBuilder;
    34 import javax.json.JsonReader;
    35 import javax.json.JsonStructure;
    36 import javax.json.JsonValue;
     31import jakarta.json.Json;
     32import jakarta.json.JsonObject;
     33import jakarta.json.JsonObjectBuilder;
     34import jakarta.json.JsonReader;
     35import jakarta.json.JsonStructure;
     36import jakarta.json.JsonValue;
    3737
    3838import org.awaitility.Awaitility;
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/SourceTest.java

    r17867 r18723  
    1313import java.util.stream.Stream;
    1414
    15 import javax.json.Json;
    16 import javax.json.JsonObject;
    17 import javax.json.JsonValue;
     15import jakarta.json.Json;
     16import jakarta.json.JsonObject;
     17import jakarta.json.JsonValue;
    1818
    1919import org.openstreetmap.josm.data.Bounds;
  • trunk/test/unit/org/openstreetmap/josm/data/validation/ValidatorCLITest.java

    r18718 r18723  
    2525import java.util.stream.Stream;
    2626
    27 import javax.json.Json;
    28 import javax.json.JsonObject;
    29 import javax.json.JsonReader;
     27import jakarta.json.Json;
     28import jakarta.json.JsonObject;
     29import jakarta.json.JsonReader;
    3030
    3131import mockit.Mock;
  • trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java

    r18658 r18723  
    1717import java.util.concurrent.atomic.AtomicBoolean;
    1818
    19 import javax.json.JsonException;
     19import jakarta.json.JsonException;
    2020
    2121import org.junit.jupiter.api.Test;
     
    260260     * The JSON parser throws {@link RuntimeException}s, specifically
    261261     * <ul>
    262      *     <li>{@link javax.json.JsonException}</li>
    263      *     <li>{@link javax.json.stream.JsonParsingException}, extends {@link javax.json.JsonException}</li>
    264      *     <li>{@link javax.json.stream.JsonGenerationException}, extends {@link javax.json.JsonException}
     262     *     <li>{@link jakarta.json.JsonException}</li>
     263     *     <li>{@link jakarta.json.stream.JsonParsingException}, extends {@link jakarta.json.JsonException}</li>
     264     *     <li>{@link jakarta.json.stream.JsonGenerationException}, extends {@link jakarta.json.JsonException}
    265265     *         (which we don't care about when we are <em>parsing</em> JSON)</li>
    266266     * </ul>
     
    300300        // Check that a generic parsing error is properly reported
    301301        ide = assertThrows(IllegalDataException.class, () -> OsmJsonReader.parseDataSet(bais, NullProgressMonitor.INSTANCE));
    302         assertEquals("javax.json.stream.JsonParsingException: Invalid token=COMMA at (line no=1, column no=8, offset=7). " +
     302        assertEquals("jakarta.json.stream.JsonParsingException: Invalid token=COMMA at (line no=1, column no=8, offset=7). " +
    303303                "Expected tokens are: [COLON]", ExceptionUtil.explainException(ide));
    304304        bais.reset();
  • trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java

    r17275 r18723  
    88import java.net.URL;
    99
    10 import javax.json.Json;
     10import jakarta.json.Json;
    1111
    1212import org.junit.jupiter.api.Test;
Note: See TracChangeset for help on using the changeset viewer.