diff --git a/spring-batch-samples/src/main/resources/batch-derby.properties b/spring-batch-samples/src/main/resources/batch-derby.properties deleted file mode 100644 index 2eea26309..000000000 --- a/spring-batch-samples/src/main/resources/batch-derby.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Placeholders batch.* -# for Derby: -batch.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver -batch.jdbc.url=jdbc:derby:derby-home/test;create=true -batch.jdbc.user=app -batch.jdbc.password= -batch.jdbc.testWhileIdle=false -batch.jdbc.validationQuery= -batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-derby.sql -batch.schema.script=classpath:/org/springframework/batch/core/schema-derby.sql -batch.business.schema.script=business-schema-derby.sql -batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer -batch.database.incrementer.parent=columnIncrementerParent -batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler -batch.grid.size=2 -batch.jdbc.pool.size=6 -batch.verify.cursor.position=false -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ diff --git a/spring-batch-samples/src/main/resources/batch-h2.properties b/spring-batch-samples/src/main/resources/batch-h2.properties deleted file mode 100644 index 7d02fa669..000000000 --- a/spring-batch-samples/src/main/resources/batch-h2.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Placeholders batch.* -# for H2: -batch.jdbc.driver=org.h2.Driver -batch.jdbc.url=jdbc:h2:file:target/data/h2 -batch.jdbc.user=sa -batch.jdbc.password= -batch.jdbc.testWhileIdle=false -batch.jdbc.validationQuery= -batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-h2.sql -batch.schema.script=classpath:/org/springframework/batch/core/schema-h2.sql -batch.business.schema.script=classpath:/business-schema-h2.sql -batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer -batch.database.incrementer.parent=sequenceIncrementerParent -batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler -batch.grid.size=2 -batch.jdbc.pool.size=6 -batch.verify.cursor.position=true -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ diff --git a/spring-batch-samples/src/main/resources/batch-hana.properties b/spring-batch-samples/src/main/resources/batch-hana.properties deleted file mode 100644 index 371460c48..000000000 --- a/spring-batch-samples/src/main/resources/batch-hana.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Placeholders batch.* -# for SAP HANA: -batch.jdbc.driver=com.sap.db.jdbc.Driver -batch.jdbc.url=jdbc:sap://localhost:39015/ -batch.jdbc.user=SPRING_TEST -batch.jdbc.password=Spr1ng_test -batch.jdbc.testWhileIdle=false -batch.jdbc.validationQuery= -batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-hana.sql -batch.schema.script=classpath:/org/springframework/batch/core/schema-hana.sql -batch.business.schema.script=business-schema-hana.sql -batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.HanaSequenceMaxValueIncrementer -batch.database.incrementer.parent=sequenceIncrementerParent -batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler -batch.grid.size=2 -batch.jdbc.pool.size=6 -batch.verify.cursor.position=true -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ - diff --git a/spring-batch-samples/src/main/resources/batch-mysql.properties b/spring-batch-samples/src/main/resources/batch-mysql.properties deleted file mode 100644 index e1a8c17bc..000000000 --- a/spring-batch-samples/src/main/resources/batch-mysql.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Placeholders batch.* -# for MySQL: -batch.jdbc.driver=com.mysql.jdbc.Driver -batch.jdbc.url=jdbc:mysql://localhost/test -batch.jdbc.user=test -batch.jdbc.password=test -batch.jdbc.testWhileIdle=true -batch.jdbc.validationQuery=SELECT 1 -batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-mysql.sql -batch.schema.script=classpath:/org/springframework/batch/core/schema-mysql.sql -batch.business.schema.script=classpath:business-schema-mysql.sql -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.jdbc.pool.size=6 -batch.grid.size=50 -batch.verify.cursor.position=true -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ - diff --git a/spring-batch-samples/src/main/resources/batch-oracle.properties b/spring-batch-samples/src/main/resources/batch-oracle.properties deleted file mode 100644 index 57753f657..000000000 --- a/spring-batch-samples/src/main/resources/batch-oracle.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Placeholders batch.* -# for Oracle: -batch.jdbc.driver=oracle.jdbc.OracleDriver -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.drop.script=classpath:/org/springframework/batch/core/schema-drop-oracle.sql -batch.schema.script=classpath:/org/springframework/batch/core/schema-oracle.sql -batch.business.schema.script=business-schema-oracle.sql -batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer -batch.database.incrementer.parent=sequenceIncrementerParent -batch.lob.handler.class=org.springframework.jdbc.support.lob.OracleLobHandler -batch.grid.size=2 -batch.jdbc.pool.size=6 -batch.verify.cursor.position=true -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ - diff --git a/spring-batch-samples/src/main/resources/batch-postgresql.properties b/spring-batch-samples/src/main/resources/batch-postgresql.properties deleted file mode 100644 index 58b97f080..000000000 --- a/spring-batch-samples/src/main/resources/batch-postgresql.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Placeholders batch.* -# for Postgres: -batch.jdbc.driver=org.postgresql.Driver -batch.jdbc.url=jdbc:postgresql://localhost/samples -batch.jdbc.user=postgres -batch.jdbc.password=dba -batch.jdbc.testWhileIdle=false -batch.jdbc.validationQuery= -batch.jdbc.verifyCursorPosition=false -batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-postgresql.sql -batch.schema.script=classpath:/org/springframework/batch/core/schema-postgresql.sql -batch.business.schema.script=business-schema-postgresql.sql -batch.data.source.init=true -batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.PostgresSequenceMaxValueIncrementer -batch.database.incrementer.parent=sequenceIncrementerParent -batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler -batch.grid.size=2 -batch.jdbc.pool.size=6 -batch.verify.cursor.position=false -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ diff --git a/spring-batch-samples/src/main/resources/batch-sqlserver.properties b/spring-batch-samples/src/main/resources/batch-sqlserver.properties deleted file mode 100644 index b6d018d84..000000000 --- a/spring-batch-samples/src/main/resources/batch-sqlserver.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Placeholders batch.* -# for MS SQLServer: -batch.jdbc.driver=net.sourceforge.jtds.jdbc.Driver -batch.jdbc.url=jdbc:jtds:sqlserver://localhost:1433;instance=SQLEXPRESS -batch.jdbc.user=sa -batch.jdbc.password=sa -batch.jdbc.testWhileIdle=false -batch.jdbc.validationQuery= -batch.drop.script=/org/springframework/batch/core/schema-drop-sqlserver.sql -batch.schema.script=/org/springframework/batch/core/schema-sqlserver.sql -batch.business.schema.script=business-schema-sqlserver.sql -batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer -batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler -batch.database.incrementer.parent=columnIncrementerParent -batch.grid.size=2 -batch.jdbc.pool.size=6 -batch.verify.cursor.position=true -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ - diff --git a/spring-batch-samples/src/main/resources/batch-sybase.properties b/spring-batch-samples/src/main/resources/batch-sybase.properties deleted file mode 100644 index 041d1b2cb..000000000 --- a/spring-batch-samples/src/main/resources/batch-sybase.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Placeholders batch.* -# for MySQL: -batch.jdbc.driver=net.sourceforge.jtds.jdbc.Driver -batch.jdbc.url=jdbc:jtds:sybase://dbhost:5000;databaseName=test -batch.jdbc.user=spring -batch.jdbc.password=spring -batch.jdbc.testWhileIdle=false -batch.jdbc.validationQuery= -batch.drop.script=/org/springframework/batch/core/schema-drop-sybase.sql -batch.schema.script=/org/springframework/batch/core/schema-sybase.sql -batch.business.schema.script=business-schema-sybase.sql -batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.SybaseMaxValueIncrementer -batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler -batch.database.incrementer.parent=columnIncrementerParent -batch.jdbc.pool.size=6 -batch.grid.size=6 -batch.verify.cursor.position=true -batch.isolationlevel=ISOLATION_SERIALIZABLE -batch.table.prefix=BATCH_ - - diff --git a/spring-batch-samples/src/main/resources/business-schema-db2.sql b/spring-batch-samples/src/main/resources/business-schema-db2.sql deleted file mode 100644 index 753c3eff2..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-db2.sql +++ /dev/null @@ -1,93 +0,0 @@ --- Autogenerated: do not edit this file -DROP SEQUENCE BATCH_STAGING_SEQ ; -DROP SEQUENCE TRADE_SEQ ; -DROP SEQUENCE CUSTOMER_SEQ ; -DROP TABLE BATCH_STAGING ; -DROP TABLE TRADE ; -DROP TABLE CUSTOMER ; -DROP TABLE PLAYERS ; -DROP TABLE GAMES ; -DROP TABLE PLAYER_SUMMARY ; -DROP TABLE ERROR_LOG ; - --- Autogenerated: do not edit this file - -CREATE SEQUENCE CUSTOMER_SEQ; -CREATE SEQUENCE BATCH_STAGING_SEQ; -CREATE SEQUENCE TRADE_SEQ; - -CREATE TABLE BATCH_STAGING ( - ID BIGINT NOT NULL PRIMARY KEY , - JOB_ID BIGINT NOT NULL, - VALUE BLOB NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR(45) -) ; - -CREATE TABLE CUSTOMER ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - NAME VARCHAR(45) , - CREDIT DECIMAL(10,2) -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) , - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) , - COMPLETES BIGINT , - ATTEMPTS BIGINT , - PASSING_YARDS BIGINT , - PASSING_TD BIGINT , - INTERCEPTIONS BIGINT , - RUSHES BIGINT , - RUSH_YARDS BIGINT , - RECEPTIONS BIGINT , - RECEPTIONS_YARDS BIGINT , - TOTAL_TD BIGINT -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/business-schema-derby.sql b/spring-batch-samples/src/main/resources/business-schema-derby.sql deleted file mode 100644 index d92fef455..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-derby.sql +++ /dev/null @@ -1,94 +0,0 @@ --- Autogenerated: do not edit this file --- You might need to remove this section the first time you run against a clean database -DROP TABLE BATCH_STAGING_SEQ ; -DROP TABLE TRADE_SEQ ; -DROP TABLE CUSTOMER_SEQ ; -DROP TABLE BATCH_STAGING ; -DROP TABLE TRADE ; -DROP TABLE CUSTOMER ; -DROP TABLE PLAYERS ; -DROP TABLE GAMES ; -DROP TABLE PLAYER_SUMMARY ; -DROP TABLE ERROR_LOG ; - --- Autogenerated: do not edit this file - -CREATE TABLE CUSTOMER_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (start with 5), DUMMY VARCHAR(1)); -CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (start with 0), DUMMY VARCHAR(1)); -CREATE TABLE TRADE_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (start with 0), DUMMY VARCHAR(1)); - -CREATE TABLE BATCH_STAGING ( - ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, - JOB_ID BIGINT NOT NULL, - VALUE BLOB NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, - VERSION BIGINT , - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR(45) -) ; - -CREATE TABLE CUSTOMER ( - ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, - VERSION BIGINT , - NAME VARCHAR(45) , - CREDIT DECIMAL(10,2) -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) , - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) , - COMPLETES BIGINT , - ATTEMPTS BIGINT , - PASSING_YARDS BIGINT , - PASSING_TD BIGINT , - INTERCEPTIONS BIGINT , - RUSHES BIGINT , - RUSH_YARDS BIGINT , - RECEPTIONS BIGINT , - RECEPTIONS_YARDS BIGINT , - TOTAL_TD BIGINT -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/business-schema-h2.sql b/spring-batch-samples/src/main/resources/business-schema-h2.sql deleted file mode 100644 index cbe742b01..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-h2.sql +++ /dev/null @@ -1,93 +0,0 @@ --- Autogenerated: do not edit this file -DROP SEQUENCE BATCH_STAGING_SEQ IF EXISTS; -DROP SEQUENCE TRADE_SEQ IF EXISTS; -DROP SEQUENCE CUSTOMER_SEQ IF EXISTS; -DROP TABLE BATCH_STAGING IF EXISTS; -DROP TABLE TRADE IF EXISTS; -DROP TABLE CUSTOMER IF EXISTS; -DROP TABLE PLAYERS IF EXISTS; -DROP TABLE GAMES IF EXISTS; -DROP TABLE PLAYER_SUMMARY IF EXISTS; -DROP TABLE ERROR_LOG IF EXISTS; - --- 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 TABLE BATCH_STAGING ( - ID BIGINT IDENTITY NOT NULL PRIMARY KEY , - JOB_ID BIGINT NOT NULL, - VALUE LONGVARBINARY NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID BIGINT IDENTITY NOT NULL PRIMARY KEY , - VERSION BIGINT , - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR(45) -) ; - -CREATE TABLE CUSTOMER ( - ID BIGINT IDENTITY NOT NULL PRIMARY KEY , - VERSION BIGINT , - NAME VARCHAR(45) , - CREDIT DECIMAL(10,2) -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) , - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) , - COMPLETES BIGINT , - ATTEMPTS BIGINT , - PASSING_YARDS BIGINT , - PASSING_TD BIGINT , - INTERCEPTIONS BIGINT , - RUSHES BIGINT , - RUSH_YARDS BIGINT , - RECEPTIONS BIGINT , - RECEPTIONS_YARDS BIGINT , - TOTAL_TD BIGINT -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/business-schema-hana.sql b/spring-batch-samples/src/main/resources/business-schema-hana.sql deleted file mode 100644 index 8de565e5b..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-hana.sql +++ /dev/null @@ -1,94 +0,0 @@ --- Autogenerated: do not edit this file --- You might need to remove this section the first time you run against a clean database -DROP SEQUENCE BATCH_STAGING_SEQ ; -DROP SEQUENCE TRADE_SEQ ; -DROP SEQUENCE CUSTOMER_SEQ ; -DROP TABLE BATCH_STAGING ; -DROP TABLE TRADE ; -DROP TABLE CUSTOMER ; -DROP TABLE PLAYERS ; -DROP TABLE GAMES ; -DROP TABLE PLAYER_SUMMARY ; -DROP TABLE ERROR_LOG ; - --- Autogenerated: do not edit this file - -CREATE SEQUENCE CUSTOMER_SEQ START WITH 5 MINVALUE 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 BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, - JOB_ID BIGINT NOT NULL, - VALUE BLOB NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, - VERSION BIGINT , - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR(45) -) ; - -CREATE TABLE CUSTOMER ( - ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, - VERSION BIGINT , - NAME VARCHAR(45) , - CREDIT DECIMAL(10,2) -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) , - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) , - COMPLETES BIGINT , - ATTEMPTS BIGINT , - PASSING_YARDS BIGINT , - PASSING_TD BIGINT , - INTERCEPTIONS BIGINT , - RUSHES BIGINT , - RUSH_YARDS BIGINT , - RECEPTIONS BIGINT , - RECEPTIONS_YARDS BIGINT , - TOTAL_TD BIGINT -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/business-schema-mysql.sql b/spring-batch-samples/src/main/resources/business-schema-mysql.sql deleted file mode 100644 index 7f098b787..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-mysql.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Autogenerated: do not edit this file --- You might need to remove this section the first time you run against a clean database -DROP TABLE IF EXISTS BATCH_STAGING_SEQ ; -DROP TABLE IF EXISTS TRADE_SEQ ; -DROP TABLE IF EXISTS CUSTOMER_SEQ ; -DROP TABLE IF EXISTS BATCH_STAGING ; -DROP TABLE IF EXISTS TRADE ; -DROP TABLE IF EXISTS CUSTOMER ; -DROP TABLE IF EXISTS PLAYERS ; -DROP TABLE IF EXISTS GAMES ; -DROP TABLE IF EXISTS PLAYER_SUMMARY ; -DROP TABLE IF EXISTS ERROR_LOG ; - --- Autogenerated: do not edit this file - -CREATE TABLE CUSTOMER_SEQ (ID BIGINT NOT NULL) engine=InnoDB; -INSERT INTO CUSTOMER_SEQ values(5); -CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT NOT NULL) engine=InnoDB; -INSERT INTO BATCH_STAGING_SEQ values(0); -CREATE TABLE TRADE_SEQ (ID BIGINT NOT NULL) engine=InnoDB; -INSERT INTO TRADE_SEQ values(0); - -CREATE TABLE BATCH_STAGING ( - ID BIGINT NOT NULL PRIMARY KEY , - JOB_ID BIGINT NOT NULL, - VALUE BLOB NOT NULL, - PROCESSED CHAR(1) NOT NULL -) engine=InnoDB; - -CREATE TABLE TRADE ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR(45) -) engine=InnoDB; - -CREATE TABLE CUSTOMER ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - NAME VARCHAR(45) , - CREDIT DECIMAL(10,2) -) engine=InnoDB; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) , - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) engine=InnoDB; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) , - COMPLETES BIGINT , - ATTEMPTS BIGINT , - PASSING_YARDS BIGINT , - PASSING_TD BIGINT , - INTERCEPTIONS BIGINT , - RUSHES BIGINT , - RUSH_YARDS BIGINT , - RECEPTIONS BIGINT , - RECEPTIONS_YARDS BIGINT , - TOTAL_TD BIGINT -) engine=InnoDB; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) engine=InnoDB; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) engine=InnoDB; diff --git a/spring-batch-samples/src/main/resources/business-schema-oracle.sql b/spring-batch-samples/src/main/resources/business-schema-oracle.sql deleted file mode 100644 index 5e15fcbdb..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-oracle.sql +++ /dev/null @@ -1,93 +0,0 @@ --- Autogenerated: do not edit this file -DROP SEQUENCE BATCH_STAGING_SEQ ; -DROP SEQUENCE TRADE_SEQ ; -DROP SEQUENCE CUSTOMER_SEQ ; -DROP TABLE BATCH_STAGING ; -DROP TABLE TRADE ; -DROP TABLE CUSTOMER ; -DROP TABLE PLAYERS ; -DROP TABLE GAMES ; -DROP TABLE PLAYER_SUMMARY ; -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 MINVALUE 0; -CREATE SEQUENCE TRADE_SEQ START WITH 0 MINVALUE 0; - -CREATE TABLE BATCH_STAGING ( - ID NUMBER(38) NOT NULL PRIMARY KEY , - JOB_ID NUMBER(38) NOT NULL, - VALUE BLOB NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID NUMBER(38) NOT NULL PRIMARY KEY , - VERSION NUMBER(38) , - ISIN VARCHAR(45) NOT NULL, - QUANTITY NUMBER(38) , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR2(45) -) ; - -CREATE TABLE CUSTOMER ( - ID NUMBER(38) NOT NULL PRIMARY KEY , - VERSION NUMBER(38) , - NAME VARCHAR2(45) , - CREDIT DECIMAL(10,2) -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR2(35) NOT NULL, - FIRST_NAME VARCHAR2(25) NOT NULL, - POS VARCHAR2(10) , - YEAR_OF_BIRTH NUMBER(38) NOT NULL, - YEAR_DRAFTED NUMBER(38) NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO NUMBER(38) NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK NUMBER(38) NOT NULL, - OPPONENT CHAR(3) , - COMPLETES NUMBER(38) , - ATTEMPTS NUMBER(38) , - PASSING_YARDS NUMBER(38) , - PASSING_TD NUMBER(38) , - INTERCEPTIONS NUMBER(38) , - RUSHES NUMBER(38) , - RUSH_YARDS NUMBER(38) , - RECEPTIONS NUMBER(38) , - RECEPTIONS_YARDS NUMBER(38) , - TOTAL_TD NUMBER(38) -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO NUMBER(38) NOT NULL, - COMPLETES NUMBER(38) NOT NULL , - ATTEMPTS NUMBER(38) NOT NULL , - PASSING_YARDS NUMBER(38) NOT NULL , - PASSING_TD NUMBER(38) NOT NULL , - INTERCEPTIONS NUMBER(38) NOT NULL , - RUSHES NUMBER(38) NOT NULL , - RUSH_YARDS NUMBER(38) NOT NULL , - RECEPTIONS NUMBER(38) NOT NULL , - RECEPTIONS_YARDS NUMBER(38) NOT NULL , - TOTAL_TD NUMBER(38) NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/business-schema-postgresql.sql b/spring-batch-samples/src/main/resources/business-schema-postgresql.sql deleted file mode 100644 index 461a8c365..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-postgresql.sql +++ /dev/null @@ -1,93 +0,0 @@ --- Autogenerated: do not edit this file -DROP SEQUENCE IF EXISTS BATCH_STAGING_SEQ ; -DROP SEQUENCE IF EXISTS TRADE_SEQ ; -DROP SEQUENCE IF EXISTS CUSTOMER_SEQ ; -DROP TABLE IF EXISTS BATCH_STAGING ; -DROP TABLE IF EXISTS TRADE ; -DROP TABLE IF EXISTS CUSTOMER ; -DROP TABLE IF EXISTS PLAYERS ; -DROP TABLE IF EXISTS GAMES ; -DROP TABLE IF EXISTS PLAYER_SUMMARY ; -DROP TABLE IF EXISTS ERROR_LOG ; - --- Autogenerated: do not edit this file - -CREATE SEQUENCE CUSTOMER_SEQ; -CREATE SEQUENCE BATCH_STAGING_SEQ; -CREATE SEQUENCE TRADE_SEQ; - -CREATE TABLE BATCH_STAGING ( - ID BIGINT NOT NULL PRIMARY KEY , - JOB_ID BIGINT NOT NULL, - VALUE BYTEA NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR(45) -) ; - -CREATE TABLE CUSTOMER ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - NAME VARCHAR(45) , - CREDIT DECIMAL(10,2) -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) , - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) , - COMPLETES BIGINT , - ATTEMPTS BIGINT , - PASSING_YARDS BIGINT , - PASSING_TD BIGINT , - INTERCEPTIONS BIGINT , - RUSHES BIGINT , - RUSH_YARDS BIGINT , - RECEPTIONS BIGINT , - RECEPTIONS_YARDS BIGINT , - TOTAL_TD BIGINT -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/business-schema-sqlserver.sql b/spring-batch-samples/src/main/resources/business-schema-sqlserver.sql deleted file mode 100644 index df575a107..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-sqlserver.sql +++ /dev/null @@ -1,95 +0,0 @@ --- Autogenerated: do not edit this file -DROP TABLE BATCH_STAGING_SEQ ; -DROP TABLE TRADE_SEQ ; -DROP TABLE CUSTOMER_SEQ ; -DROP TABLE BATCH_STAGING ; -DROP TABLE TRADE ; -DROP TABLE CUSTOMER ; -DROP TABLE PLAYERS ; -DROP TABLE GAMES ; -DROP TABLE PLAYER_SUMMARY ; -DROP TABLE ERROR_LOG ; - --- Autogenerated: do not edit this file - -CREATE TABLE CUSTOMER_SEQ (ID BIGINT IDENTITY); -SET IDENTITY_INSERT CUSTOMER_SEQ ON; -INSERT INTO CUSTOMER_SEQ (ID) values (5); -CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT IDENTITY); -CREATE TABLE TRADE_SEQ (ID BIGINT IDENTITY); - -CREATE TABLE BATCH_STAGING ( - ID BIGINT NOT NULL PRIMARY KEY , - JOB_ID BIGINT NOT NULL, - VALUE IMAGE NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT , - PRICE DECIMAL(8,2) , - CUSTOMER VARCHAR(45) -) ; - -CREATE TABLE CUSTOMER ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT , - NAME VARCHAR(45) , - CREDIT DECIMAL(10,2) -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) , - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) , - COMPLETES BIGINT , - ATTEMPTS BIGINT , - PASSING_YARDS BIGINT , - PASSING_TD BIGINT , - INTERCEPTIONS BIGINT , - RUSHES BIGINT , - RUSH_YARDS BIGINT , - RECEPTIONS BIGINT , - RECEPTIONS_YARDS BIGINT , - TOTAL_TD BIGINT -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) , - STEP_NAME CHAR(20) , - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/business-schema-sybase.sql b/spring-batch-samples/src/main/resources/business-schema-sybase.sql deleted file mode 100644 index f4470c248..000000000 --- a/spring-batch-samples/src/main/resources/business-schema-sybase.sql +++ /dev/null @@ -1,96 +0,0 @@ --- Autogenerated: do not edit this file -DROP TABLE BATCH_STAGING_SEQ ; -DROP TABLE TRADE_SEQ ; -DROP TABLE CUSTOMER_SEQ ; -DROP TABLE BATCH_STAGING ; -DROP TABLE TRADE ; -DROP TABLE CUSTOMER ; -DROP TABLE PLAYERS ; -DROP TABLE GAMES ; -DROP TABLE PLAYER_SUMMARY ; -DROP TABLE ERROR_LOG ; - --- Autogenerated: do not edit this file - -CREATE TABLE CUSTOMER_SEQ (ID BIGINT IDENTITY); -INSERT INTO CUSTOMER_SEQ (ID) values (5); -CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT IDENTITY); -INSERT INTO BATCH_STAGING_SEQ (ID) values (0); -CREATE TABLE TRADE_SEQ (ID BIGINT IDENTITY); -INSERT INTO TRADE_SEQ (ID) values (0); - -CREATE TABLE BATCH_STAGING ( - ID BIGINT NOT NULL PRIMARY KEY , - JOB_ID BIGINT NOT NULL, - VALUE IMAGE NOT NULL, - PROCESSED CHAR(1) NOT NULL -) ; - -CREATE TABLE TRADE ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT NULL, - ISIN VARCHAR(45) NOT NULL, - QUANTITY BIGINT NULL, - PRICE DECIMAL(8,2) NULL, - CUSTOMER VARCHAR(45) NULL -) ; - -CREATE TABLE CUSTOMER ( - ID BIGINT NOT NULL PRIMARY KEY , - VERSION BIGINT NULL, - NAME VARCHAR(45) NULL, - CREDIT DECIMAL(10,2) NULL -) ; - -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000); -INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000); - -CREATE TABLE PLAYERS ( - PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY, - LAST_NAME VARCHAR(35) NOT NULL, - FIRST_NAME VARCHAR(25) NOT NULL, - POS VARCHAR(10) NULL, - YEAR_OF_BIRTH BIGINT NOT NULL, - YEAR_DRAFTED BIGINT NOT NULL -) ; - -CREATE TABLE GAMES ( - PLAYER_ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - TEAM CHAR(3) NOT NULL, - WEEK BIGINT NOT NULL, - OPPONENT CHAR(3) NULL, - COMPLETES BIGINT NULL, - ATTEMPTS BIGINT NULL, - PASSING_YARDS BIGINT NULL, - PASSING_TD BIGINT NULL, - INTERCEPTIONS BIGINT NULL, - RUSHES BIGINT NULL, - RUSH_YARDS BIGINT NULL, - RECEPTIONS BIGINT NULL, - RECEPTIONS_YARDS BIGINT NULL, - TOTAL_TD BIGINT NULL -) ; - -CREATE TABLE PLAYER_SUMMARY ( - ID CHAR(8) NOT NULL, - YEAR_NO BIGINT NOT NULL, - COMPLETES BIGINT NOT NULL , - ATTEMPTS BIGINT NOT NULL , - PASSING_YARDS BIGINT NOT NULL , - PASSING_TD BIGINT NOT NULL , - INTERCEPTIONS BIGINT NOT NULL , - RUSHES BIGINT NOT NULL , - RUSH_YARDS BIGINT NOT NULL , - RECEPTIONS BIGINT NOT NULL , - RECEPTIONS_YARDS BIGINT NOT NULL , - TOTAL_TD BIGINT NOT NULL -) ; - -CREATE TABLE ERROR_LOG ( - JOB_NAME CHAR(20) NULL, - STEP_NAME CHAR(20) NULL, - MESSAGE VARCHAR(300) NOT NULL -) ; diff --git a/spring-batch-samples/src/main/resources/data/iosample/input/delimited.csv b/spring-batch-samples/src/main/resources/data/iosample/input/delimited.csv deleted file mode 100644 index 95a077e6b..000000000 --- a/spring-batch-samples/src/main/resources/data/iosample/input/delimited.csv +++ /dev/null @@ -1,6 +0,0 @@ -customer1,10 -customer2,20 -customer3,30 -customer4,40 -customer5,50 -customer6,60 \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/iosample/input/delimited2.csv b/spring-batch-samples/src/main/resources/data/iosample/input/delimited2.csv deleted file mode 100644 index 46f251216..000000000 --- a/spring-batch-samples/src/main/resources/data/iosample/input/delimited2.csv +++ /dev/null @@ -1,2 +0,0 @@ -customer7,70 -customer8,80 \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/20070122.teststream.ImportTradeDataStep.txt b/spring-batch-samples/src/main/resources/data/multiResourceJob/input/20070122.teststream.ImportTradeDataStep.txt deleted file mode 100644 index c48f5c51c..000000000 --- a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/20070122.teststream.ImportTradeDataStep.txt +++ /dev/null @@ -1,5 +0,0 @@ -UK21341EAH4121131.11customer1 -UK21341EAH4221232.11customer2 -UK21341EAH4321333.11customer3 -UK21341EAH4421434.11customer4 -UK21341EAH4521535.11customer5 \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/file-1.txt b/spring-batch-samples/src/main/resources/data/multiResourceJob/input/file-1.txt deleted file mode 100644 index 965d6aceb..000000000 --- a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/file-1.txt +++ /dev/null @@ -1,2 +0,0 @@ -UK21341EAH4121131.11customer1 -UK21341EAH4221232.11customer2 \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/file-2.txt b/spring-batch-samples/src/main/resources/data/multiResourceJob/input/file-2.txt deleted file mode 100644 index 90663c8ca..000000000 --- a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/file-2.txt +++ /dev/null @@ -1,3 +0,0 @@ -UK21341EAH4321333.11customer3 -UK21341EAH4421434.11customer4 -UK21341EAH4521535.11customer5 \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/ignored.txt b/spring-batch-samples/src/main/resources/data/multiResourceJob/input/ignored.txt deleted file mode 100644 index d4d1a9be0..000000000 --- a/spring-batch-samples/src/main/resources/data/multiResourceJob/input/ignored.txt +++ /dev/null @@ -1 +0,0 @@ -random input that would cause error if processed: g awegweagaer gw5t43 5643623456tr \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/multilineJob/input/problematic.txt b/spring-batch-samples/src/main/resources/data/multilineJob/input/problematic.txt deleted file mode 100644 index 9a2f42af6..000000000 --- a/spring-batch-samples/src/main/resources/data/multilineJob/input/problematic.txt +++ /dev/null @@ -1,20 +0,0 @@ -RECORDTYPE1 -a,b,c -d,e -END - -RECORDTYPE2 -1:2:3 -4 -5:6 -END - -PERSON -john, william, smith #name -55 #age -END - -ANIMAL -tiger #spieces -1 #quantity -END diff --git a/spring-batch-samples/src/main/resources/data/simpleSkipSample/input/20070122.teststream.ImportTradeDataStep.txt b/spring-batch-samples/src/main/resources/data/simpleSkipSample/input/20070122.teststream.ImportTradeDataStep.txt deleted file mode 100644 index 7908e95a3..000000000 --- a/spring-batch-samples/src/main/resources/data/simpleSkipSample/input/20070122.teststream.ImportTradeDataStep.txt +++ /dev/null @@ -1,5 +0,0 @@ -UK21341EAH4597898.34customer1 -UK21341EAH4611218.12customer2 -UK21341EAH4724512.78customer2 -UK21341EAH48108109.25customer3 -UK21341EAH49854123.39customer4 \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/simpleTaskletJob/input/20070122.teststream.ImportTradeDataStep.txt b/spring-batch-samples/src/main/resources/data/simpleTaskletJob/input/20070122.teststream.ImportTradeDataStep.txt deleted file mode 100644 index c48f5c51c..000000000 --- a/spring-batch-samples/src/main/resources/data/simpleTaskletJob/input/20070122.teststream.ImportTradeDataStep.txt +++ /dev/null @@ -1,5 +0,0 @@ -UK21341EAH4121131.11customer1 -UK21341EAH4221232.11customer2 -UK21341EAH4321333.11customer3 -UK21341EAH4421434.11customer4 -UK21341EAH4521535.11customer5 \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/data/simpleTaskletJob/input/20070207.testStream.ImportTradeDataStep.txt b/spring-batch-samples/src/main/resources/data/simpleTaskletJob/input/20070207.testStream.ImportTradeDataStep.txt deleted file mode 100644 index 3a8951788..000000000 --- a/spring-batch-samples/src/main/resources/data/simpleTaskletJob/input/20070207.testStream.ImportTradeDataStep.txt +++ /dev/null @@ -1,5 +0,0 @@ -UK21341EAH4597898.34customer1 -UK21341EAH4611218.12customer2 -UK21341EAH4724512.78customer2 -UK21341EAH48108109.25customer3 -UK21341EAH49854123.39customer4 diff --git a/spring-batch-samples/src/main/resources/hibernate-context.xml b/spring-batch-samples/src/main/resources/hibernate-context.xml deleted file mode 100644 index 55faaa717..000000000 --- a/spring-batch-samples/src/main/resources/hibernate-context.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/spring-batch-samples/src/main/resources/jobs/JdbcCustomerDebitDaoTests-context.xml b/spring-batch-samples/src/main/resources/jobs/JdbcCustomerDebitDaoTests-context.xml deleted file mode 100644 index 5f4086490..000000000 --- a/spring-batch-samples/src/main/resources/jobs/JdbcCustomerDebitDaoTests-context.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/jobs/hibernateJob.xml b/spring-batch-samples/src/main/resources/jobs/hibernateJob.xml deleted file mode 100644 index f01698038..000000000 --- a/spring-batch-samples/src/main/resources/jobs/hibernateJob.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - Example for Hibernate integration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/jobs/ioSampleJob.xml b/spring-batch-samples/src/main/resources/jobs/ioSampleJob.xml deleted file mode 100644 index 7bf5b6e52..000000000 --- a/spring-batch-samples/src/main/resources/jobs/ioSampleJob.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - diff --git a/spring-batch-samples/src/main/resources/jobs/iosample/hibernate.xml b/spring-batch-samples/src/main/resources/jobs/iosample/hibernate.xml deleted file mode 100644 index 9f2602418..000000000 --- a/spring-batch-samples/src/main/resources/jobs/iosample/hibernate.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/spring-batch-samples/src/main/resources/log4j.properties b/spring-batch-samples/src/main/resources/log4j.properties deleted file mode 100644 index c5d035895..000000000 --- a/spring-batch-samples/src/main/resources/log4j.properties +++ /dev/null @@ -1,33 +0,0 @@ -log4j.rootLogger=info, stdout -# log4j.rootLogger=info, stdout, chainsaw - -### direct log messages to stdout ### -log4j.appender.stdout=org.apache.logging.log4j.core.appender.ConsoleAppender -log4j.appender.stdout.Target=System.out -log4j.appender.stdout.layout=org.apache.logging.log4j.core.layout.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c{1}:%L - %m%n - -log4j.appender.chainsaw=org.apache.log4j.RollingFileAppender -log4j.appender.chainsaw.File=out.xml -log4j.appender.chainsaw.Append=false -log4j.appender.chainsaw.Threshold=debug -log4j.appender.chainsaw.MaxFileSize=10MB -log4j.appender.chainsaw.MaxBackupIndex=2 -log4j.appender.chainsaw.layout=org.apache.log4j.xml.XMLLayout - -### set log levels - for more verbose logging change 'info' to 'debug' ### - -### enable the following line if you want to track down connection ### -### leakages when using DriverManagerConnectionProvider ### -#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace - -### enable spring -#log4j.logger.org.springframework=info -#log4j.logger.org.springframework.transaction=debug -#log4j.logger.org.springframework.jdbc.core=debug -#log4j.logger.org.springframework.orm=debug - -### debug your specific package or classes with the following example -log4j.logger.org.springframework.jdbc=info -#log4j.logger.org.springframework.batch=debug -log4j.logger.org.springframework.batch.sample=debug diff --git a/spring-batch-samples/src/main/resources/org/springframework/batch/sample/restart/fail/data/restartFile.csv b/spring-batch-samples/src/main/resources/org/springframework/batch/sample/restart/fail/data/restartFile.csv deleted file mode 100644 index 91ee47203..000000000 --- a/spring-batch-samples/src/main/resources/org/springframework/batch/sample/restart/fail/data/restartFile.csv +++ /dev/null @@ -1,20 +0,0 @@ -customer1,10 -customer2,20 -customer3,30 -customer4,40 -customer5,50 -customer6,60 -customer7,70 -customer8,80 -customer9,90 -customer10,100 -customer11,110 -customer12,120 -customer13,130 -customer14,140 -customer15,150 -customer16,160 -customer17,170 -customer18,180 -customer19,190 -customer20,200 diff --git a/spring-batch-samples/src/main/resources/org/springframework/batch/sample/restart/fail/job/restartFileSampleJob.xml b/spring-batch-samples/src/main/resources/org/springframework/batch/sample/restart/fail/job/restartFileSampleJob.xml deleted file mode 100644 index 65f13a7b5..000000000 --- a/spring-batch-samples/src/main/resources/org/springframework/batch/sample/restart/fail/job/restartFileSampleJob.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-batch-samples/src/main/sql/db2.properties b/spring-batch-samples/src/main/sql/db2.properties deleted file mode 100644 index bb81339ef..000000000 --- a/spring-batch-samples/src/main/sql/db2.properties +++ /dev/null @@ -1,11 +0,0 @@ -platform=db2 -# SQL language oddities -BIGINT = BIGINT -IDENTITY = -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = BLOB -TIMESTAMP = TIMESTAMP -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = SEQUENCE diff --git a/spring-batch-samples/src/main/sql/derby.properties b/spring-batch-samples/src/main/sql/derby.properties deleted file mode 100644 index c2a4175f1..000000000 --- a/spring-batch-samples/src/main/sql/derby.properties +++ /dev/null @@ -1,12 +0,0 @@ -platform=db2 -# SQL language oddities -BIGINT = BIGINT -IDENTITY = -GENERATED = GENERATED BY DEFAULT AS IDENTITY -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = BLOB -TIMESTAMP = TIMESTAMP -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = TABLE diff --git a/spring-batch-samples/src/main/sql/h2.properties b/spring-batch-samples/src/main/sql/h2.properties deleted file mode 100644 index a613a5aa9..000000000 --- a/spring-batch-samples/src/main/sql/h2.properties +++ /dev/null @@ -1,12 +0,0 @@ -platform=h2 -# SQL language oddities -BIGINT = BIGINT -IDENTITY = IDENTITY -IFEXISTS = IF EXISTS -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = LONGVARBINARY -TIMESTAMP = TIMESTAMP -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = SEQUENCE diff --git a/spring-batch-samples/src/main/sql/hana.properties b/spring-batch-samples/src/main/sql/hana.properties deleted file mode 100644 index 61dc0ff4c..000000000 --- a/spring-batch-samples/src/main/sql/hana.properties +++ /dev/null @@ -1,12 +0,0 @@ -platform=hana -# SQL language oddities -BIGINT = BIGINT -IDENTITY = -GENERATED = GENERATED BY DEFAULT AS IDENTITY -DOUBLE = DOUBLE -DECIMAL = DECIMAL -BLOB = BLOB -TIMESTAMP = TIMESTAMP -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = SEQUENCE diff --git a/spring-batch-samples/src/main/sql/hsqldb.properties b/spring-batch-samples/src/main/sql/hsqldb.properties deleted file mode 100644 index 7fd959770..000000000 --- a/spring-batch-samples/src/main/sql/hsqldb.properties +++ /dev/null @@ -1,12 +0,0 @@ -platform=hsqldb -# SQL language oddities -BIGINT = BIGINT -IDENTITY = IDENTITY -IFEXISTS = IF EXISTS -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = LONGVARBINARY -TIMESTAMP = TIMESTAMP -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = TABLE diff --git a/spring-batch-samples/src/main/sql/mysql.properties b/spring-batch-samples/src/main/sql/mysql.properties deleted file mode 100644 index e498ef01b..000000000 --- a/spring-batch-samples/src/main/sql/mysql.properties +++ /dev/null @@ -1,14 +0,0 @@ -platform=mysql -# SQL language oddities -BIGINT = BIGINT -IDENTITY = -GENERATED = -VOODOO = engine=InnoDB -IFEXISTSBEFORE = IF EXISTS -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = BLOB -TIMESTAMP = DATETIME -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = TABLE diff --git a/spring-batch-samples/src/main/sql/oracle.properties b/spring-batch-samples/src/main/sql/oracle.properties deleted file mode 100644 index e76bb816a..000000000 --- a/spring-batch-samples/src/main/sql/oracle.properties +++ /dev/null @@ -1,12 +0,0 @@ -platform=oracle -# SQL language oddities -BIGINT = NUMBER(38) -IDENTITY = -GENERATED = -DOUBLE = NUMBER -DECIMAL = DECIMAL -BLOB = BLOB -TIMESTAMP = TIMESTAMP -VARCHAR = VARCHAR2 -# for generating drop statements... -SEQUENCE = SEQUENCE diff --git a/spring-batch-samples/src/main/sql/postgresql.properties b/spring-batch-samples/src/main/sql/postgresql.properties deleted file mode 100644 index e67552c2b..000000000 --- a/spring-batch-samples/src/main/sql/postgresql.properties +++ /dev/null @@ -1,12 +0,0 @@ -platform=postgresql -# SQL language oddities -BIGINT = BIGINT -IDENTITY = -GENERATED = -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = BYTEA -TIMESTAMP = TIMESTAMP -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = SEQUENCE diff --git a/spring-batch-samples/src/main/sql/sqlserver.properties b/spring-batch-samples/src/main/sql/sqlserver.properties deleted file mode 100644 index 14f0977b0..000000000 --- a/spring-batch-samples/src/main/sql/sqlserver.properties +++ /dev/null @@ -1,11 +0,0 @@ -# SQL language oddities -BIGINT = BIGINT -IDENTITY = -GENERATED = -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = IMAGE -TIMESTAMP = DATETIME -VARCHAR = VARCHAR -# for generating drop statements... -SEQUENCE = TABLE diff --git a/spring-batch-samples/src/main/sql/sybase.properties b/spring-batch-samples/src/main/sql/sybase.properties deleted file mode 100644 index 0b7f014a6..000000000 --- a/spring-batch-samples/src/main/sql/sybase.properties +++ /dev/null @@ -1,12 +0,0 @@ -# SQL language oddities -BIGINT = BIGINT -IDENTITY = -GENERATED = -DOUBLE = DOUBLE PRECISION -DECIMAL = DECIMAL -BLOB = IMAGE -TIMESTAMP = DATETIME -VARCHAR = VARCHAR -NULL = NULL -# for generating drop statements... -SEQUENCE = TABLE diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/HibernateFailureJobFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/HibernateFailureJobFunctionalTests.java deleted file mode 100644 index 7ee7c1e8e..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/HibernateFailureJobFunctionalTests.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright 2007-2023 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.batch.sample; - -import java.math.BigDecimal; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import org.junit.jupiter.api.Test; - -import org.springframework.batch.core.JobParameters; -import org.springframework.batch.core.JobParametersBuilder; -import org.springframework.batch.sample.domain.trade.internal.CustomerCreditIncreaseProcessor; -import org.springframework.batch.sample.domain.trade.internal.HibernateCreditDao; -import org.springframework.batch.test.JobLauncherTestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.UncategorizedSQLException; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowCallbackHandler; -import org.springframework.orm.hibernate5.HibernateJdbcException; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.test.jdbc.JdbcTestUtils; -import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.transaction.support.TransactionCallback; -import org.springframework.transaction.support.TransactionTemplate; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; - -/** - * Test for HibernateJob - checks that customer credit has been updated to expected value. - * - * @author Dave Syer - * @author Mahmoud Ben Hassine - * @author Glenn Renfro - */ - -@SpringJUnitConfig(locations = { "/simple-job-launcher-context.xml", "/hibernate-context.xml", "/jobs/hibernateJob.xml", - "/job-runner-context.xml" }) -class HibernateFailureJobFunctionalTests { - - private static final BigDecimal CREDIT_INCREASE = CustomerCreditIncreaseProcessor.FIXED_AMOUNT; - - private static final String ALL_CUSTOMERS = "select * from CUSTOMER order by ID"; - - private static final String CREDIT_COLUMN = "CREDIT"; - - private static final String[] customers = { - "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (1, 0, 'customer1', 100000)", - "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (2, 0, 'customer2', 100000)", - "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (3, 0, 'customer3', 100000)", - "INSERT INTO CUSTOMER (id, version, name, credit) VALUES (4, 0, 'customer4', 100000)" }; - - protected static final String ID_COLUMN = "ID"; - - @Autowired - private HibernateCreditDao writer; - - private JdbcTemplate jdbcTemplate; - - @Autowired - private PlatformTransactionManager transactionManager; - - private List creditsBeforeUpdate; - - @Autowired - private JobLauncherTestUtils jobLauncherTestUtils; - - @Autowired - public void setDataSource(DataSource dataSource) { - this.jdbcTemplate = new JdbcTemplate(dataSource); - } - - @Test - void testLaunchJob() throws Exception { - validatePreConditions(); - - JobParameters params = new JobParametersBuilder().addString("key", "failureJob").toJobParameters(); - writer.setFailOnFlush(2); - - try { - jobLauncherTestUtils.launchJob(params); - } - catch (HibernateJdbcException e) { - // This is what would happen if the flush happened outside the - // RepeatContext: - throw e; - } - catch (UncategorizedSQLException e) { - // This is what would happen if the job wasn't configured to skip - // exceptions at the step level. - // assertEquals(1, writer.getErrors().size()); - throw e; - } - - int after = JdbcTestUtils.countRowsInTable(jdbcTemplate, "CUSTOMER"); - assertEquals(4, after); - - validatePostConditions(); - } - - /** - * All customers have the same credit - */ - protected void validatePreConditions() { - ensureState(); - creditsBeforeUpdate = new TransactionTemplate(transactionManager) - .execute(status -> jdbcTemplate.query(ALL_CUSTOMERS, (rs, rowNum) -> rs.getBigDecimal(CREDIT_COLUMN))); - } - - /* - * Ensure the state of the database is accurate by delete all the contents of the - * customer table and reading the expected defaults. - */ - private void ensureState() { - new TransactionTemplate(transactionManager).execute((TransactionCallback) status -> { - JdbcTestUtils.deleteFromTables(jdbcTemplate, "CUSTOMER"); - for (String customer : customers) { - jdbcTemplate.update(customer); - } - return null; - }); - } - - /** - * Credit was increased by CREDIT_INCREASE - */ - protected void validatePostConditions() { - final List matches = new ArrayList<>(); - - new TransactionTemplate(transactionManager).execute((TransactionCallback) status -> { - jdbcTemplate.query(ALL_CUSTOMERS, new RowCallbackHandler() { - private int i = 0; - - @Override - public void processRow(ResultSet rs) throws SQLException { - final BigDecimal creditBeforeUpdate = creditsBeforeUpdate.get(i++); - final BigDecimal expectedCredit = creditBeforeUpdate.add(CREDIT_INCREASE); - if (expectedCredit.equals(rs.getBigDecimal(CREDIT_COLUMN))) { - matches.add(rs.getBigDecimal(ID_COLUMN)); - } - } - - }); - - return null; - }); - - assertEquals((creditsBeforeUpdate.size() - 1), matches.size()); - assertFalse(matches.contains(new BigDecimal(2))); - } - -} diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/domain/trade/internal/JdbcCustomerDebitDaoTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/domain/trade/internal/JdbcCustomerDebitDaoTests.java deleted file mode 100644 index a1bf96dc1..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/domain/trade/internal/JdbcCustomerDebitDaoTests.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2006-2023 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.batch.sample.domain.trade.internal; - -import java.math.BigDecimal; - -import javax.sql.DataSource; - -import org.junit.jupiter.api.Test; - -import org.springframework.batch.sample.domain.trade.CustomerDebit; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.core.JdbcOperations; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.transaction.annotation.Transactional; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -@SpringJUnitConfig(locations = "classpath:jobs/JdbcCustomerDebitDaoTests-context.xml") -class JdbcCustomerDebitDaoTests { - - private JdbcOperations jdbcTemplate; - - @Autowired - private JdbcCustomerDebitDao writer; - - @Autowired - public void setDataSource(DataSource dataSource) { - this.jdbcTemplate = new JdbcTemplate(dataSource); - } - - @Test - @Transactional - void testWrite() { - jdbcTemplate.execute("INSERT INTO CUSTOMER VALUES (99, 0, 'testName', 100)"); - - CustomerDebit customerDebit = new CustomerDebit(); - customerDebit.setName("testName"); - customerDebit.setDebit(BigDecimal.valueOf(5)); - - writer.write(customerDebit); - - jdbcTemplate.query("SELECT name, credit FROM CUSTOMER WHERE name = 'testName'", rs -> { - assertEquals(95, rs.getLong("credit")); - }); - } - -} diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/AbstractIoSampleTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/AbstractIoSampleTests.java deleted file mode 100644 index ba38403fd..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/AbstractIoSampleTests.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2008-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.batch.sample.iosample; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.jupiter.api.Test; - -import org.springframework.batch.core.BatchStatus; -import org.springframework.batch.core.JobExecution; -import org.springframework.batch.core.JobParameters; -import org.springframework.batch.core.JobParametersBuilder; -import org.springframework.batch.core.StepExecution; -import org.springframework.batch.item.ExecutionContext; -import org.springframework.batch.item.ItemReader; -import org.springframework.batch.item.ItemStream; -import org.springframework.batch.sample.domain.trade.CustomerCredit; -import org.springframework.batch.sample.domain.trade.internal.CustomerCreditIncreaseProcessor; -import org.springframework.batch.test.JobLauncherTestUtils; -import org.springframework.batch.test.MetaDataInstanceFactory; -import org.springframework.batch.test.StepScopeTestExecutionListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.TestExecutionListeners; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.test.context.support.DependencyInjectionTestExecutionListener; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -/** - * Base class for IoSample tests that increase input customer credit by fixed amount. - * Assumes inputs and outputs are in the same format and uses the job's {@link ItemReader} - * to parse the outputs. - * - * @author Robert Kasanicky - * @author Mahmoud Ben Hassine - */ -@SpringJUnitConfig( - locations = { "/simple-job-launcher-context.xml", "/job-runner-context.xml", "/jobs/ioSampleJob.xml" }) -@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, StepScopeTestExecutionListener.class }) -abstract class AbstractIoSampleTests { - - @Autowired - private JobLauncherTestUtils jobLauncherTestUtils; - - @Autowired - private ItemReader reader; - - /** - * Check the resulting credits correspond to inputs increased by fixed amount. - */ - @Test - void testUpdateCredit() throws Exception { - open(reader); - List inputs = getCredits(reader); - close(reader); - - JobExecution jobExecution = jobLauncherTestUtils.launchJob(getUniqueJobParameters()); - assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); - - pointReaderToOutput(reader); - open(reader); - List outputs = getCredits(reader); - close(reader); - - assertEquals(inputs.size(), outputs.size()); - int itemCount = inputs.size(); - assertTrue(itemCount > 0); - - for (int i = 0; i < itemCount; i++) { - assertEquals(inputs.get(i).getCredit().add(CustomerCreditIncreaseProcessor.FIXED_AMOUNT).intValue(), - outputs.get(i).getCredit().intValue()); - } - - } - - protected JobParameters getUniqueJobParameters() { - return jobLauncherTestUtils.getUniqueJobParameters(); - } - - protected JobParametersBuilder getUniqueJobParametersBuilder() { - return jobLauncherTestUtils.getUniqueJobParametersBuilder(); - } - - /** - * Configure the reader to read outputs (if necessary). Required for file-to-file jobs - * jobs, usually no-op for database jobs where inputs are updated (rather than outputs - * created). - */ - protected abstract void pointReaderToOutput(ItemReader reader); - - /** - * Read all credits using the provided reader. - */ - private List getCredits(ItemReader reader) throws Exception { - CustomerCredit credit; - List result = new ArrayList<>(); - while ((credit = reader.read()) != null) { - result.add(credit); - } - return result; - - } - - /** - * Open the reader if applicable. - */ - private void open(ItemReader reader) { - if (reader instanceof ItemStream) { - ((ItemStream) reader).open(new ExecutionContext()); - } - } - - /** - * Close the reader if applicable. - */ - private void close(ItemReader reader) { - if (reader instanceof ItemStream) { - ((ItemStream) reader).close(); - } - } - - /** - * Create a {@link StepExecution} that can be used to satisfy step scoped dependencies - * in the test itself (not in the job it launches). - * @return a {@link StepExecution} - */ - protected StepExecution getStepExecution() { - return MetaDataInstanceFactory.createStepExecution(getUniqueJobParameters()); - } - -} diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/HibernateFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/HibernateFunctionalTests.java deleted file mode 100644 index 45f8047d7..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/HibernateFunctionalTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2008-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.batch.sample.iosample; - -import org.springframework.batch.item.ItemReader; -import org.springframework.batch.sample.domain.trade.CustomerCredit; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; - -@SpringJUnitConfig(locations = { "/hibernate-context.xml", "/jobs/iosample/hibernate.xml" }) -class HibernateFunctionalTests extends AbstractIoSampleTests { - - @Override - protected void pointReaderToOutput(ItemReader reader) { - // no-op - } - -} diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/internal/TradeCustomerItemWriter.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/internal/TradeCustomerItemWriter.java deleted file mode 100644 index dd7c4a7fd..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/iosample/internal/TradeCustomerItemWriter.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2006-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.batch.sample.iosample.internal; - -import java.math.BigDecimal; - -import org.springframework.batch.item.Chunk; -import org.springframework.batch.item.ItemWriter; -import org.springframework.batch.sample.domain.trade.CustomerCredit; -import org.springframework.batch.sample.domain.trade.Trade; -import org.springframework.batch.sample.domain.trade.TradeDao; - -/** - * @author Dan Garrette - * @author Mahmoud Ben Hassine - * @since 2.0 - */ -public class TradeCustomerItemWriter implements ItemWriter { - - private TradeDao dao; - - private int count; - - @Override - public void write(Chunk items) throws Exception { - for (CustomerCredit c : items) { - Trade t = new Trade("ISIN" + count++, 100, new BigDecimal("1.50"), c.getName()); - this.dao.writeTrade(t); - } - } - - public void setDao(TradeDao dao) { - this.dao = dao; - } - -} diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/jdbc/TwoJobInstancesPagingFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/jdbc/TwoJobInstancesPagingFunctionalTests.java deleted file mode 100644 index f19a61e62..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/jdbc/TwoJobInstancesPagingFunctionalTests.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2006-2023 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.batch.sample.jdbc; - -import java.util.Date; - -import javax.sql.DataSource; - -import org.junit.jupiter.api.Test; - -import org.springframework.batch.core.BatchStatus; -import org.springframework.batch.core.Job; -import org.springframework.batch.core.JobExecution; -import org.springframework.batch.core.JobParameters; -import org.springframework.batch.core.JobParametersBuilder; -import org.springframework.batch.core.launch.JobLauncher; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.test.jdbc.JdbcTestUtils; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotSame; - -/** - * @author Dave Syer - * @author Mahmoud Ben Hassine - * @author Glenn Renfro - * @since 2.0 - */ -@SpringJUnitConfig( - locations = { "/simple-job-launcher-context.xml", "/org/springframework/batch/sample/jdbc/job/jdbcPaging.xml" }) -class TwoJobInstancesPagingFunctionalTests { - - @Autowired - private JobLauncher launcher; - - @Autowired - private Job job; - - private JdbcTemplate jdbcTemplate; - - @Autowired - public void setDataSource(DataSource dataSource) { - jdbcTemplate = new JdbcTemplate(dataSource); - } - - @Test - void testLaunchJobTwice() throws Exception { - int first = JdbcTestUtils.countRowsInTableWhere(jdbcTemplate, "CUSTOMER", "credit>1000"); - JobExecution jobExecution = launcher.run(this.job, getJobParameters(1000.)); - assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); - assertEquals(first, jobExecution.getStepExecutions().iterator().next().getWriteCount()); - int second = JdbcTestUtils.countRowsInTableWhere(jdbcTemplate, "CUSTOMER", "credit>1000000"); - assertNotSame(first, second, "The number of records above the threshold did not change"); - jobExecution = launcher.run(this.job, getJobParameters(1000000.)); - assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); - assertEquals(second, jobExecution.getStepExecutions().iterator().next().getWriteCount()); - } - - protected JobParameters getJobParameters(double amount) { - return new JobParametersBuilder().addLong("timestamp", new Date().getTime()) - .addDouble("credit", amount) - .toJobParameters(); - } - -} diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/restart/fail/RestartFileSampleFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/restart/fail/RestartFileSampleFunctionalTests.java deleted file mode 100644 index 127a8183b..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/restart/fail/RestartFileSampleFunctionalTests.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2006-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.batch.sample.restart.fail; - -import java.nio.file.Files; -import java.nio.file.Path; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import org.springframework.batch.core.BatchStatus; -import org.springframework.batch.core.JobExecution; -import org.springframework.batch.core.JobParameters; -import org.springframework.batch.item.Chunk; -import org.springframework.batch.item.file.FlatFileItemWriter; -import org.springframework.batch.sample.domain.trade.CustomerCredit; -import org.springframework.batch.test.JobLauncherTestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.Resource; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * @author Dan Garrette - * @author Mahmoud Ben Hassine - * @author Glenn Renfro - * @since 2.0 - */ -@SpringJUnitConfig(locations = { "/simple-job-launcher-context.xml", - "/org/springframework/batch/sample/restart/fail/job/restartFileSampleJob.xml", "/job-runner-context.xml" }) -class RestartFileSampleFunctionalTests { - - @Autowired - private Resource outputResource; - - @Autowired - private JobLauncherTestUtils jobLauncherTestUtils; - - @Test - void runTest() throws Exception { - JobParameters jobParameters = jobLauncherTestUtils.getUniqueJobParameters(); - - JobExecution je1 = jobLauncherTestUtils.launchJob(jobParameters); - assertEquals(BatchStatus.FAILED, je1.getStatus()); - Path outputResourceFile = outputResource.getFile().toPath(); - Assertions.assertEquals(10, Files.lines(outputResourceFile).count()); - - JobExecution je2 = jobLauncherTestUtils.launchJob(jobParameters); - assertEquals(BatchStatus.COMPLETED, je2.getStatus()); - outputResourceFile = outputResource.getFile().toPath(); - Assertions.assertEquals(20, Files.lines(outputResourceFile).count()); - } - - static class CustomerCreditFlatFileItemWriter extends FlatFileItemWriter { - - private boolean failed = false; - - @Override - public void write(Chunk arg0) throws Exception { - for (CustomerCredit cc : arg0) { - if (!failed && cc.getName().equals("customer13")) { - failed = true; - throw new RuntimeException(); - } - } - super.write(arg0); - } - - } - -} \ No newline at end of file diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/restart/stop/DatabaseShutdownFunctionalTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/restart/stop/DatabaseShutdownFunctionalTests.java deleted file mode 100644 index 471d82afa..000000000 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/restart/stop/DatabaseShutdownFunctionalTests.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2006-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.batch.sample.restart.stop; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.junit.jupiter.api.Test; - -import org.springframework.batch.core.BatchStatus; -import org.springframework.batch.core.JobExecution; -import org.springframework.batch.core.launch.JobOperator; -import org.springframework.batch.test.JobLauncherTestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -/** - * Functional test for graceful shutdown. A batch container is started in a new thread, - * then it's stopped using {@link JobOperator#stop(long)}}. - * - * @author Lucas Ward - * @author Mahmoud Ben Hassine - * @author Glenn Renfro - * - */ - -@SpringJUnitConfig(locations = { "/simple-job-launcher-context.xml", - "/org/springframework/batch/sample/restart/stop/stopRestartSample.xml", "/job-runner-context.xml" }) -class DatabaseShutdownFunctionalTests { - - /** Logger */ - protected final Log logger = LogFactory.getLog(getClass()); - - @Autowired - private JobOperator jobOperator; - - @Autowired - private JobLauncherTestUtils jobLauncherTestUtils; - - @Test - void testLaunchJob() throws Exception { - JobExecution jobExecution = jobLauncherTestUtils.launchJob(); - - Thread.sleep(1000); - - assertEquals(BatchStatus.STARTED, jobExecution.getStatus()); - assertTrue(jobExecution.isRunning()); - assertNotNull(jobExecution.getVersion()); - - jobOperator.stop(jobExecution.getId()); - - int count = 0; - while (jobExecution.isRunning() && count <= 10) { - logger.info("Checking for end time in JobExecution: count=" + count); - Thread.sleep(100); - count++; - } - - assertFalse(jobExecution.isRunning(), "Timed out waiting for job to end."); - assertEquals(BatchStatus.STOPPED, jobExecution.getStatus()); - - } - -}