Changeset 7366 in josm
- Timestamp:
- 2014-08-04T19:00:18+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r7085 r7366 5 5 6 6 import java.io.File; 7 import java.nio.file.Paths; 7 8 import java.text.MessageFormat; 8 import java.util.logging.Logger;9 9 10 10 import org.openstreetmap.josm.data.projection.Projections; … … 12 12 import org.openstreetmap.josm.tools.I18n; 13 13 14 /** 15 * Fixture to define a proper and safe environment before running tests. 16 */ 14 17 public class JOSMFixture { 15 static private final Logger logger = Logger.getLogger(JOSMFixture.class.getName());16 18 19 /** 20 * Returns a new test fixture initialized to "unit" home. 21 * @return A new test fixture for unit tests 22 */ 17 23 static public JOSMFixture createUnitTestFixture() { 18 24 return new JOSMFixture("test/config/unit-josm.home"); 19 25 } 20 26 27 /** 28 * Returns a new test fixture initialized to "functional" home. 29 * @return A new test fixture for functional tests 30 */ 21 31 static public JOSMFixture createFunctionalTestFixture() { 22 32 return new JOSMFixture("test/config/functional-josm.home"); 23 33 } 24 34 35 /** 36 * Returns a new test fixture initialized to "performance" home. 37 * @return A new test fixture for performance tests 38 */ 25 39 static public JOSMFixture createPerformanceTestFixture() { 26 40 return new JOSMFixture("test/config/performance-josm.home"); … … 29 43 private final String josmHome; 30 44 45 /** 46 * Constructs a new text fixture initialized to a given josm home. 47 * @param josmHome The user home where preferences are to be read/written 48 */ 31 49 public JOSMFixture(String josmHome) { 32 50 this.josmHome = josmHome; 33 51 } 34 52 53 /** 54 * Initializes the test fixture. 55 */ 35 56 public void init() { 36 57 … … 42 63 File f = new File(josmHome); 43 64 if (! f.exists() || ! f.canRead()) { 44 fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing or not readable.", "josm.home", josmHome)); 65 fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing ({2}) or not readable ({3}). Current directory is ''{4}''.", 66 "josm.home", josmHome, f.exists(), f.canRead(), Paths.get("").toAbsolutePath())); 45 67 } 46 68 }
Note:
See TracChangeset
for help on using the changeset viewer.