Fix batch test

This commit is contained in:
Tadgh 2020-06-25 13:00:59 -07:00
parent 7322760f5d
commit 484f390db0
3 changed files with 18 additions and 14 deletions

View File

@ -25,23 +25,23 @@ jobs:
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER)
- task: Maven@3 # - task: Maven@3
env: #env:
JAVA_HOME_11_X64: /usr/local/openjdk-11 # JAVA_HOME_11_X64: /usr/local/openjdk-11
inputs: # inputs:
goals: 'dependency:go-offline' # goals: 'dependency:go-offline'
# These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy # # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy
options: '-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' # options: '-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
# These are JVM options (and don't show up in the build logs) # # These are JVM options (and don't show up in the build logs)
mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' # mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto'
jdkVersionOption: 1.11 # jdkVersionOption: 1.11
- task: Maven@3 - task: Maven@3
env: env:
JAVA_HOME_11_X64: /usr/local/openjdk-11 JAVA_HOME_11_X64: /usr/local/openjdk-11
inputs: inputs:
goals: 'clean install' goals: 'clean install'
# These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy
options: '-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' options: '-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B #-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
# These are JVM options (and don't show up in the build logs) # These are JVM options (and don't show up in the build logs)
mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto'
jdkVersionOption: 1.11 jdkVersionOption: 1.11

View File

@ -9,7 +9,6 @@ import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.PlatformTransactionManager;
import static org.slf4j.LoggerFactory.getLogger; import static org.slf4j.LoggerFactory.getLogger;
@ -18,8 +17,6 @@ import static org.slf4j.LoggerFactory.getLogger;
abstract public class BaseBatchR4Test { abstract public class BaseBatchR4Test {
private static final Logger ourLog = getLogger(BaseBatchR4Test.class); private static final Logger ourLog = getLogger(BaseBatchR4Test.class);
@Autowired
protected PlatformTransactionManager myPlatformTransactionManager;
@Autowired @Autowired
protected JobLauncher myJobLauncher; protected JobLauncher myJobLauncher;
@Autowired @Autowired

View File

@ -2,12 +2,19 @@ package ca.uhn.fhir.jpa.batch.config;
import org.springframework.batch.core.configuration.annotation.BatchConfigurer; import org.springframework.batch.core.configuration.annotation.BatchConfigurer;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.PlatformTransactionManager;
@Configuration @Configuration
@EnableBatchProcessing @EnableBatchProcessing
public class TestBatchConfig { public class TestBatchConfig {
@Bean
public PlatformTransactionManager hapiTransactionManager() {
return new ResourcelessTransactionManager();
}
@Bean @Bean
public BatchConfigurer batchConfigurer() { public BatchConfigurer batchConfigurer() {
return new NonPersistedBatchConfigurer(); return new NonPersistedBatchConfigurer();