Changeset 19528 in josm for trunk/test


Ignore:
Timestamp:
2026-02-14T12:50:29+01:00 (2 days ago)
Author:
stoecker
Message:

see #24637 - patch by zkir (modified a bit) - allow to handle more than one style in caching

Location:
trunk/test
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java

    r19223 r19528  
    154154        nc.zoomTo(bounds);
    155155        visitor.render(dsCity2, true, bounds);
     156        ElemStyles elemStyles = MapPaintStyles.getStyles();
    156157
    157158        IdentityHashMap<StyleElementList, Integer> counter = new IdentityHashMap<>();
     
    159160        for (OsmPrimitive osm : dsCity2.allPrimitives()) {
    160161            // primitives, that have been rendered, should have the cache populated
    161             if (osm.getCachedStyle() != null) {
     162            if (osm.getCachedStyle(elemStyles) != null) {
    162163                noPrimitives++;
    163                 Pair<StyleElementList, Range> p = osm.getCachedStyle().getWithRange(nc.getDist100Pixel(), false);
     164                Pair<StyleElementList, Range> p = osm.getCachedStyle(elemStyles).getWithRange(nc.getDist100Pixel(), false);
    164165                StyleElementList sel = p.a;
    165166                assertNotNull(sel);
  • trunk/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java

    r19519 r19528  
    2424import org.openstreetmap.josm.data.osm.WayData;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
     
    367368            .withPrefabValues(OsmDataLayer.class,
    368369                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     370            .withPrefabValues(ElemStyles.class,
     371                new ElemStyles(), new ElemStyles())
    369372            .suppress(Warning.NONFINAL_FIELDS)
    370373            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java

    r19519 r19528  
    1616import org.openstreetmap.josm.data.osm.User;
    1717import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     18import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1819import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1920import org.openstreetmap.josm.testutils.annotations.I18n;
     
    103104            .withPrefabValues(OsmDataLayer.class,
    104105                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     106            .withPrefabValues(ElemStyles.class,
     107                new ElemStyles(), new ElemStyles())
    105108            .suppress(Warning.NONFINAL_FIELDS)
    106109            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java

    r19519 r19528  
    2222import org.openstreetmap.josm.data.osm.Way;
    2323import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     24import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2425import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2526import org.openstreetmap.josm.testutils.annotations.I18n;
     
    132133            .withPrefabValues(OsmDataLayer.class,
    133134                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     135            .withPrefabValues(ElemStyles.class,
     136                    new ElemStyles(), new ElemStyles())
    134137            .suppress(Warning.NONFINAL_FIELDS)
    135138            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java

    r19519 r19528  
    2424import org.openstreetmap.josm.data.osm.Way;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
     
    282283            .withPrefabValues(OsmDataLayer.class,
    283284                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     285            .withPrefabValues(ElemStyles.class,
     286                new ElemStyles(), new ElemStyles())
    284287            .suppress(Warning.NONFINAL_FIELDS)
    285288            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java

    r19519 r19528  
    1818import org.openstreetmap.josm.data.osm.User;
    1919import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     20import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2021import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2122import org.openstreetmap.josm.testutils.annotations.I18n;
     
    153154            .withPrefabValues(OsmDataLayer.class,
    154155                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     156            .withPrefabValues(ElemStyles.class,
     157                new ElemStyles(), new ElemStyles())
    155158            .suppress(Warning.NONFINAL_FIELDS)
    156159            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java

    r19519 r19528  
    1717import org.openstreetmap.josm.data.osm.User;
    1818import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     19import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1920import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2021import org.openstreetmap.josm.testutils.annotations.I18n;
     
    152153            .withPrefabValues(OsmDataLayer.class,
    153154                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     155            .withPrefabValues(ElemStyles.class,
     156                new ElemStyles(), new ElemStyles())
    154157            .suppress(Warning.NONFINAL_FIELDS)
    155158            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/CommandTest.java

    r19519 r19528  
    1515import org.openstreetmap.josm.gui.MainApplication;
    1616import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     17import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1718import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1819import org.openstreetmap.josm.testutils.annotations.I18n;
     
    4142            .withPrefabValues(OsmDataLayer.class,
    4243                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     44            .withPrefabValues(ElemStyles.class,
     45                new ElemStyles(), new ElemStyles())
    4346            .suppress(Warning.NONFINAL_FIELDS)
    4447            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java

    r19519 r19528  
    2424import org.openstreetmap.josm.data.osm.WaySegment;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
     
    383384            .withPrefabValues(OsmDataLayer.class,
    384385                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     386            .withPrefabValues(ElemStyles.class,
     387                new ElemStyles(), new ElemStyles())
    385388            .suppress(Warning.NONFINAL_FIELDS)
    386389            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java

    r19519 r19528  
    2424import org.openstreetmap.josm.data.projection.ProjectionRegistry;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
     
    269270            .withPrefabValues(OsmDataLayer.class,
    270271                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     272            .withPrefabValues(ElemStyles.class,
     273                new ElemStyles(), new ElemStyles())
    271274            .suppress(Warning.NONFINAL_FIELDS)
    272275            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java

    r19519 r19528  
    2525import org.openstreetmap.josm.data.osm.User;
    2626import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     27import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2728import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2829
     
    151152            .withPrefabValues(OsmDataLayer.class,
    152153                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     154            .withPrefabValues(ElemStyles.class,
     155                new ElemStyles(), new ElemStyles())
    153156            .withPrefabValues(Hash.class,
    154157                Storage.<OsmPrimitive>defaultHash(), Storage.<OsmPrimitive>defaultHash())
  • trunk/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java

    r19519 r19528  
    1616import org.openstreetmap.josm.data.osm.Way;
    1717import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     18import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1819import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1920
     
    127128            .withPrefabValues(OsmDataLayer.class,
    128129                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     130            .withPrefabValues(ElemStyles.class,
     131                    new ElemStyles(), new ElemStyles())
    129132            .suppress(Warning.NONFINAL_FIELDS)
    130133            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java

    r19519 r19528  
    2020import org.openstreetmap.josm.data.osm.User;
    2121import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     22import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2223import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2324import org.openstreetmap.josm.testutils.annotations.Projection;
     
    139140                .withPrefabValues(OsmDataLayer.class, new OsmDataLayer(new DataSet(), "1", null),
    140141                        new OsmDataLayer(new DataSet(), "2", null))
     142                .withPrefabValues(ElemStyles.class,
     143                        new ElemStyles(), new ElemStyles())
    141144                .suppress(Warning.NONFINAL_FIELDS).verify();
    142145    }
  • trunk/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java

    r19519 r19528  
    2020import org.openstreetmap.josm.data.osm.User;
    2121import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     22import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2223import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2324import org.openstreetmap.josm.testutils.annotations.Projection;
     
    142143            .withPrefabValues(OsmDataLayer.class,
    143144                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     145            .withPrefabValues(ElemStyles.class,
     146                new ElemStyles(), new ElemStyles())
    144147            .suppress(Warning.NONFINAL_FIELDS)
    145148            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java

    r19519 r19528  
    1717import org.openstreetmap.josm.data.osm.User;
    1818import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     19import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1920import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2021
     
    152153            .withPrefabValues(OsmDataLayer.class,
    153154                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     155            .withPrefabValues(ElemStyles.class,
     156                new ElemStyles(), new ElemStyles())
    154157            .suppress(Warning.NONFINAL_FIELDS)
    155158            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java

    r19519 r19528  
    2626import org.openstreetmap.josm.data.osm.User;
    2727import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     28import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2829import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2930import org.openstreetmap.josm.tools.bugreport.ReportedException;
     
    224225            .withPrefabValues(OsmDataLayer.class,
    225226                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     227            .withPrefabValues(ElemStyles.class,
     228                    new ElemStyles(), new ElemStyles())
    226229            .suppress(Warning.NONFINAL_FIELDS)
    227230            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java

    r19519 r19528  
    88import org.openstreetmap.josm.data.osm.User;
    99import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     10import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1011
    1112import nl.jqno.equalsverifier.EqualsVerifier;
     
    3132            .withPrefabValues(OsmDataLayer.class,
    3233                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     34            .withPrefabValues(ElemStyles.class,
     35                new ElemStyles(), new ElemStyles())
    3336            .suppress(Warning.NONFINAL_FIELDS)
    3437            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java

    r19519 r19528  
    1616import org.openstreetmap.josm.data.osm.Way;
    1717import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     18import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1819
    1920import nl.jqno.equalsverifier.EqualsVerifier;
     
    7475            .withPrefabValues(OsmDataLayer.class,
    7576                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     77            .withPrefabValues(ElemStyles.class,
     78                    new ElemStyles(), new ElemStyles())
    7679            .suppress(Warning.NONFINAL_FIELDS)
    7780            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java

    r19519 r19528  
    99import org.openstreetmap.josm.data.osm.User;
    1010import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     11import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1112
    1213import nl.jqno.equalsverifier.EqualsVerifier;
     
    3334            .withPrefabValues(OsmDataLayer.class,
    3435                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     36            .withPrefabValues(ElemStyles.class,
     37                    new ElemStyles(), new ElemStyles())
    3538            .suppress(Warning.NONFINAL_FIELDS)
    3639            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java

    r19519 r19528  
    1818import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
    1919import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     20import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2021
    2122import nl.jqno.equalsverifier.EqualsVerifier;
     
    9192            .withPrefabValues(OsmDataLayer.class,
    9293                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     94            .withPrefabValues(ElemStyles.class,
     95                    new ElemStyles(), new ElemStyles())
    9396            .suppress(Warning.NONFINAL_FIELDS)
    9497            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java

    r19519 r19528  
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
     
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java

    r19519 r19528  
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
     
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java

    r19519 r19528  
    1010import org.openstreetmap.josm.data.osm.User;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
     
    3738            .withPrefabValues(OsmDataLayer.class,
    3839                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     40            .withPrefabValues(ElemStyles.class,
     41                    new ElemStyles(), new ElemStyles())
    3942            .suppress(Warning.NONFINAL_FIELDS)
    4043            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java

    r19519 r19528  
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
     
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java

    r19519 r19528  
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
     
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
  • trunk/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java

    r19519 r19528  
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
     
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
Note: See TracChangeset for help on using the changeset viewer.