|
24 | 24 | */
|
25 | 25 | package org.opengrok.indexer.index;
|
26 | 26 |
|
| 27 | +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
27 | 28 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
28 | 29 | import static org.junit.jupiter.api.Assertions.assertFalse;
|
29 | 30 | import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
|
40 | 41 | import java.nio.file.Files;
|
41 | 42 | import java.nio.file.Path;
|
42 | 43 | import java.nio.file.Paths;
|
| 44 | +import java.text.ParseException; |
43 | 45 | import java.util.ArrayList;
|
44 | 46 | import java.util.Arrays;
|
45 | 47 | import java.util.Collections;
|
@@ -177,17 +179,14 @@ void testRescanProjects() throws Exception {
|
177 | 179 | assertEquals(p1.getTabSize(), newP1.getTabSize(), "project tabsize");
|
178 | 180 | }
|
179 | 181 |
|
180 |
| - /** |
181 |
| - * Test of doIndexerExecution method, of class Indexer. |
182 |
| - */ |
183 | 182 | @Test
|
184 |
| - void testMain() { |
185 |
| - System.out.println("Generate index by using command line options"); |
| 183 | + void testParseOptions() throws ParseException { |
186 | 184 | RuntimeEnvironment env = RuntimeEnvironment.getInstance();
|
187 |
| - String[] argv = {"-S", "-P", "-H", "-Q", "off", "-s", |
188 |
| - repository.getSourceRoot(), "-d", repository.getDataRoot(), |
| 185 | + String[] argv = {"-S", "-P", "-H", "-Q", "off", |
| 186 | + "-s", repository.getSourceRoot(), |
| 187 | + "-d", repository.getDataRoot(), |
189 | 188 | "-v", "-c", env.getCtags()};
|
190 |
| - Indexer.main(argv); |
| 189 | + assertDoesNotThrow(() -> Indexer.parseOptions(argv)); |
191 | 190 | }
|
192 | 191 |
|
193 | 192 | private static class MyIndexChangeListener implements IndexChangedListener {
|
@@ -226,7 +225,6 @@ public void reset() {
|
226 | 225 | /**
|
227 | 226 | * Test indexing w.r.t. setIndexVersionedFilesOnly() setting,
|
228 | 227 | * i.e. if this option is set to true, index only files tracked by SCM.
|
229 |
| - * @throws Exception |
230 | 228 | */
|
231 | 229 | @Test
|
232 | 230 | void testIndexWithSetIndexVersionedFilesOnly() throws Exception {
|
|
0 commit comments