Changeset 17275 in josm for trunk/test/unit/org/openstreetmap/josm/data/preferences
- Timestamp:
- 2020-10-28T20:41:00+01:00 (5 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/preferences
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java
r14119 r17275 2 2 package org.openstreetmap.josm.data.preferences; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. Rule;7 import org.junit.Test; 6 import org.junit.jupiter.api.extension.RegisterExtension; 7 import org.junit.jupiter.api.Test; 8 8 import org.openstreetmap.josm.spi.preferences.Config; 9 9 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 14 14 * Unit tests of {@link JosmUrls} class. 15 15 */ 16 publicclass JosmUrlsTest {16 class JosmUrlsTest { 17 17 18 18 /** 19 19 * Setup test. 20 20 */ 21 @R ule21 @RegisterExtension 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 23 public JOSMTestRules test = new JOSMTestRules().devAPI(); … … 27 27 */ 28 28 @Test 29 publicvoid testGetBaseUserUrl() {29 void testGetBaseUserUrl() { 30 30 assertEquals("https://api06.dev.openstreetmap.org/user", Config.getUrls().getBaseUserUrl()); 31 31 } -
trunk/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java
r17119 r17275 2 2 package org.openstreetmap.josm.data.preferences; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.awt.Color; … … 11 11 import javax.swing.UIManager; 12 12 13 import org.junit. Before;14 import org.junit. Rule;15 import org.junit. Test;13 import org.junit.jupiter.api.BeforeEach; 14 import org.junit.jupiter.api.Test; 15 import org.junit.jupiter.api.extension.RegisterExtension; 16 16 import org.openstreetmap.josm.data.Preferences; 17 17 import org.openstreetmap.josm.spi.preferences.Config; … … 24 24 * @author Michael Zangl 25 25 */ 26 publicclass NamedColorPropertyTest {26 class NamedColorPropertyTest { 27 27 /** 28 28 * This is a preference test. 29 29 */ 30 @R ule30 @RegisterExtension 31 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 32 public JOSMTestRules test = new JOSMTestRules().preferences(); … … 36 36 * Set up test case 37 37 */ 38 @Before 38 @BeforeEach 39 39 public void createTestProperty() { 40 40 base = new NamedColorProperty("test", Color.RED); … … 45 45 */ 46 46 @Test 47 publicvoid testGet() {47 void testGet() { 48 48 assertEquals(Color.RED, base.get()); 49 49 … … 65 65 */ 66 66 @Test 67 publicvoid testPut() {67 void testPut() { 68 68 assertEquals(Color.RED, base.get()); 69 69 … … 80 80 */ 81 81 @Test 82 publicvoid testColorAlpha() {82 void testColorAlpha() { 83 83 assertEquals(0x12, new NamedColorProperty("foo", new Color(0x12345678, true)).get().getAlpha()); 84 84 assertTrue(Preferences.main().putList("clr.general.bar", Arrays.asList("#34567812", "general", "", "bar"))); … … 90 90 */ 91 91 @Test 92 publicvoid testColorNameAlpha() {92 void testColorNameAlpha() { 93 93 assertEquals(0x12, new NamedColorProperty("foo", new Color(0x12345678, true)).get().getAlpha()); 94 94 } … … 98 98 */ 99 99 @Test 100 publicvoid testGetChildColor() {100 void testGetChildColor() { 101 101 AbstractProperty<Color> child = base.getChildColor("test2"); 102 102 -
trunk/test/unit/org/openstreetmap/josm/data/preferences/PreferencesWriterTest.java
r12884 r17275 2 2 package org.openstreetmap.josm.data.preferences; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import java.io.IOException; … … 13 13 import java.util.TreeMap; 14 14 15 import org.junit.Test; 15 import org.junit.jupiter.api.Test; 16 16 import org.openstreetmap.josm.data.Version; 17 17 import org.openstreetmap.josm.spi.preferences.Setting; … … 25 25 * Unit tests for class {@link PreferencesWriter}. 26 26 */ 27 publicclass PreferencesWriterTest {27 class PreferencesWriterTest { 28 28 29 29 private static <T extends AbstractSetting<?>> T setting(T s, long time) { … … 37 37 */ 38 38 @Test 39 publicvoid testListList() throws IOException {39 void testListList() throws IOException { 40 40 try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) { 41 41 long time = System.currentTimeMillis() / 1000; … … 56 56 */ 57 57 @Test 58 publicvoid testList() throws IOException {58 void testList() throws IOException { 59 59 try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) { 60 60 long time = System.currentTimeMillis() / 1000; … … 73 73 */ 74 74 @Test 75 publicvoid testMapList() throws IOException {75 void testMapList() throws IOException { 76 76 try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) { 77 77 long time = System.currentTimeMillis() / 1000; … … 94 94 */ 95 95 @Test 96 publicvoid testString() throws IOException {96 void testString() throws IOException { 97 97 try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) { 98 98 long time = System.currentTimeMillis() / 1000; … … 109 109 */ 110 110 @Test 111 publicvoid testWrite() throws IOException {111 void testWrite() throws IOException { 112 112 try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) { 113 113 long time = System.currentTimeMillis() / 1000; … … 132 132 */ 133 133 @Test 134 publicvoid testNullValue() throws IOException {134 void testNullValue() throws IOException { 135 135 long time = System.currentTimeMillis() / 1000; 136 136 // CHECKSTYLE.OFF: LineLength -
trunk/test/unit/org/openstreetmap/josm/data/preferences/StrokePropertyTest.java
r15775 r17275 2 2 package org.openstreetmap.josm.data.preferences; 3 3 4 import static org.junit. Assert.assertArrayEquals;5 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertArrayEquals; 5 import static org.junit.jupiter.api.Assertions.assertEquals; 6 6 7 7 import java.awt.BasicStroke; 8 8 9 import org.junit. Rule;10 import org.junit.Test; 9 import org.junit.jupiter.api.extension.RegisterExtension; 10 import org.junit.jupiter.api.Test; 11 11 import org.openstreetmap.josm.spi.preferences.Config; 12 12 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 18 18 * @author Michael Zangl 19 19 */ 20 publicclass StrokePropertyTest {20 class StrokePropertyTest { 21 21 /** 22 22 * This is a preference test 23 23 */ 24 @R ule24 @RegisterExtension 25 25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 26 26 public JOSMTestRules test = new JOSMTestRules().preferences(); … … 30 30 */ 31 31 @Test 32 publicvoid testGetValue() {32 void testGetValue() { 33 33 StrokeProperty property = new StrokeProperty("x", "1"); 34 34 … … 75 75 */ 76 76 @Test 77 publicvoid testPutValue() {77 void testPutValue() { 78 78 StrokeProperty property = new StrokeProperty("x", new BasicStroke(12)); 79 79 BasicStroke bs = property.get();
Note:
See TracChangeset
for help on using the changeset viewer.