IN PROGRESS - BATCH-693: Refactor samples along domain contours

This commit is contained in:
robokaso
2008-07-25 11:01:21 +00:00
parent f58b33f83c
commit 925fdd3bc6
93 changed files with 373 additions and 308 deletions

View File

@@ -22,6 +22,8 @@ import java.util.List;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.batch.sample.order.Address;
import org.springframework.batch.sample.order.Child;
public class Person {

View File

@@ -21,6 +21,8 @@ import java.util.List;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.order.Address;
import org.springframework.batch.sample.order.Child;
/**
* Custom class that contains logic that would normally be be contained in

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.order;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.order;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Address;

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.order;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.BillingInfo;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.order;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.order;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.order;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.order;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Customer;

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.order;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Order;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.order;
import java.math.BigDecimal;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.order;
import java.math.BigDecimal;
import java.util.Date;

View File

@@ -14,9 +14,8 @@
* limitations under the License.
*/
package org.springframework.batch.sample.dao;
package org.springframework.batch.sample.order;
import org.springframework.batch.sample.domain.Order;
/**
* Interface for writing <code>Order</code> objects.

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.order;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.LineItem;
public class OrderItemFieldSetMapper implements FieldSetMapper<LineItem> {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.item.reader;
package org.springframework.batch.sample.order;
import java.util.ArrayList;
@@ -24,12 +24,6 @@ import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.support.AbstractItemReader;
import org.springframework.batch.sample.domain.Address;
import org.springframework.batch.sample.domain.BillingInfo;
import org.springframework.batch.sample.domain.Customer;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.domain.Order;
import org.springframework.batch.sample.domain.ShippingInfo;
/**
* @author peter.zozom

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.dao;
package org.springframework.batch.sample.order;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -25,11 +25,6 @@ import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.transform.LineAggregator;
import org.springframework.batch.item.transform.ItemTransformer;
import org.springframework.batch.sample.domain.Address;
import org.springframework.batch.sample.domain.BillingInfo;
import org.springframework.batch.sample.domain.Customer;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.domain.Order;
/**
* Converts <code>Order</code> object to a String.

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.order;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.ShippingInfo;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.order;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.util.Date;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.util.Iterator;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springmodules.validation.valang.functions.AbstractFunction;
import org.springmodules.validation.valang.functions.Function;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.xml;
package org.springframework.batch.sample.order.xml;
import org.apache.commons.lang.builder.ToStringBuilder;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.xml;
package org.springframework.batch.sample.order.xml;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.xml;
package org.springframework.batch.sample.order.xml;
import java.util.Date;
import java.util.List;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.xml;
package org.springframework.batch.sample.order.xml;
/**

View File

@@ -25,7 +25,7 @@
class="org.springframework.batch.item.validator.ValidatingItemReader">
<property name="itemReader">
<bean
class="org.springframework.batch.sample.item.reader.OrderItemReader">
class="org.springframework.batch.sample.order.OrderItemReader">
<property name="fieldSetReader"
ref="fileItemReader" />
<property name="headerMapper"
@@ -55,24 +55,24 @@
<property name="delegate" ref="flatFileTransformerWriter" />
<property name="itemTransformer">
<bean
class="org.springframework.batch.sample.dao.OrderTransformer">
class="org.springframework.batch.sample.order.OrderTransformer">
<property name="aggregators" ref="outputAggregators" />
</bean>
</property>
</bean>
<bean id="headerFieldSetMapper"
class="org.springframework.batch.sample.mapping.HeaderFieldSetMapper" />
class="org.springframework.batch.sample.order.HeaderFieldSetMapper" />
<bean id="customerFieldSetMapper"
class="org.springframework.batch.sample.mapping.CustomerFieldSetMapper" />
class="org.springframework.batch.sample.order.CustomerFieldSetMapper" />
<bean id="addressFieldSetMapper"
class="org.springframework.batch.sample.mapping.AddressFieldSetMapper" />
class="org.springframework.batch.sample.order.AddressFieldSetMapper" />
<bean id="billingFieldSetMapper"
class="org.springframework.batch.sample.mapping.BillingFieldSetMapper" />
class="org.springframework.batch.sample.order.BillingFieldSetMapper" />
<bean id="orderItemFieldSetMapper"
class="org.springframework.batch.sample.mapping.OrderItemFieldSetMapper" />
class="org.springframework.batch.sample.order.OrderItemFieldSetMapper" />
<bean id="shippingFieldSetMapper"
class="org.springframework.batch.sample.mapping.ShippingFieldSetMapper" />
class="org.springframework.batch.sample.order.ShippingFieldSetMapper" />
<bean id="validator"
class="org.springframework.batch.item.validator.SpringValidator">
@@ -131,23 +131,23 @@
<property name="customFunctions">
<map>
<entry key="isFutureDate"
value="org.springframework.batch.sample.validation.valang.custom.FutureDateFunction" />
value="org.springframework.batch.sample.order.valang.FutureDateFunction" />
<entry key="validateTotalItemsCount"
value="org.springframework.batch.sample.validation.valang.custom.TotalOrderItemsFunction" />
value="org.springframework.batch.sample.order.valang.TotalOrderItemsFunction" />
<entry key="validateIds"
value="org.springframework.batch.sample.validation.valang.custom.ValidateIdsFunction" />
value="org.springframework.batch.sample.order.valang.ValidateIdsFunction" />
<entry key="validatePrices"
value="org.springframework.batch.sample.validation.valang.custom.ValidatePricesFunction" />
value="org.springframework.batch.sample.order.valang.ValidatePricesFunction" />
<entry key="validateDiscounts"
value="org.springframework.batch.sample.validation.valang.custom.ValidateDiscountsFunction" />
value="org.springframework.batch.sample.order.valang.ValidateDiscountsFunction" />
<entry key="validateShippingPrices"
value="org.springframework.batch.sample.validation.valang.custom.ValidateShippingPricesFunction" />
value="org.springframework.batch.sample.order.valang.ValidateShippingPricesFunction" />
<entry key="validateHandlingPrices"
value="org.springframework.batch.sample.validation.valang.custom.ValidateHandlingPricesFunction" />
value="org.springframework.batch.sample.order.valang.ValidateHandlingPricesFunction" />
<entry key="validateQuantities"
value="org.springframework.batch.sample.validation.valang.custom.ValidateQuantitiesFunction" />
value="org.springframework.batch.sample.order.valang.ValidateQuantitiesFunction" />
<entry key="validateTotalPrices"
value="org.springframework.batch.sample.validation.valang.custom.ValidateTotalPricesFunction" />
value="org.springframework.batch.sample.order.valang.ValidateTotalPricesFunction" />
</map>
</property>
</bean>

View File

@@ -22,13 +22,13 @@
</type-aliases>
<field-aliases>
<field-alias>
<alias-name>org.springframework.batch.sample.domain.xml.Customer</alias-name>
<type>org.springframework.batch.sample.domain.xml.Order</type>
<alias-name>org.springframework.batch.sample.order.xml.Customer</alias-name>
<type>org.springframework.batch.sample.order.xml.Order</type>
<field-name>customer</field-name>
</field-alias>
<field-alias>
<alias-name>org.springframework.batch.sample.domain.xml.Shipper</alias-name>
<type>org.springframework.batch.sample.domain.xml.Order</type>
<alias-name>org.springframework.batch.sample.order.xml.Shipper</alias-name>
<type>org.springframework.batch.sample.order.xml.Order</type>
<field-name>shipper</field-name>
</field-alias>
</field-aliases>
@@ -51,25 +51,25 @@
<namespaceURI>http://adsj.accenture.com/purchaseorders</namespaceURI>
<localPart>order</localPart>
<prefix></prefix>
<class-name>org.springframework.batch.sample.domain.xml.Order</class-name>
<class-name>org.springframework.batch.sample.order.xml.Order</class-name>
</mapping>
<mapping>
<namespaceURI>http://adsj.accenture.com/purchaseorders</namespaceURI>
<localPart>customer</localPart>
<prefix></prefix>
<class-name>org.springframework.batch.sample.domain.xml.Customer</class-name>
<class-name>org.springframework.batch.sample.order.xml.Customer</class-name>
</mapping>
<mapping>
<namespaceURI>http://adsj.accenture.com/purchaseorders</namespaceURI>
<localPart>shipper</localPart>
<prefix></prefix>
<class-name>org.springframework.batch.sample.domain.xml.Shipper</class-name>
<class-name>org.springframework.batch.sample.order.xml.Shipper</class-name>
</mapping>
<mapping>
<namespaceURI>http://adsj.accenture.com/purchaseorders</namespaceURI>
<localPart>lineItem</localPart>
<prefix></prefix>
<class-name>org.springframework.batch.sample.domain.xml.LineItem</class-name>
<class-name>org.springframework.batch.sample.order.xml.LineItem</class-name>
</mapping>
</mappings>
</configuration>

View File

@@ -1,23 +1,24 @@
package org.springframework.batch.sample;
import static org.junit.Assert.assertEquals;
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.springframework.batch.sample.trade.CustomerCreditIncreaseWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import javax.sql.DataSource;
/**
* Test case for jobs that are expected to update customer credit value by fixed

View File

@@ -1,8 +1,8 @@
package org.springframework.batch.sample;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Test for BatchSqlUpdateJob - checks that customer credit has been updated to expected value.

View File

@@ -17,8 +17,8 @@
package org.springframework.batch.sample;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)

View File

@@ -2,17 +2,6 @@ package org.springframework.batch.sample;
import static org.junit.Assert.assertEquals;
import org.apache.commons.io.IOUtils;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.trade.Trade;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.beans.factory.annotation.Autowired;
import javax.sql.DataSource;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
@@ -21,6 +10,18 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.io.IOUtils;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.trade.Trade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -3,11 +3,11 @@ package org.springframework.batch.sample;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.springframework.batch.sample.domain.PersonService;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.domain.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -16,31 +16,32 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.io.BufferedReader;
import java.io.FileReader;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.file.FlatFileItemReader;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.LineTokenizer;
import org.springframework.batch.sample.trade.Trade;
import org.springframework.batch.sample.trade.TradeFieldSetMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.test.context.ContextConfiguration;
import org.junit.Before;
import org.junit.runner.RunWith;
import javax.sql.DataSource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -1,15 +1,15 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertTrue;
import javax.sql.DataSource;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.beans.factory.annotation.Autowired;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -16,16 +16,18 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import org.junit.runner.RunWith;
import org.junit.Test;
/**
* Functional test for graceful shutdown. A batch container is started in a new thread,

View File

@@ -1,6 +1,11 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -14,9 +19,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
/**
* Test for HibernateJob - checks that customer credit has been updated to
* expected value.

View File

@@ -1,8 +1,8 @@
package org.springframework.batch.sample;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Test for HibernateJob - checks that customer credit has been updated to expected value.

View File

@@ -1,8 +1,8 @@
package org.springframework.batch.sample;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**

View File

@@ -1,13 +1,13 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.tasklet.DummyMessageReceivingTasklet;
import org.springframework.batch.sample.tasklet.DummyMessageSendingTasklet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.beans.factory.annotation.Autowired;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -1,11 +1,11 @@
package org.springframework.batch.sample;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.batch.core.Job;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.batch.core.Job;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -16,15 +16,15 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import org.apache.commons.io.IOUtils;
import org.junit.runner.RunWith;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.util.StringUtils;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.StringUtils;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -16,17 +16,17 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.junit.runner.RunWith;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.util.StringUtils;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.StringUtils;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -1,16 +1,16 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import javax.sql.DataSource;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.common.StagingItemWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.runner.RunWith;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()

View File

@@ -16,21 +16,23 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import org.junit.runner.RunWith;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.core.converter.DefaultJobParametersConverter;
import org.springframework.batch.support.PropertiesConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.transaction.BeforeTransaction;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.beans.factory.annotation.Autowired;
import javax.sql.DataSource;
import org.springframework.test.context.transaction.BeforeTransaction;
/**
* Simple restart scenario.

View File

@@ -1,13 +1,13 @@
package org.springframework.batch.sample;
import static org.junit.Assert.*;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.item.writer.RetrySampleItemWriter;
import org.springframework.batch.sample.trade.GeneratingTradeItemReader;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Checks that expected number of items have been processed.

View File

@@ -1,6 +1,9 @@
package org.springframework.batch.sample;
import static org.junit.Assert.assertEquals;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.common.ItemTrackingItemWriter;
@@ -9,8 +12,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.sql.DataSource;
/**
* Error is encountered during writing - transaction is rolled back and the
* error item is skipped on second attempt to process the chunk.

View File

@@ -2,13 +2,13 @@ package org.springframework.batch.sample;
import java.io.File;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.runner.RunWith;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
/**
* Deletes files in the given directory.

View File

@@ -18,6 +18,7 @@ package org.springframework.batch.sample;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -27,21 +28,21 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.trade.Trade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.runner.RunWith;
import org.junit.Test;
import org.junit.Before;
import javax.sql.DataSource;
@RunWith(SpringJUnit4ClassRunner.class)

View File

@@ -18,14 +18,15 @@ package org.springframework.batch.sample.advice;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import javax.management.Notification;
import org.junit.Test;
import org.springframework.jmx.export.notification.NotificationPublisher;
import org.springframework.jmx.export.notification.UnableToSendNotificationException;
import javax.management.Notification;
import java.util.ArrayList;
import java.util.List;
/**
* @author Dave Syer
* @author Thomas Risberg

View File

@@ -15,7 +15,11 @@
*/
package org.springframework.batch.sample.dao;
import static org.easymock.EasyMock.*;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import java.math.BigDecimal;
import org.junit.Before;
import org.junit.Test;
@@ -24,8 +28,6 @@ import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.trade.CustomerCredit;
import java.math.BigDecimal;
public class FlatFileCustomerCreditDaoTests {
//private MockControl outputControl;

View File

@@ -32,11 +32,12 @@ import org.springframework.batch.item.file.transform.LineAggregator;
import org.springframework.batch.item.support.AbstractItemWriter;
import org.springframework.batch.item.transform.ItemTransformerItemWriter;
import org.springframework.batch.sample.StubLineAggregator;
import org.springframework.batch.sample.domain.Address;
import org.springframework.batch.sample.domain.BillingInfo;
import org.springframework.batch.sample.domain.Customer;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.domain.Order;
import org.springframework.batch.sample.order.Address;
import org.springframework.batch.sample.order.BillingInfo;
import org.springframework.batch.sample.order.Customer;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.Order;
import org.springframework.batch.sample.order.OrderTransformer;
public class FlatFileOrderWriterTests {

View File

@@ -16,6 +16,13 @@
package org.springframework.batch.sample.dao;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.trade.CustomerDebit;
@@ -26,11 +33,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.sql.DataSource;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()
public class JdbcCustomerDebitDaoTests {

View File

@@ -16,6 +16,12 @@
package org.springframework.batch.sample.dao;
import static org.junit.Assert.assertEquals;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -28,10 +34,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.sql.DataSource;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* @author Lucas Ward
*

View File

@@ -15,9 +15,23 @@
*/
package org.springframework.batch.sample.dao;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,15 +51,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import javax.sql.DataSource;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/simple-job-launcher-context.xml"})
public class JdbcJobRepositoryTests {

View File

@@ -16,6 +16,9 @@
package org.springframework.batch.sample.dao;
import static org.junit.Assert.assertEquals;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -28,8 +31,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.sql.DataSource;
/**
* @author Lucas Ward

View File

@@ -26,11 +26,12 @@ import java.util.HashMap;
import org.junit.Test;
import org.springframework.batch.item.file.transform.DelimitedLineAggregator;
import org.springframework.batch.item.file.transform.LineAggregator;
import org.springframework.batch.sample.domain.Address;
import org.springframework.batch.sample.domain.BillingInfo;
import org.springframework.batch.sample.domain.Customer;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.domain.Order;
import org.springframework.batch.sample.order.Address;
import org.springframework.batch.sample.order.BillingInfo;
import org.springframework.batch.sample.order.Customer;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.Order;
import org.springframework.batch.sample.order.OrderTransformer;
/**
* @author Dave Syer

View File

@@ -1,6 +1,7 @@
package org.springframework.batch.sample.item.reader;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.springframework.batch.sample.trade.GeneratingTradeItemReader;

View File

@@ -18,12 +18,13 @@ import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Address;
import org.springframework.batch.sample.domain.BillingInfo;
import org.springframework.batch.sample.domain.Customer;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.domain.Order;
import org.springframework.batch.sample.domain.ShippingInfo;
import org.springframework.batch.sample.order.Address;
import org.springframework.batch.sample.order.BillingInfo;
import org.springframework.batch.sample.order.Customer;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.Order;
import org.springframework.batch.sample.order.OrderItemReader;
import org.springframework.batch.sample.order.ShippingInfo;
public class OrderItemReaderTests {

View File

@@ -2,6 +2,8 @@ package org.springframework.batch.sample.item.reader;
import static org.junit.Assert.assertEquals;
import javax.sql.DataSource;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -25,8 +27,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import javax.sql.DataSource;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration()
public class StagingItemReaderTests {

View File

@@ -1,10 +1,10 @@
package org.springframework.batch.sample.item.writer;
import static org.junit.Assert.*;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import org.junit.Test;
import org.springframework.batch.sample.dao.CustomerCreditDao;
import org.springframework.batch.sample.trade.CustomerCredit;
import org.springframework.batch.sample.trade.CustomerCreditIncreaseWriter;

View File

@@ -3,11 +3,11 @@ package org.springframework.batch.sample.item.writer;
import java.math.BigDecimal;
import org.easymock.MockControl;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.dao.CustomerCreditDao;
import org.springframework.batch.sample.trade.CustomerCredit;
import org.springframework.batch.sample.trade.CustomerCreditUpdateWriter;
import org.junit.Before;
import org.junit.Test;
public class CustomerCreditUpdateProcessorTests {

View File

@@ -1,10 +1,10 @@
package org.springframework.batch.sample.item.writer;
import static org.junit.Assert.*;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
import org.junit.Test;
import org.springframework.batch.sample.dao.CustomerDebitDao;
import org.springframework.batch.sample.trade.CustomerDebit;
import org.springframework.batch.sample.trade.CustomerUpdateWriter;

View File

@@ -1,6 +1,8 @@
package org.springframework.batch.sample.item.writer;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
/**

View File

@@ -1,6 +1,7 @@
package org.springframework.batch.sample.mapping;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;

View File

@@ -3,8 +3,8 @@ package org.springframework.batch.sample.mapping;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Address;
import org.springframework.batch.sample.mapping.AddressFieldSetMapper;
import org.springframework.batch.sample.order.Address;
import org.springframework.batch.sample.order.AddressFieldSetMapper;
public class AddressFieldSetMapperTests extends AbstractFieldSetMapperTests {

View File

@@ -3,7 +3,8 @@ package org.springframework.batch.sample.mapping;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.BillingInfo;
import org.springframework.batch.sample.order.BillingFieldSetMapper;
import org.springframework.batch.sample.order.BillingInfo;
public class BillingFieldSetMapperTests extends AbstractFieldSetMapperTests{

View File

@@ -3,7 +3,8 @@ package org.springframework.batch.sample.mapping;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Customer;
import org.springframework.batch.sample.order.Customer;
import org.springframework.batch.sample.order.CustomerFieldSetMapper;
public class CustomerFieldSetMapperTests extends AbstractFieldSetMapperTests {

View File

@@ -5,7 +5,8 @@ import java.util.Calendar;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Order;
import org.springframework.batch.sample.order.HeaderFieldSetMapper;
import org.springframework.batch.sample.order.Order;
public class HeaderFieldSetMapperTests extends AbstractFieldSetMapperTests {

View File

@@ -5,7 +5,8 @@ import java.math.BigDecimal;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.LineItem;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.OrderItemFieldSetMapper;
public class OrderItemFieldSetMapperTests extends AbstractFieldSetMapperTests{

View File

@@ -3,8 +3,8 @@ package org.springframework.batch.sample.mapping;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.ShippingInfo;
import org.springframework.batch.sample.mapping.ShippingFieldSetMapper;
import org.springframework.batch.sample.order.ShippingFieldSetMapper;
import org.springframework.batch.sample.order.ShippingInfo;
public class ShippingFieldSetMapperTests extends AbstractFieldSetMapperTests{

View File

@@ -1,6 +1,9 @@
package org.springframework.batch.sample.mapping;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
import org.junit.Test;
import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
@@ -9,8 +12,6 @@ import org.springframework.batch.item.support.AggregateItemReader;
import org.springframework.batch.sample.trade.Trade;
import org.springframework.batch.sample.trade.TradeFieldSetMapper;
import java.math.BigDecimal;
public class TradeFieldSetMapperTests extends AbstractFieldSetMapperTests {
private static final String CUSTOMER = "Mike Tomcat";

View File

@@ -1,14 +1,19 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Date;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.valang.FutureDateFunction;
import org.springmodules.validation.valang.functions.Function;
import java.util.Date;
public class FutureDateFunctionTests {
private FutureDateFunction function;

View File

@@ -1,16 +1,21 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import org.springframework.batch.sample.domain.LineItem;
import org.springmodules.validation.valang.functions.Function;
import org.junit.Before;
import org.junit.Test;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.TotalOrderItemsFunction;
import org.springmodules.validation.valang.functions.Function;
public class TotalOrderItemsFunctionTests {
private TotalOrderItemsFunction function;

View File

@@ -1,17 +1,21 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.domain.LineItem;
import org.springmodules.validation.valang.functions.Function;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.ValidateDiscountsFunction;
import org.springmodules.validation.valang.functions.Function;
public class ValidateDiscountsFunctionTests {
private ValidateDiscountsFunction function;

View File

@@ -1,17 +1,19 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.springframework.batch.sample.domain.LineItem;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.ValidateHandlingPricesFunction;
import org.springmodules.validation.valang.functions.Function;
public class ValidateHandlingPricesFunctionTests {

View File

@@ -1,16 +1,20 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.domain.LineItem;
import org.springmodules.validation.valang.functions.Function;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.ValidateIdsFunction;
import org.springmodules.validation.valang.functions.Function;
public class ValidateIdsFunctionTests {
private ValidateIdsFunction function;

View File

@@ -1,17 +1,21 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.domain.LineItem;
import org.springmodules.validation.valang.functions.Function;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.ValidatePricesFunction;
import org.springmodules.validation.valang.functions.Function;
public class ValidatePricesFunctionTests {
private ValidatePricesFunction function;

View File

@@ -1,16 +1,20 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.domain.LineItem;
import org.springmodules.validation.valang.functions.Function;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.ValidateQuantitiesFunction;
import org.springmodules.validation.valang.functions.Function;
public class ValidateQuantitiesFunctionTests {
private ValidateQuantitiesFunction function;

View File

@@ -1,17 +1,21 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.domain.LineItem;
import org.springmodules.validation.valang.functions.Function;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.ValidateShippingPricesFunction;
import org.springmodules.validation.valang.functions.Function;
public class ValidateShippingPricesFunctionTests {
private ValidateShippingPricesFunction function;

View File

@@ -1,16 +1,22 @@
package org.springframework.batch.sample.validation.valang.custom;
package org.springframework.batch.sample.order.valang;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.domain.LineItem;
import org.springmodules.validation.valang.functions.Function;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.sample.order.LineItem;
import org.springframework.batch.sample.order.valang.ValidateTotalPricesFunction;
import org.springmodules.validation.valang.functions.Function;
public class ValidateTotalPricesFunctionTests {
private ValidateTotalPricesFunction function;

View File

@@ -18,6 +18,11 @@ package org.springframework.batch.sample.quartz;
import static org.easymock.EasyMock.createNiceMock;
import static org.junit.Assert.assertEquals;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.quartz.Job;
@@ -35,11 +40,6 @@ import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.batch.core.repository.NoSuchJobException;
import org.springframework.batch.sample.tasklet.JobSupport;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author Dave Syer
*

View File

@@ -2,13 +2,14 @@ package org.springframework.batch.sample.tasklet;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import org.junit.Test;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.sample.common.ConfigurableSystemProcessExitCodeMapper;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.sample.common.ConfigurableSystemProcessExitCodeMapper;
/**
* Tests for {@link ConfigurableSystemProcessExitCodeMapper}
*/

View File

@@ -1,16 +1,17 @@
package org.springframework.batch.sample.tasklet;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import org.junit.After;
import org.junit.Test;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.item.support.ListItemReader;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.support.RepeatSynchronizationManager;
import org.springframework.batch.sample.common.ExceptionThrowingItemReaderProxy;
import org.junit.After;
import org.junit.Test;
public class ExceptionThrowingItemReaderProxyTests {

View File

@@ -19,10 +19,10 @@ package org.springframework.batch.sample.tasklet;
import java.util.ArrayList;
import java.util.List;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.util.ClassUtils;

View File

@@ -1,8 +1,8 @@
package org.springframework.batch.sample.tasklet;
import static org.junit.Assert.*;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.sample.common.SimpleSystemProcessExitCodeMapper;

View File

@@ -15,10 +15,10 @@
*/
package org.springframework.batch.sample.tasklet;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.beans.factory.BeanNameAware;
/**

View File

@@ -1,8 +1,13 @@
package org.springframework.batch.sample.tasklet;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.core.JobExecution;
@@ -16,8 +21,6 @@ import org.springframework.batch.sample.common.SystemCommandTasklet;
import org.springframework.batch.sample.common.SystemProcessExitCodeMapper;
import org.springframework.util.Assert;
import java.io.File;
/**
* Tests for {@link SystemCommandTasklet}.
*/