Hopefully fix FieldSet changes (uncommitted) and add also some work in progress on JobLauncher interface change
This commit is contained in:
@@ -22,8 +22,8 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.batch.core.domain.Step;
|
||||
import org.springframework.batch.core.domain.StepExecution;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.reader.AbstractItemReader;
|
||||
import org.springframework.batch.item.validator.Validator;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.Address;
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.BillingInfo;
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.Customer;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.Game;
|
||||
|
||||
public class GameMapper implements FieldSetMapper {
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.Order;
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.LineItem;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.Player;
|
||||
|
||||
public class PlayerMapper implements FieldSetMapper {
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.sample.domain.ShippingInfo;
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.item.reader.AggregateItemReader;
|
||||
import org.springframework.batch.sample.domain.Trade;
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
-- Autogenerated: do not edit this file
|
||||
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 ;
|
||||
|
||||
-- Autogenerated: do not edit this file
|
||||
|
||||
CREATE TABLE CUSTOMER_SEQ (ID BIGINT NOT NULL) type=MYISAM;
|
||||
INSERT INTO CUSTOMER_SEQ values(0);
|
||||
CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT NOT NULL) type=MYISAM;
|
||||
INSERT INTO BATCH_STAGING_SEQ values(0);
|
||||
CREATE TABLE TRADE_SEQ (ID BIGINT NOT NULL) type=MYISAM;
|
||||
INSERT INTO TRADE_SEQ values(0);
|
||||
|
||||
CREATE TABLE BATCH_STAGING (
|
||||
ID BIGINT unsigned PRIMARY KEY ,
|
||||
JOB_ID BIGINT NOT NULL,
|
||||
VALUE ${BLOB} NOT NULL,
|
||||
PROCESSED CHAR(1) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE TRADE (
|
||||
ID BIGINT unsigned PRIMARY KEY ,
|
||||
VERSION BIGINT,
|
||||
ISIN VARCHAR(45) NOT NULL,
|
||||
QUANTITY BIGINT,
|
||||
PRICE FLOAT,
|
||||
CUSTOMER VARCHAR(45)
|
||||
);
|
||||
|
||||
CREATE TABLE CUSTOMER (
|
||||
ID BIGINT unsigned PRIMARY KEY ,
|
||||
VERSION BIGINT,
|
||||
NAME VARCHAR(45),
|
||||
CREDIT FLOAT
|
||||
);
|
||||
|
||||
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
|
||||
);
|
||||
@@ -138,8 +138,6 @@
|
||||
<bean
|
||||
class="org.springframework.core.task.SimpleAsyncTaskExecutor" />
|
||||
</property>
|
||||
<property name="autoStart" value="false" />
|
||||
<property name="jobName" value="loopJob" />
|
||||
</bean>
|
||||
|
||||
<bean id="loader"
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.core.executor.StepInterruptedException;
|
||||
import org.springframework.batch.core.runtime.SimpleJobIdentifier;
|
||||
|
||||
/**
|
||||
* Functional test for graceful shutdown. A batch container is started in a new thread,
|
||||
@@ -40,7 +41,7 @@ public class GracefulShutdownFunctionalTest extends AbstractBatchLauncherTests {
|
||||
Thread jobThread = new Thread(){
|
||||
public void run(){
|
||||
try {
|
||||
launcher.run(getJobName());
|
||||
launcher.run(new SimpleJobIdentifier(getJobName()));
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
if (!(e.getCause() instanceof StepInterruptedException)) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.batch.sample;
|
||||
|
||||
import org.springframework.batch.core.runtime.SimpleJobIdentifier;
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
|
||||
@@ -81,7 +82,7 @@ public class RestartFunctionalTests extends AbstractBatchLauncherTests {
|
||||
|
||||
// load the application context and launch the job
|
||||
private void runJob() throws Exception, Exception {
|
||||
launcher.run(getJobName());
|
||||
launcher.run(new SimpleJobIdentifier(getJobName()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user