Changeset 12826 in josm for trunk/test


Ignore:
Timestamp:
2017-09-12T00:58:32+02:00 (4 years ago)
Author:
Don-vip
Message:

see #15229 - see #15182 - remove GUI references from PreferencesUtils

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  
    1313import java.util.Collections;
    1414
    15 import org.junit.Before;
    1615import org.junit.Rule;
    1716import org.junit.Test;
     
    2423
    2524import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    26 import net.trajano.commons.testing.UtilityClassTestUtil;
    2725
    2826/**
     
    3735    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3836    public JOSMTestRules test = new JOSMTestRules().preferences();
    39 
    40     /**
    41      * Setup test.
    42      */
    43     @Before
    44     public void setUp() {
    45         CustomConfigurator.resetLog();
    46     }
    47 
    48     /**
    49      * Test method for {@link CustomConfigurator#log}.
    50      */
    51     @Test
    52     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     }
    6137
    6238    /**
     
    10682        assertTrue(Main.pref.getCollection("test").isEmpty());
    10783        CustomConfigurator.readXML(TestUtils.getTestDataRoot() + "customconfigurator", "append.xml");
    108         String log = CustomConfigurator.getLog();
     84        String log = PreferencesUtils.getLog();
    10985        assertFalse(log, log.contains("Error"));
    11086        assertFalse(Main.pref.getCollection("test").isEmpty());
     
    11793        assertEquals(1, pref.getCollection("lorem_ipsum").size());
    11894        CustomConfigurator.readXML(new File(TestUtils.getTestDataRoot() + "customconfigurator", "replace.xml"), pref);
    119         log = CustomConfigurator.getLog();
     95        log = PreferencesUtils.getLog();
    12096        assertFalse(log, log.contains("Error"));
    12197        assertEquals(9, pref.getCollection("lorem_ipsum").size());
    12298    }
    123 
    124     /**
    125      * Tests that {@code PreferencesUtils} satisfies utility class criterias.
    126      * @throws ReflectiveOperationException if an error occurs
    127      */
    128     @Test
    129     public void testUtilityClass() throws ReflectiveOperationException {
    130         UtilityClassTestUtil.assertUtilityClassWellDefined(PreferencesUtils.class);
    131     }
    13299}
Note: See TracChangeset for help on using the changeset viewer.