Changeset 8926 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2015-10-22T02:01:00+02:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
r7937 r8926 6 6 7 7 import java.io.FileInputStream; 8 import java.io.FileNotFoundException; 9 import java.io.IOException; 8 10 import java.io.InputStream; 9 11 … … 13 15 import org.openstreetmap.josm.data.osm.DataSet; 14 16 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 17 import org.openstreetmap.josm.io.IllegalDataException; 15 18 import org.openstreetmap.josm.io.OsmReader; 16 19 20 /** 21 * Unit tests of {@code UnconnectedWays} class. 22 */ 17 23 public class UnconnectedWaysTest { 18 24 19 UnconnectedWays bib;25 private UnconnectedWays bib; 20 26 21 27 /** 22 28 * Setup test. 29 * @throws Exception if the test cannot be initialized 23 30 */ 24 31 @Before … … 30 37 } 31 38 39 /** 40 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/6313">Bug #6313</a>. 41 * @throws IOException if any I/O error occurs 42 * @throws IllegalDataException if the OSM data cannot be parsed 43 * @throws FileNotFoundException if the data file cannot be found 44 */ 32 45 @Test 33 public void testTicket6313() throws Exception {46 public void testTicket6313() throws IOException, IllegalDataException, FileNotFoundException { 34 47 try (InputStream fis = new FileInputStream("data_nodist/UnconnectedWaysTest.osm")) { 35 48 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEngineTest.java
r8857 r8926 30 30 } 31 31 32 /** 33 * Test to parse an empty string. 34 * @throws ParseError if the template cannot be parsed 35 */ 32 36 @Test 33 37 public void testEmpty() throws ParseError { … … 36 40 } 37 41 42 /** 43 * Test to parse a variable. 44 * @throws ParseError if the template cannot be parsed 45 */ 38 46 @Test 39 47 public void testVariable() throws ParseError { … … 43 51 } 44 52 53 /** 54 * Test to parse a condition with whitespaces. 55 * @throws ParseError if the template cannot be parsed 56 */ 45 57 @Test 46 58 public void testConditionWhitespace() throws ParseError { … … 53 65 } 54 66 67 /** 68 * Test to parse a condition without whitespace. 69 * @throws ParseError if the template cannot be parsed 70 */ 55 71 @Test 56 72 public void testConditionNoWhitespace() throws ParseError { … … 63 79 } 64 80 65 private static Match compile(String expression) throws org.openstreetmap.josm.actions.search.SearchCompiler.ParseError {81 private static Match compile(String expression) throws SearchCompiler.ParseError { 66 82 return SearchCompiler.compile(expression); 67 83 } 68 84 69 @Test 70 public void testConditionSearchExpression() throws Exception { 85 /** 86 * Test to parse a search expression condition. 87 * @throws ParseError if the template cannot be parsed 88 * @throws SearchCompiler.ParseError if an error has been encountered while compiling 89 */ 90 @Test 91 public void testConditionSearchExpression() throws ParseError, SearchCompiler.ParseError { 71 92 TemplateParser parser = new TemplateParser("?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | '{admin_level}'}"); 72 93 Condition condition = new Condition(); … … 108 129 }; 109 130 110 @Test 111 public void testFilling() throws Exception { 131 /** 132 * Test to fill a template. 133 * @throws ParseError if the template cannot be parsed 134 */ 135 @Test 136 public void testFilling() throws ParseError { 112 137 TemplateParser parser = new TemplateParser("{name} u{unknown}u i{number}i"); 113 138 TemplateEntry entry = parser.parse(); … … 117 142 } 118 143 119 @Test 120 public void testFillingSearchExpression() throws Exception { 144 /** 145 * Test to parse a search expression. 146 * @throws ParseError if the template cannot be parsed 147 */ 148 @Test 149 public void testFillingSearchExpression() throws ParseError { 121 150 TemplateParser parser = new TemplateParser("?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | '{admin_level}'}"); 122 151 TemplateEntry templateEntry = parser.parse(); … … 134 163 } 135 164 136 @Test 137 public void testPrintAll() throws Exception { 165 /** 166 * Test to print all. 167 * @throws ParseError if the template cannot be parsed 168 */ 169 @Test 170 public void testPrintAll() throws ParseError { 138 171 TemplateParser parser = new TemplateParser("{special:everything}"); 139 172 TemplateEntry entry = parser.parse(); … … 143 176 } 144 177 145 @Test 146 public void testPrintMultiline() throws Exception { 178 /** 179 * Test to print on several lines. 180 * @throws ParseError if the template cannot be parsed 181 */ 182 @Test 183 public void testPrintMultiline() throws ParseError { 147 184 TemplateParser parser = new TemplateParser("{name}\\n{number}"); 148 185 TemplateEntry entry = parser.parse(); … … 152 189 } 153 190 154 @Test 155 public void testSpecialVariable() throws Exception { 191 /** 192 * Test to print special variables. 193 * @throws ParseError if the template cannot be parsed 194 */ 195 @Test 196 public void testSpecialVariable() throws ParseError { 156 197 TemplateParser parser = new TemplateParser("{name}u{special:localName}u{special:special:key}"); 157 198 TemplateEntry templateEntry = parser.parse(); … … 169 210 } 170 211 171 @Test 172 public void testSwitchContext() throws Exception { 212 /** 213 * Test to switch context. 214 * @throws ParseError if the template cannot be parsed 215 */ 216 @Test 217 public void testSwitchContext() throws ParseError { 173 218 TemplateParser parser = new TemplateParser("!{parent() type=parent2 '{name}'}"); 174 219 DatasetFactory ds = new DatasetFactory(); … … 208 253 parent1.addMember(new RelationMember("", child2)); 209 254 parent2.addMember(new RelationMember("", child2)); 210 211 255 212 256 StringBuilder sb = new StringBuilder();
Note:
See TracChangeset
for help on using the changeset viewer.