source: josm/trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java@ 13079

Last change on this file since 13079 was 12989, checked in by bastiK, 7 years ago

closes #15410 - update tests + minor fixes

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data;
3
4import static org.junit.Assert.assertEquals;
5
6import org.junit.Rule;
7import org.junit.Test;
8import org.openstreetmap.josm.Main;
9import org.openstreetmap.josm.testutils.JOSMTestRules;
10
11import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
12
13/**
14 * Unit tests of {@link Preferences}.
15 */
16public class PreferencesTest {
17
18 /**
19 * Setup test.
20 */
21 @Rule
22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
23 public JOSMTestRules test = new JOSMTestRules().platform().preferences().fakeAPI();
24
25 /**
26 * Test {@link Preferences#toXML}.
27 */
28 @Test
29 public void testToXml() {
30 assertEquals(String.format(
31 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>%n" +
32 "<preferences xmlns='http://josm.openstreetmap.de/preferences-1.0' version='%d'>%n" +
33 " <tag key='osm-server.url' value='http://fake.xxx/api'/>%n" +
34 "</preferences>%n", Version.getInstance().getVersion()),
35 Main.pref.toXML(true));
36 }
37}
Note: See TracBrowser for help on using the repository browser.