Fixes for build errors
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.Iterator;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
@@ -50,14 +51,14 @@ public class OrderItemReaderTests extends TestCase {
|
||||
public void testNext() throws Exception {
|
||||
|
||||
//create fieldsets and set return values for input source
|
||||
FieldSet headerFS = new FieldSet(new String[] {Order.LINE_ID_HEADER});
|
||||
FieldSet customerFS = new FieldSet(new String[] {Customer.LINE_ID_NON_BUSINESS_CUST});
|
||||
FieldSet billingFS = new FieldSet(new String[] {Address.LINE_ID_BILLING_ADDR});
|
||||
FieldSet shippingFS = new FieldSet(new String[] {Address.LINE_ID_SHIPPING_ADDR});
|
||||
FieldSet billingInfoFS = new FieldSet(new String[] {BillingInfo.LINE_ID_BILLING_INFO});
|
||||
FieldSet shippingInfoFS = new FieldSet(new String[] {ShippingInfo.LINE_ID_SHIPPING_INFO});
|
||||
FieldSet itemFS = new FieldSet(new String[] {LineItem.LINE_ID_ITEM});
|
||||
FieldSet footerFS = new FieldSet(new String[] {Order.LINE_ID_FOOTER, "100","3","3"},
|
||||
FieldSet headerFS = new DefaultFieldSet(new String[] {Order.LINE_ID_HEADER});
|
||||
FieldSet customerFS = new DefaultFieldSet(new String[] {Customer.LINE_ID_NON_BUSINESS_CUST});
|
||||
FieldSet billingFS = new DefaultFieldSet(new String[] {Address.LINE_ID_BILLING_ADDR});
|
||||
FieldSet shippingFS = new DefaultFieldSet(new String[] {Address.LINE_ID_SHIPPING_ADDR});
|
||||
FieldSet billingInfoFS = new DefaultFieldSet(new String[] {BillingInfo.LINE_ID_BILLING_INFO});
|
||||
FieldSet shippingInfoFS = new DefaultFieldSet(new String[] {ShippingInfo.LINE_ID_SHIPPING_INFO});
|
||||
FieldSet itemFS = new DefaultFieldSet(new String[] {LineItem.LINE_ID_ITEM});
|
||||
FieldSet footerFS = new DefaultFieldSet(new String[] {Order.LINE_ID_FOOTER, "100","3","3"},
|
||||
new String[] {"ID","TOTAL_PRICE","TOTAL_LINE_ITEMS","TOTAL_ITEMS"});
|
||||
|
||||
input.read();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.sample.domain.Address;
|
||||
@@ -43,7 +44,7 @@ public class AddressFieldSetMapperTests extends AbstractFieldSetMapperTests {
|
||||
AddressFieldSetMapper.COUNTRY_COLUMN,
|
||||
AddressFieldSetMapper.ZIP_CODE_COLUMN };
|
||||
|
||||
return new FieldSet(tokens, columnNames);
|
||||
return new DefaultFieldSet(tokens, columnNames);
|
||||
}
|
||||
|
||||
protected FieldSetMapper fieldSetMapper() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.sample.domain.BillingInfo;
|
||||
import org.springframework.batch.sample.mapping.BillingFieldSetMapper;
|
||||
|
||||
public class BillingFieldSetMapperTests extends AbstractFieldSetMapperTests{
|
||||
|
||||
@@ -24,7 +24,7 @@ public class BillingFieldSetMapperTests extends AbstractFieldSetMapperTests{
|
||||
String[] columnNames = new String[]{
|
||||
BillingFieldSetMapper.PAYMENT_TYPE_ID_COLUMN,
|
||||
BillingFieldSetMapper.PAYMENT_DESC_COLUMN};
|
||||
return new FieldSet(tokens, columnNames);
|
||||
return new DefaultFieldSet(tokens, columnNames);
|
||||
}
|
||||
|
||||
protected FieldSetMapper fieldSetMapper() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.sample.domain.Customer;
|
||||
@@ -46,7 +47,7 @@ public class CustomerFieldSetMapperTests extends AbstractFieldSetMapperTests {
|
||||
CustomerFieldSetMapper.REG_ID_COLUMN,
|
||||
CustomerFieldSetMapper.VIP_COLUMN};
|
||||
|
||||
return new FieldSet(tokens, columnNames);
|
||||
return new DefaultFieldSet(tokens, columnNames);
|
||||
}
|
||||
|
||||
protected FieldSetMapper fieldSetMapper() {
|
||||
|
||||
@@ -2,10 +2,10 @@ package org.springframework.batch.sample.mapping;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.sample.domain.Order;
|
||||
import org.springframework.batch.sample.mapping.HeaderFieldSetMapper;
|
||||
|
||||
public class HeaderFieldSetMapperTests extends AbstractFieldSetMapperTests {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class HeaderFieldSetMapperTests extends AbstractFieldSetMapperTests {
|
||||
HeaderFieldSetMapper.ORDER_ID_COLUMN,
|
||||
HeaderFieldSetMapper.ORDER_DATE_COLUMN
|
||||
};
|
||||
return new FieldSet(tokens, columnNames);
|
||||
return new DefaultFieldSet(tokens, columnNames);
|
||||
}
|
||||
|
||||
protected FieldSetMapper fieldSetMapper() {
|
||||
|
||||
@@ -2,10 +2,10 @@ package org.springframework.batch.sample.mapping;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.sample.domain.LineItem;
|
||||
import org.springframework.batch.sample.mapping.OrderItemFieldSetMapper;
|
||||
|
||||
public class OrderItemFieldSetMapperTests extends AbstractFieldSetMapperTests{
|
||||
|
||||
@@ -52,7 +52,7 @@ public class OrderItemFieldSetMapperTests extends AbstractFieldSetMapperTests{
|
||||
OrderItemFieldSetMapper.SHIPPING_PRICE_COLUMN,
|
||||
OrderItemFieldSetMapper.TOTAL_PRICE_COLUMN
|
||||
};
|
||||
return new FieldSet(tokens, columnNames);
|
||||
return new DefaultFieldSet(tokens, columnNames);
|
||||
}
|
||||
|
||||
protected FieldSetMapper fieldSetMapper() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.springframework.batch.sample.mapping;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.sample.domain.ShippingInfo;
|
||||
@@ -26,7 +27,7 @@ public class ShippingFieldSetMapperTests extends AbstractFieldSetMapperTests{
|
||||
ShippingFieldSetMapper.ADDITIONAL_SHIPPING_INFO_COLUMN,
|
||||
ShippingFieldSetMapper.SHIPPING_TYPE_ID_COLUMN
|
||||
};
|
||||
return new FieldSet(tokens, columnNames);
|
||||
return new DefaultFieldSet(tokens, columnNames);
|
||||
}
|
||||
|
||||
protected FieldSetMapper fieldSetMapper() {
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springframework.batch.sample.mapping;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.springframework.batch.io.file.mapping.DefaultFieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSet;
|
||||
import org.springframework.batch.io.file.mapping.FieldSetMapper;
|
||||
import org.springframework.batch.item.reader.AggregateItemReader;
|
||||
@@ -31,7 +32,7 @@ public class TradeFieldSetMapperTests extends AbstractFieldSetMapperTests{
|
||||
tokens[TradeFieldSetMapper.PRICE_COLUMN] = String.valueOf(PRICE);
|
||||
tokens[TradeFieldSetMapper.CUSTOMER_COLUMN] = CUSTOMER;
|
||||
|
||||
return new FieldSet(tokens);
|
||||
return new DefaultFieldSet(tokens);
|
||||
}
|
||||
|
||||
protected FieldSetMapper fieldSetMapper() {
|
||||
@@ -39,11 +40,11 @@ public class TradeFieldSetMapperTests extends AbstractFieldSetMapperTests{
|
||||
}
|
||||
|
||||
public void testBeginRecord() throws Exception {
|
||||
assertEquals(AggregateItemReader.BEGIN_RECORD, fieldSetMapper().mapLine(new FieldSet(new String[] {"BEGIN"})));
|
||||
assertEquals(AggregateItemReader.BEGIN_RECORD, fieldSetMapper().mapLine(new DefaultFieldSet(new String[] {"BEGIN"})));
|
||||
}
|
||||
|
||||
public void testEndRecord() throws Exception {
|
||||
assertEquals(AggregateItemReader.END_RECORD, fieldSetMapper().mapLine(new FieldSet(new String[] {"END"})));
|
||||
assertEquals(AggregateItemReader.END_RECORD, fieldSetMapper().mapLine(new DefaultFieldSet(new String[] {"END"})));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user