IN PROGRESS - BATCH-711: Upgrade ItemWriter and implementations to use parameterized types

This commit is contained in:
robokaso
2008-07-23 10:32:58 +00:00
parent 7c57b8c2df
commit cdef45dfb8
18 changed files with 36 additions and 153 deletions

View File

@@ -63,7 +63,7 @@ public class BatchSqlCustomerCreditIncreaseWriterTests {
/**
* Test method for
* {@link org.springframework.batch.sample.item.writer.BatchSqlCustomerCreditIncreaseWriter#write(java.lang.Object)}.
* {@link org.springframework.batch.sample.item.writer.BatchSqlCustomerCreditIncreaseWriter#write(CustomerCredit)}.
* @throws Exception
*/
@Test

View File

@@ -1,58 +0,0 @@
package org.springframework.batch.sample.item.writer;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.easymock.MockControl;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.domain.Order;
public class OrderWriterTests {
private MockControl writerControl;
private OrderWriter processor;
private ItemWriter writer;
@Before
public void setUp() {
//create mock writer
writerControl = MockControl.createControl(ItemWriter.class);
writer = (ItemWriter)writerControl.getMock();
//create processor
processor = new OrderWriter();
processor.setDelegate(writer);
}
@Test
public void testProcess() throws Exception {
Order order = new Order();
//set-up mock writer
writer.write(order);
writerControl.replay();
//call tested method
processor.write(order);
//verify method calls
writerControl.verify();
}
@Test
public void testProcessWithException() throws Exception {
writerControl.replay();
//call tested method
try {
processor.write(this);
fail("Batch critical exception was expected");
} catch (UnexpectedJobExecutionException bce) {
assertTrue(true);
}
writerControl.verify();
}
}

View File

@@ -40,12 +40,4 @@ public class TradeProcessorTests {
writerControl.verify();
}
@Test
public void testProcessNonTradeObject() {
writerControl.replay();
//call tested method
processor.write(this);
writerControl.verify();
}
}