Changeset 12826 in josm for trunk/test/unit
- Timestamp:
- 2017-09-12T00:58:32+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java
r12635 r12826 13 13 import java.util.Collections; 14 14 15 import org.junit.Before;16 15 import org.junit.Rule; 17 16 import org.junit.Test; … … 24 23 25 24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 26 import net.trajano.commons.testing.UtilityClassTestUtil;27 25 28 26 /** … … 37 35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 38 36 public JOSMTestRules test = new JOSMTestRules().preferences(); 39 40 /**41 * Setup test.42 */43 @Before44 public void setUp() {45 CustomConfigurator.resetLog();46 }47 48 /**49 * Test method for {@link CustomConfigurator#log}.50 */51 @Test52 public void testLog() {53 assertEquals("", CustomConfigurator.getLog());54 CustomConfigurator.log("test");55 assertEquals("test\n", CustomConfigurator.getLog());56 CustomConfigurator.log("%d\n", 100);57 assertEquals("test\n100\n", CustomConfigurator.getLog());58 CustomConfigurator.log("test");59 assertEquals("test\n100\ntest\n", CustomConfigurator.getLog());60 }61 37 62 38 /** … … 106 82 assertTrue(Main.pref.getCollection("test").isEmpty()); 107 83 CustomConfigurator.readXML(TestUtils.getTestDataRoot() + "customconfigurator", "append.xml"); 108 String log = CustomConfigurator.getLog();84 String log = PreferencesUtils.getLog(); 109 85 assertFalse(log, log.contains("Error")); 110 86 assertFalse(Main.pref.getCollection("test").isEmpty()); … … 117 93 assertEquals(1, pref.getCollection("lorem_ipsum").size()); 118 94 CustomConfigurator.readXML(new File(TestUtils.getTestDataRoot() + "customconfigurator", "replace.xml"), pref); 119 log = CustomConfigurator.getLog();95 log = PreferencesUtils.getLog(); 120 96 assertFalse(log, log.contains("Error")); 121 97 assertEquals(9, pref.getCollection("lorem_ipsum").size()); 122 98 } 123 124 /**125 * Tests that {@code PreferencesUtils} satisfies utility class criterias.126 * @throws ReflectiveOperationException if an error occurs127 */128 @Test129 public void testUtilityClass() throws ReflectiveOperationException {130 UtilityClassTestUtil.assertUtilityClassWellDefined(PreferencesUtils.class);131 }132 99 }
Note:
See TracChangeset
for help on using the changeset viewer.