Changeset 9533 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-01-18T23:47:48+01:00 (9 years ago)
Author:
Don-vip
Message:

fix CustomConfigurator unit test - avoid messing up preferences file (that makes all following unit tests fail)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/CustomConfiguratorTest.java

    r9524 r9533  
    103103        CustomConfigurator.readXML(TestUtils.getTestDataRoot() + "customconfigurator", "append.xml");
    104104        String log = CustomConfigurator.getLog();
    105         System.out.println(log);
    106         assertFalse(log.contains("Error"));
     105        assertFalse(log, log.contains("Error"));
    107106        assertFalse(Main.pref.getCollection("test").isEmpty());
    108107
    109         // Test 1 - read(file, pref) + replace
     108        // Test 2 - read(file, pref) + replace
    110109        Preferences pref = new Preferences();
     110        // avoid messing up preferences file (that makes all following unit tests fail)
     111        pref.enableSaveOnPut(false);
    111112        pref.putCollection("lorem_ipsum", Arrays.asList("only 1 string"));
    112113        assertEquals(1, pref.getCollection("lorem_ipsum").size());
    113114        CustomConfigurator.readXML(new File(TestUtils.getTestDataRoot() + "customconfigurator", "replace.xml"), pref);
    114115        log = CustomConfigurator.getLog();
    115         System.out.println(log);
    116         assertFalse(log.contains("Error"));
     116        assertFalse(log, log.contains("Error"));
    117117        assertEquals(9, pref.getCollection("lorem_ipsum").size());
    118118    }
Note: See TracChangeset for help on using the changeset viewer.