BATCH-1546: enable integration tests with Oracle

This commit is contained in:
dsyer
2010-04-05 16:22:08 +00:00
parent 6473473d78
commit f38c05567a
17 changed files with 102 additions and 31 deletions

View File

@@ -5,7 +5,9 @@
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<import resource="simple-job-launcher-context.xml" />
<bean class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
@@ -49,8 +51,11 @@
</bean>
</property>
</bean>
<bean id="exceptionTranslator" class="org.springframework.batch.core.launch.support.RuntimeExceptionTranslator" />
<bean id="loader" class="org.springframework.batch.sample.launch.DefaultJobLoader">
<property name="registry" ref="jobRegistry" />
</bean>
</beans>

View File

@@ -15,5 +15,6 @@ batch.business.schema.script=classpath:/business-schema-hsqldb.sql
batch.data.source.init=true
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
batch.database.incrementer.parent=columnIncrementerParent
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.grid.size=2
batch.verify.cursor.position=true

View File

@@ -12,5 +12,6 @@ batch.business.schema.script=classpath:business-schema-mysql.sql
batch.data.source.init=true
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
batch.database.incrementer.parent=columnIncrementerParent
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.grid.size=50
batch.verify.cursor.position=true

View File

@@ -1,16 +1,17 @@
# Placeholders batch.*
# for MS SQLServer:
# for Oracle:
batch.jdbc.driver=oracle.jdbc.OracleDriver
batch.jdbc.url=jdbc:oracle:thin:@//dbhost:1521/xe
batch.jdbc.url=jdbc:oracle:thin:@oracle:1521:xe
batch.jdbc.user=spring
batch.jdbc.password=spring
batch.jdbc.testWhileIdle=false
batch.jdbc.validationQuery=
batch.schema.script=/org/springframework/batch/core/schema-oracle10g.sql
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-oracle10g.sql
batch.schema.script=classpath:/org/springframework/batch/core/schema-oracle10g.sql
batch.business.schema.script=business-schema-oracle10g.sql
batch.data.source.init=true
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer
batch.database.incrementer.parent=sequenceIncrementerParent
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.lob.handler.class=org.springframework.jdbc.support.lob.OracleLobHandler
batch.grid.size=2
batch.verify.cursor.position=true

View File

@@ -13,8 +13,8 @@ DROP TABLE ERROR_LOG ;
-- Autogenerated: do not edit this file
CREATE SEQUENCE CUSTOMER_SEQ START WITH 5;
CREATE SEQUENCE BATCH_STAGING_SEQ START WITH 0;
CREATE SEQUENCE TRADE_SEQ START WITH 0;
CREATE SEQUENCE BATCH_STAGING_SEQ START WITH 0 MINVALUE 0;
CREATE SEQUENCE TRADE_SEQ START WITH 0 MINVALUE 0;
CREATE TABLE BATCH_STAGING (
ID NUMBER(38) NOT NULL PRIMARY KEY ,

View File

@@ -68,6 +68,6 @@
<property name="incrementerName" value="DUMMY"/>
</bean>
<!--import resource="alt-data-source-context.xml" /-->
<bean id="lobHandler" class="${batch.lob.handler.class}"/>
</beans>

View File

@@ -20,7 +20,7 @@
<bean id="jobRepository"
class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"
p:dataSource-ref="dataSource" p:transactionManager-ref="transactionManager" />
p:dataSource-ref="dataSource" p:transactionManager-ref="transactionManager" p:lobHandler-ref="lobHandler"/>
<bean id="mapJobRepository"
class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"

View File

@@ -97,9 +97,9 @@ public class CustomerFilterJobFunctionalTests {
});
Map<String, Object> step1Execution = this.getStepExecution(jobExecution, "uploadCustomer");
assertEquals(new Long(4), step1Execution.get("READ_COUNT"));
assertEquals(new Long(1), step1Execution.get("FILTER_COUNT"));
assertEquals(new Long(3), step1Execution.get("WRITE_COUNT"));
assertEquals("4", step1Execution.get("READ_COUNT").toString());
assertEquals("1", step1Execution.get("FILTER_COUNT").toString());
assertEquals("3", step1Execution.get("WRITE_COUNT").toString());
}