Changeset 7365 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2014-08-04T00:34:17+02:00 (10 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r7356 r7365 22 22 /** 23 23 * Returns the path to test data root directory. 24 * @return path to test data root directory 24 25 */ 25 26 public static String getTestDataRoot() { … … 30 31 } 31 32 return testDataRoot.endsWith("/") ? testDataRoot : testDataRoot + "/"; 33 } 34 35 /** 36 * Gets path to test data directory for given ticket id. 37 * @param ticketid Ticket numeric identifier 38 * @return path to test data directory for given ticket id 39 */ 40 public static String getRegressionDataDir(int ticketid) { 41 return TestUtils.getTestDataRoot() + "/regress/" + ticketid; 42 } 43 44 /** 45 * Gets path to given file in test data directory for given ticket id. 46 * @param ticketid Ticket numeric identifier 47 * @param filename File name 48 * @return path to given file in test data directory for given ticket id 49 */ 50 public static String getRegressionDataFile(int ticketid, String filename) { 51 return getRegressionDataDir(ticketid) + '/' + filename; 32 52 } 33 53 -
trunk/test/unit/org/openstreetmap/josm/gui/DefaultNameFormatterTest.java
r7356 r7365 55 55 Comparator<Relation> comparator = DefaultNameFormatter.getInstance().getRelationComparator(); 56 56 57 try (InputStream is = new FileInputStream(TestUtils.get TestDataRoot() + "regress/9632/data.osm.zip")) {57 try (InputStream is = new FileInputStream(TestUtils.getRegressionDataFile(9632, "data.osm.zip"))) { 58 58 DataSet ds = OsmReader.parseDataSet(Compression.ZIP.getUncompressedInputStream(is), null); 59 59 -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/TaggingPresetReaderTest.java
r7081 r7365 32 32 33 33 /** 34 * Gets path to test data directory for given ticketid.35 * @param ticketid36 * @return37 */38 protected static String getRegressionDataDir(int ticketid) {39 return TestUtils.getTestDataRoot() + "/regress/" + ticketid;40 }41 42 /**43 * Gets path to given file in test data directory for given ticketid.44 * @param ticketid45 * @param filename46 * @return47 */48 protected static String getRegressionDataFile(int ticketid, String filename) {49 return getRegressionDataDir(ticketid) + '/' + filename;50 }51 52 /**53 34 * #8954 - last checkbox in the preset is not added 54 35 */ 55 36 @Test 56 37 public void test8954() throws SAXException, IOException { 57 String presetfile = getRegressionDataFile(8954, "preset.xml");38 String presetfile = TestUtils.getRegressionDataFile(8954, "preset.xml"); 58 39 final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(presetfile, false); 59 40 Assert.assertEquals("Number of preset items", 1, presets.size()); -
trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java
r7134 r7365 23 23 @Test 24 24 public void testTicket9984() throws IOException { 25 File file = new File(TestUtils.get TestDataRoot()+"regress/9984/tile.png");25 File file = new File(TestUtils.getRegressionDataFile(9984, "tile.png")); 26 26 assertThat(ImageProvider.read(file, true, true).getTransparency(), is(Transparency.TRANSLUCENT)); 27 27 assertThat(ImageProvider.read(file, false, true).getTransparency(), is(Transparency.TRANSLUCENT)); … … 36 36 @Test 37 37 public void testTicket10030() throws IOException { 38 File file = new File(TestUtils.get TestDataRoot()+"regress/10030/tile.jpg");38 File file = new File(TestUtils.getRegressionDataFile(10030, "tile.jpg")); 39 39 ImageProvider.read(file, true, true); 40 40 }
Note:
See TracChangeset
for help on using the changeset viewer.