Purge ItemProcessor
This commit is contained in:
@@ -6,7 +6,7 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.sample.item.processor.CustomerCreditIncreaseWriter;
|
||||
import org.springframework.batch.sample.item.writer.CustomerCreditIncreaseWriter;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.springframework.batch.sample;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.batch.sample.item.processor.StagingItemWriter;
|
||||
import org.springframework.batch.sample.item.writer.StagingItemWriter;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class FlatFileOrderWriterTests extends TestCase {
|
||||
//create map of aggregators and set it to writer
|
||||
Map aggregators = new HashMap();
|
||||
|
||||
OrderConverter converter = new OrderConverter();
|
||||
OrderTransformer converter = new OrderTransformer();
|
||||
aggregators.put("header", aggregator);
|
||||
aggregators.put("customer", aggregator);
|
||||
aggregators.put("address", aggregator);
|
||||
@@ -68,7 +68,7 @@ public class FlatFileOrderWriterTests extends TestCase {
|
||||
aggregators.put("item", aggregator);
|
||||
aggregators.put("footer", aggregator);
|
||||
converter.setAggregators(aggregators);
|
||||
writer.setConverter(converter);
|
||||
writer.setTransformer(converter);
|
||||
|
||||
//call tested method
|
||||
writer.write(order);
|
||||
|
||||
@@ -33,9 +33,9 @@ import org.springframework.batch.sample.domain.Order;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class OrderConverterTests extends TestCase {
|
||||
public class OrderTransformerTests extends TestCase {
|
||||
|
||||
private OrderConverter converter = new OrderConverter();
|
||||
private OrderTransformer converter = new OrderTransformer();
|
||||
|
||||
public void testConvert() throws Exception {
|
||||
converter.setAggregators(new HashMap() {
|
||||
@@ -55,7 +55,7 @@ public class OrderConverterTests extends TestCase {
|
||||
order.setBilling(new BillingInfo());
|
||||
order.setLineItems(Collections.EMPTY_LIST);
|
||||
order.setTotalPrice(BigDecimal.TEN);
|
||||
Object result = converter.convert(order);
|
||||
Object result = converter.transform(order);
|
||||
assertTrue(result instanceof Collection);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import junit.framework.TestCase;
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.sample.dao.CustomerCreditDao;
|
||||
import org.springframework.batch.sample.domain.CustomerCredit;
|
||||
import org.springframework.batch.sample.item.writer.CustomerCreditIncreaseWriter;
|
||||
|
||||
/**
|
||||
* Tests for {@link CustomerCreditIncreaseWriter}.
|
||||
|
||||
@@ -7,7 +7,7 @@ import junit.framework.TestCase;
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.sample.dao.CustomerCreditDao;
|
||||
import org.springframework.batch.sample.domain.CustomerCredit;
|
||||
import org.springframework.batch.sample.item.processor.CustomerCreditUpdateWriter;
|
||||
import org.springframework.batch.sample.item.writer.CustomerCreditUpdateWriter;
|
||||
|
||||
public class CustomerCreditUpdateProcessorTests extends TestCase {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import junit.framework.TestCase;
|
||||
import org.springframework.batch.sample.dao.JdbcCustomerDebitWriter;
|
||||
import org.springframework.batch.sample.domain.CustomerDebit;
|
||||
import org.springframework.batch.sample.domain.Trade;
|
||||
import org.springframework.batch.sample.item.processor.CustomerUpdateWriter;
|
||||
import org.springframework.batch.sample.item.writer.CustomerUpdateWriter;
|
||||
|
||||
public class CustomerUpdateProcessorTests extends TestCase {
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.easymock.MockControl;
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.domain.Order;
|
||||
import org.springframework.batch.sample.item.writer.OrderWriter;
|
||||
|
||||
public class OrderWriterTests extends TestCase {
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.springframework.batch.core.domain.StepExecution;
|
||||
import org.springframework.batch.core.domain.StepInstance;
|
||||
import org.springframework.batch.execution.scope.SimpleStepContext;
|
||||
import org.springframework.batch.execution.scope.StepSynchronizationManager;
|
||||
import org.springframework.batch.sample.item.writer.StagingItemWriter;
|
||||
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import junit.framework.TestCase;
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.sample.dao.TradeDao;
|
||||
import org.springframework.batch.sample.domain.Trade;
|
||||
import org.springframework.batch.sample.item.writer.TradeWriter;
|
||||
|
||||
public class TradeProcessorTests extends TestCase {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.batch.execution.scope.StepSynchronizationManager;
|
||||
import org.springframework.batch.repeat.context.RepeatContextSupport;
|
||||
import org.springframework.batch.repeat.synch.BatchTransactionSynchronizationManager;
|
||||
import org.springframework.batch.repeat.synch.RepeatSynchronizationManager;
|
||||
import org.springframework.batch.sample.item.processor.StagingItemWriter;
|
||||
import org.springframework.batch.sample.item.writer.StagingItemWriter;
|
||||
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user