Changeset 12851 in josm for trunk/test


Ignore:
Timestamp:
2017-09-14T01:59:34+02:00 (2 years ago)
Author:
bastiK
Message:

see #15229 - extract "struct" handling from Preference to StructUtils

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/ImageryInfoTest.java

    r10945 r12851  
    1212import org.junit.Rule;
    1313import org.junit.Test;
    14 import org.openstreetmap.josm.data.Preferences;
     14import org.openstreetmap.josm.data.StructUtils;
    1515import org.openstreetmap.josm.testutils.JOSMTestRules;
    1616import org.openstreetmap.josm.tools.MultiMap;
     
    5656
    5757    /**
    58      * Tests the {@linkplain Preferences#serializeStruct(Object, Class) serialization} of {@link ImageryInfo.ImageryPreferenceEntry}
     58     * Tests the {@linkplain StructUtils#serializeStruct(Object, Class) serialization} of {@link ImageryInfo.ImageryPreferenceEntry}
    5959     */
    6060    @Test
     
    6464        info.noTileHeaders.put("ETag", "foo");
    6565        info.noTileHeaders.put("ETag", "bar");
    66         final Map<String, String> map = Preferences.serializeStruct(info, ImageryInfo.ImageryPreferenceEntry.class);
     66        final Map<String, String> map = StructUtils.serializeStruct(info, ImageryInfo.ImageryPreferenceEntry.class);
    6767        assertEquals("{noTileHeaders={\"ETag\":[\"foo\",\"bar\"]}}", map.toString());
    6868    }
    6969
    7070    /**
    71      * Tests the {@linkplain Preferences#deserializeStruct(Map, Class)} deserialization} of {@link ImageryInfo.ImageryPreferenceEntry}
     71     * Tests the {@linkplain StructUtils#deserializeStruct(Map, Class)} deserialization} of {@link ImageryInfo.ImageryPreferenceEntry}
    7272     */
    7373    @Test
    7474    public void testDeserializeStruct() {
    75         final ImageryInfo.ImageryPreferenceEntry info = Preferences.deserializeStruct(
     75        final ImageryInfo.ImageryPreferenceEntry info = StructUtils.deserializeStruct(
    7676                Collections.singletonMap("noTileHeaders", "{\"ETag\":[\"foo\",\"bar\"]}"), ImageryInfo.ImageryPreferenceEntry.class);
    7777        MultiMap<String, String> expect = new MultiMap<>();
     
    8484
    8585    /**
    86      * Tests the {@linkplain Preferences#deserializeStruct(Map, Class)} deserialization} of legacy {@link ImageryInfo.ImageryPreferenceEntry}
     86     * Tests the {@linkplain StructUtils#deserializeStruct(Map, Class)} deserialization} of legacy {@link ImageryInfo.ImageryPreferenceEntry}
    8787     */
    8888    @Test
    8989    public void testDeserializeStructTicket12474() {
    90         final ImageryInfo.ImageryPreferenceEntry info = Preferences.deserializeStruct(
     90        final ImageryInfo.ImageryPreferenceEntry info = StructUtils.deserializeStruct(
    9191                Collections.singletonMap("noTileHeaders", "{\"ETag\":\"foo-and-bar\"}"), ImageryInfo.ImageryPreferenceEntry.class);
    9292        final Set<String> eTag = info.noTileHeaders.get("ETag");
Note: See TracChangeset for help on using the changeset viewer.