RESOLVED - issue BATCH-640: FieldSetMapper.mapLine() should contain the line number

This commit is contained in:
dsyer
2008-07-17 09:51:34 +00:00
parent 3de4794205
commit 8ffa494527
25 changed files with 77 additions and 58 deletions

View File

@@ -90,19 +90,19 @@ public class OrderItemReaderTests extends TestCase {
mapperControl = MockControl.createControl(FieldSetMapper.class);
mapper = (FieldSetMapper)mapperControl.getMock();
//set how mapper should respond - set return values for mapper
mapper.mapLine(headerFS);
mapper.mapLine(headerFS, -1);
mapperControl.setReturnValue(order);
mapper.mapLine(customerFS);
mapper.mapLine(customerFS, -1);
mapperControl.setReturnValue(customer);
mapper.mapLine(billingFS);
mapper.mapLine(billingFS, -1);
mapperControl.setReturnValue(billing);
mapper.mapLine(shippingFS);
mapper.mapLine(shippingFS, -1);
mapperControl.setReturnValue(shipping);
mapper.mapLine(billingInfoFS);
mapper.mapLine(billingInfoFS, -1);
mapperControl.setReturnValue(billingInfo);
mapper.mapLine(shippingInfoFS);
mapper.mapLine(shippingInfoFS, -1);
mapperControl.setReturnValue(shippingInfo);
mapper.mapLine(itemFS);
mapper.mapLine(itemFS, -1);
mapperControl.setReturnValue(item,3);
mapperControl.replay();

View File

@@ -35,7 +35,7 @@ public abstract class AbstractFieldSetMapperTests extends TestCase {
* Assumes the domain object implements sensible <code>equals(Object other)</code>
*/
public void testRegularUse() {
assertEquals(expectedDomainObject(), fieldSetMapper().mapLine(fieldSet()));
assertEquals(expectedDomainObject(), fieldSetMapper().mapLine(fieldSet(), -1));
}
}

View File

@@ -40,11 +40,11 @@ public class TradeFieldSetMapperTests extends AbstractFieldSetMapperTests{
}
public void testBeginRecord() throws Exception {
assertEquals(AggregateItemReader.BEGIN_RECORD, fieldSetMapper().mapLine(new DefaultFieldSet(new String[] {"BEGIN"})));
assertEquals(AggregateItemReader.BEGIN_RECORD, fieldSetMapper().mapLine(new DefaultFieldSet(new String[] {"BEGIN"}), -1));
}
public void testEndRecord() throws Exception {
assertEquals(AggregateItemReader.END_RECORD, fieldSetMapper().mapLine(new DefaultFieldSet(new String[] {"END"})));
assertEquals(AggregateItemReader.END_RECORD, fieldSetMapper().mapLine(new DefaultFieldSet(new String[] {"END"}), -1));
}
}