Fix tests for spring boot

This commit is contained in:
James Agnew 2017-11-13 15:49:12 -05:00
parent 46f1b0b532
commit 6ca1498277
5 changed files with 29 additions and 21 deletions

5
appveyor.yml Normal file
View File

@ -0,0 +1,5 @@
version: 1.0.{build}
image: Visual Studio 2017
cache: C:\Users\appveyor\.m2\repository
build_script:
- cmd: mvn install

View File

@ -23,28 +23,28 @@ public class LuceneSearchMappingFactory {
SearchMapping mapping = new SearchMapping(); SearchMapping mapping = new SearchMapping();
mapping.analyzerDef("autocompleteEdgeAnalyzer", PatternTokenizerFactory.class) mapping.analyzerDef("autocompleteEdgeAnalyzer", PatternTokenizerFactory.class)
.tokenizerParam("pattern", "(.*)") .tokenizerParam("pattern", "(.*)")
.tokenizerParam("group", "1") .tokenizerParam("group", "1")
.filter(LowerCaseFilterFactory.class) .filter(LowerCaseFilterFactory.class)
.filter(StopFilterFactory.class) .filter(StopFilterFactory.class)
.filter(EdgeNGramFilterFactory.class) .filter(EdgeNGramFilterFactory.class)
.param("minGramSize", "3") .param("minGramSize", "3")
.param("maxGramSize", "50") .param("maxGramSize", "50")
.analyzerDef("autocompletePhoneticAnalyzer", StandardTokenizerFactory.class) .analyzerDef("autocompletePhoneticAnalyzer", StandardTokenizerFactory.class)
.filter(StandardFilterFactory.class) .filter(StandardFilterFactory.class)
.filter(StopFilterFactory.class) .filter(StopFilterFactory.class)
.filter(PhoneticFilterFactory.class) .filter(PhoneticFilterFactory.class)
.param("encoder", "DoubleMetaphone") .param("encoder", "DoubleMetaphone")
.filter(SnowballPorterFilterFactory.class) .filter(SnowballPorterFilterFactory.class)
.param("language", "English") .param("language", "English")
.analyzerDef("autocompleteNGramAnalyzer", StandardTokenizerFactory.class) .analyzerDef("autocompleteNGramAnalyzer", StandardTokenizerFactory.class)
.filter(WordDelimiterFilterFactory.class) .filter(WordDelimiterFilterFactory.class)
.filter(LowerCaseFilterFactory.class) .filter(LowerCaseFilterFactory.class)
.filter(NGramFilterFactory.class) .filter(NGramFilterFactory.class)
.param("minGramSize", "3") .param("minGramSize", "3")
.param("maxGramSize", "20") .param("maxGramSize", "20")
.analyzerDef("standardAnalyzer", StandardTokenizerFactory.class) .analyzerDef("standardAnalyzer", StandardTokenizerFactory.class)
.filter(LowerCaseFilterFactory.class) .filter(LowerCaseFilterFactory.class)
.analyzerDef("exactAnalyzer", StandardTokenizerFactory.class) .analyzerDef("exactAnalyzer", StandardTokenizerFactory.class)
.analyzerDef("conceptParentPidsAnalyzer", WhitespaceTokenizerFactory.class); .analyzerDef("conceptParentPidsAnalyzer", WhitespaceTokenizerFactory.class);

View File

@ -126,7 +126,7 @@ public class TestR4Config extends BaseJavaConfigR4 {
extraProperties.put("hibernate.show_sql", "false"); extraProperties.put("hibernate.show_sql", "false");
extraProperties.put("hibernate.hbm2ddl.auto", "update"); extraProperties.put("hibernate.hbm2ddl.auto", "update");
extraProperties.put("hibernate.dialect", "org.hibernate.dialect.DerbyTenSevenDialect"); extraProperties.put("hibernate.dialect", "org.hibernate.dialect.DerbyTenSevenDialect");
extraProperties.put("hibernate.search.model_mapping", LuceneSearchMappingFactory.class.getName()); extraProperties.put("hibernate.search.model_mapping", ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory.class.getName());
extraProperties.put("hibernate.search.default.directory_provider", "ram"); extraProperties.put("hibernate.search.default.directory_provider", "ram");
extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT"); extraProperties.put("hibernate.search.lucene_version", "LUCENE_CURRENT");
extraProperties.put("hibernate.search.autoregister_listeners", "true"); extraProperties.put("hibernate.search.autoregister_listeners", "true");

View File

@ -76,7 +76,8 @@ public class FhirAutoConfigurationTest {
PropertyPlaceholderAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class,
FhirAutoConfiguration.class), FhirAutoConfiguration.class),
"hapi.fhir.version:DSTU3", "hapi.fhir.version:DSTU3",
"spring.jpa.properties.hibernate.search.default.indexBase:target/lucenefiles"); "spring.jpa.properties.hibernate.search.default.indexBase:target/lucenefiles",
"spring.jpa.properties.hibernate.search.model_mapping:ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory");
assertThat(this.context.getBeansOfType(DaoConfig.class)).hasSize(1); assertThat(this.context.getBeansOfType(DaoConfig.class)).hasSize(1);
assertThat(this.context.getBeansOfType(Dstu3.class)).hasSize(1); assertThat(this.context.getBeansOfType(Dstu3.class)).hasSize(1);
} }

View File

@ -11,6 +11,8 @@ spring:
hibernate.search.default.directory_provider: filesystem hibernate.search.default.directory_provider: filesystem
hibernate.search.default.indexBase: target/lucenefiles hibernate.search.default.indexBase: target/lucenefiles
hibernate.search.lucene_version: LUCENE_CURRENT hibernate.search.lucene_version: LUCENE_CURRENT
hibernate.search.model_mapping: ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory
h2: h2:
console: console:
enabled: true enabled: true