enable first unit tests for xml config indexing

This commit is contained in:
Martin Lippert
2019-01-16 17:04:55 +01:00
parent abf58a7bce
commit e8ea496b8a
2 changed files with 8 additions and 6 deletions

View File

@@ -59,6 +59,7 @@ public class SpringIndexerTest {
@Before
public void setup() throws Exception {
harness.intialize(null);
indexer.configureIndexer(false);
directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-parent/test-annotation-indexing/").toURI());
projectDir = directory.toURI().toString();

View File

@@ -54,6 +54,7 @@ public class SpringIndexerXMLProjectTest {
@Before
public void setup() throws Exception {
harness.intialize(null);
indexer.configureIndexer(true);
directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-xml-project/").toURI());
projectDir = directory.toURI().toString();
@@ -69,12 +70,12 @@ public class SpringIndexerXMLProjectTest {
public void testScanningSimpleSpringXMLConfig() throws Exception {
List<? extends SymbolInformation> allSymbols = indexer.getAllSymbols("");
// assertEquals(3, allSymbols.size());
//
// String docUri = directory.toPath().resolve("config/simple-spring-config.xml").toUri().toString();
// assertTrue(containsSymbol(allSymbols, "@+ 'transactionManager' DataSourceTransactionManager", docUri, 7, 143, 7, 144));
// assertTrue(containsSymbol(allSymbols, "@+ 'jdbcTemplate' JdbcTemplate", docUri, 9, 84, 9, 85));
// assertTrue(containsSymbol(allSymbols, "@+ 'namedParameterJdbcTemplate' NamedParameterJdbcTemplate", docUri, 14, 91, 14, 92));
assertEquals(3, allSymbols.size());
String docUri = directory.toPath().resolve("config/simple-spring-config.xml").toUri().toString();
assertTrue(containsSymbol(allSymbols, "@+ 'transactionManager' DataSourceTransactionManager", docUri, 7, 143, 7, 144));
assertTrue(containsSymbol(allSymbols, "@+ 'jdbcTemplate' JdbcTemplate", docUri, 9, 84, 9, 85));
assertTrue(containsSymbol(allSymbols, "@+ 'namedParameterJdbcTemplate' NamedParameterJdbcTemplate", docUri, 14, 91, 14, 92));
}
private boolean containsSymbol(List<? extends SymbolInformation> symbols, String name, String uri, int startLine, int startCHaracter, int endLine, int endCharacter) {