Final fix for symbol indexer config
This commit is contained in:
@@ -53,7 +53,7 @@ public class SpringIndexerMultiProjectTest {
|
||||
@Before
|
||||
public void setup() throws Exception {
|
||||
harness.intialize(null);
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanXml(false).build()).get(5, TimeUnit.SECONDS);
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanXml(false).build());
|
||||
|
||||
projectUri1 = UriUtil.toUri(new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-large-multiproject-1/").toURI())).toString();
|
||||
projectFinder.find(new TextDocumentIdentifier(projectUri1)).get();
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SpringIndexerTest {
|
||||
@Before
|
||||
public void setup() throws Exception {
|
||||
harness.intialize(null);
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanXml(false).build()).get(5, TimeUnit.SECONDS);;
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanXml(false).build());
|
||||
|
||||
directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-parent/test-annotation-indexing/").toURI());
|
||||
projectDir = directory.toURI().toString();
|
||||
@@ -96,14 +96,14 @@ public class SpringIndexerTest {
|
||||
|
||||
@Test
|
||||
public void testScanTestJavaSources() throws Exception {
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanTestJavaSources(true).build()).get(1, TimeUnit.SECONDS);
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanTestJavaSources(true).build());
|
||||
|
||||
List<? extends SymbolInformation> allSymbols = indexer.getAllSymbols("");
|
||||
assertEquals(8, allSymbols.size());
|
||||
String docUri = directory.toPath().resolve("src/test/java/demo/ApplicationTests.java").toUri().toString();
|
||||
assertTrue(containsSymbol(allSymbols, "@SpringBootTest", docUri, 8, 0, 8, 15));
|
||||
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanTestJavaSources(false).build()).get(1, TimeUnit.SECONDS);
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder().scanTestJavaSources(false).build());
|
||||
allSymbols = indexer.getAllSymbols("");
|
||||
assertEquals(7, allSymbols.size());
|
||||
assertFalse(containsSymbol(allSymbols, "@SpringBootTest", docUri, 8, 0, 8, 15));
|
||||
|
||||
@@ -59,8 +59,7 @@ public class SpringIndexerXMLProjectTest {
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder()
|
||||
.scanXml(true)
|
||||
.xmlScanFoldersGlobs(new String[] { "**/src/main/**", "**/config" })
|
||||
.build())
|
||||
.get(5, TimeUnit.SECONDS);;
|
||||
.build());
|
||||
|
||||
project = projects.mavenProject("test-annotation-indexing-xml-project");
|
||||
harness.useProject(project);
|
||||
@@ -124,40 +123,35 @@ public class SpringIndexerXMLProjectTest {
|
||||
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder()
|
||||
.scanXml(true)
|
||||
.build())
|
||||
.get(2, TimeUnit.SECONDS);;
|
||||
.build());
|
||||
allSymbols = indexer.getAllSymbols("");
|
||||
assertEquals(0, allSymbols.size());
|
||||
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder()
|
||||
.scanXml(true)
|
||||
.xmlScanFoldersGlobs(new String[] { "**/src/main/**" })
|
||||
.build())
|
||||
.get(2, TimeUnit.SECONDS);
|
||||
.build());
|
||||
allSymbols = indexer.getAllSymbols("");
|
||||
assertEquals(1, allSymbols.size());
|
||||
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder()
|
||||
.scanXml(true)
|
||||
.xmlScanFoldersGlobs(new String[] { "**/config", "**/src/main/**" })
|
||||
.build())
|
||||
.get(2, TimeUnit.SECONDS);
|
||||
.build());
|
||||
allSymbols = indexer.getAllSymbols("");
|
||||
assertEquals(5, allSymbols.size());
|
||||
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder()
|
||||
.scanXml(true)
|
||||
.xmlScanFoldersGlobs(new String[] { "**/config" })
|
||||
.build())
|
||||
.get(2, TimeUnit.SECONDS);
|
||||
.build());
|
||||
allSymbols = indexer.getAllSymbols("");
|
||||
assertEquals(4, allSymbols.size());
|
||||
|
||||
indexer.configureIndexer(SymbolIndexConfig.builder()
|
||||
.scanXml(false)
|
||||
.xmlScanFoldersGlobs(new String[] { "**/config", "**/src/main/**" })
|
||||
.build())
|
||||
.get(2, TimeUnit.SECONDS);
|
||||
.build());
|
||||
allSymbols = indexer.getAllSymbols("");
|
||||
assertEquals(0, allSymbols.size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user