OPEN - issue BATCH-1401: All inserts of JobId should be of Types.BIGINT
Fixed samples to work with MySQL (except customer filter job)
This commit is contained in:
@@ -35,12 +35,12 @@ public abstract class AbstractCustomerCreditIncreaseTests extends AbstractValida
|
||||
|
||||
private static final BigDecimal CREDIT_INCREASE = CustomerCreditIncreaseProcessor.FIXED_AMOUNT;
|
||||
|
||||
private static 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)"};
|
||||
private static 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)"};
|
||||
|
||||
private static String DELETE_CUSTOMERS = "DELETE FROM customer";
|
||||
private static String DELETE_CUSTOMERS = "DELETE FROM CUSTOMER";
|
||||
|
||||
private static final String ALL_CUSTOMERS = "select * from CUSTOMER order by ID";
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@ContextConfiguration()
|
||||
public class CompositeItemWriterSampleFunctionalTests extends AbstractValidatingBatchLauncherTests {
|
||||
|
||||
private static final String GET_TRADES = "SELECT isin, quantity, price, customer FROM trade order by isin";
|
||||
private static final String GET_TRADES = "SELECT isin, quantity, price, customer FROM TRADE order by isin";
|
||||
|
||||
private static final String EXPECTED_OUTPUT_FILE = "Trade: [isin=UK21341EAH41,quantity=211,price=31.11,customer=customer1]"
|
||||
+ "Trade: [isin=UK21341EAH42,quantity=212,price=32.11,customer=customer2]"
|
||||
|
||||
@@ -60,7 +60,8 @@ public class CustomerFilterJobFunctionalTests extends AbstractJobTests {
|
||||
public void onSetUp() throws Exception {
|
||||
simpleJdbcTemplate.update("delete from TRADE");
|
||||
simpleJdbcTemplate.update("delete from CUSTOMER where ID > 4");
|
||||
List<Map<String, Object>> list = simpleJdbcTemplate.queryForList("select name, CREDIT from customer");
|
||||
simpleJdbcTemplate.update("update CUSTOMER set credit=100000");
|
||||
List<Map<String, Object>> list = simpleJdbcTemplate.queryForList("select name, CREDIT from CUSTOMER");
|
||||
for (Map<String, Object> map : list) {
|
||||
credits.put((String) map.get("NAME"), ((Number) map.get("CREDIT")).doubleValue());
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class TradeJobFunctionalTests extends AbstractValidatingBatchLauncherTest
|
||||
@Before
|
||||
public void onSetUp() throws Exception {
|
||||
simpleJdbcTemplate.update("delete from TRADE");
|
||||
List<Map<String, Object>> list = simpleJdbcTemplate.queryForList("select name, CREDIT from customer");
|
||||
List<Map<String, Object>> list = simpleJdbcTemplate.queryForList("select name, CREDIT from CUSTOMER");
|
||||
for (Map<String, Object> map : list) {
|
||||
credits.put((String) map.get("NAME"), ((Number) map.get("CREDIT")).doubleValue());
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class JdbcCustomerDebitDaoTests {
|
||||
public void testWrite() {
|
||||
|
||||
//insert customer credit
|
||||
simpleJdbcTemplate.getJdbcOperations().execute("INSERT INTO customer VALUES (99, 0, 'testName', 100)");
|
||||
simpleJdbcTemplate.getJdbcOperations().execute("INSERT INTO CUSTOMER VALUES (99, 0, 'testName', 100)");
|
||||
|
||||
//create customer debit
|
||||
CustomerDebit customerDebit = new CustomerDebit();
|
||||
@@ -62,7 +62,7 @@ public class JdbcCustomerDebitDaoTests {
|
||||
writer.write(customerDebit);
|
||||
|
||||
//verify customer credit
|
||||
simpleJdbcTemplate.getJdbcOperations().query("SELECT name, credit FROM customer WHERE name = 'testName'",
|
||||
simpleJdbcTemplate.getJdbcOperations().query("SELECT name, credit FROM CUSTOMER WHERE name = 'testName'",
|
||||
new RowCallbackHandler() {
|
||||
public void processRow(ResultSet rs) throws SQLException {
|
||||
assertEquals(95, rs.getLong("credit"));
|
||||
|
||||
Reference in New Issue
Block a user