Changeset 15946 in josm for trunk/test/unit
- Timestamp:
- 2020-02-27T19:52:40+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelperTest.java
r15927 r15946 37 37 import org.openstreetmap.josm.testutils.JOSMTestRules; 38 38 import org.openstreetmap.josm.testutils.mockers.WindowMocker; 39 import org.openstreetmap.josm.tools.RightAndLefthandTraffic; 39 40 40 41 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 50 51 @Rule 51 52 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 52 public JOSMTestRules test = new JOSMTestRules() ;53 public JOSMTestRules test = new JOSMTestRules().territories().projection(); 53 54 54 55 private static TagEditHelper newTagEditHelper() { … … 124 125 assertNotNull(val); 125 126 } 127 128 /** 129 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18798>#18798</a> 130 * 131 * @throws InvocationTargetException Check logs -- if caused by NPE, a 132 * regression probably occurred. 133 * @throws IllegalArgumentException Check source code 134 * @throws IllegalAccessException Check source code 135 * @throws NoSuchFieldException Check source code 136 * @throws SecurityException Probably shouldn't happen for tests 137 * @throws NoSuchMethodException Check source code 138 */ 139 @Test 140 public void testTicket18798() throws NoSuchMethodException, SecurityException, IllegalAccessException, 141 IllegalArgumentException, InvocationTargetException, NoSuchFieldException { 142 TestUtils.assumeWorkingJMockit(); 143 if (GraphicsEnvironment.isHeadless()) { 144 new WindowMocker(); 145 } 146 RightAndLefthandTraffic.initialize(); 147 MapCSSStyleSource css = new MapCSSStyleSource( 148 "node:righthandtraffic[junction=roundabout] { text: tr(\"Roundabout node\"); }"); 149 css.loadStyleSource(); 150 MapPaintStyles.addStyle(css); 151 Node node = new Node(LatLon.NORTH_POLE); 152 DataSet ds = new DataSet(node); 153 OsmDataManager.getInstance().setActiveDataSet(ds); 154 MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, "Test Layer", null)); 155 TagEditHelper helper = newTagEditHelper(); 156 Field sel = TagEditHelper.class.getDeclaredField("sel"); 157 sel.set(helper, Collections.singletonList(node)); 158 AddTagsDialog addTagsDialog = helper.getAddTagsDialog(); 159 Method findIcon = TagEditHelper.AbstractTagsDialog.class.getDeclaredMethod("findIcon", String.class, 160 String.class); 161 findIcon.setAccessible(true); 162 Object val = findIcon.invoke(addTagsDialog, "junction", "roundabout"); 163 assertNotNull(val); 164 } 126 165 }
Note:
See TracChangeset
for help on using the changeset viewer.