BATCH-1208: add unit test

This commit is contained in:
dsyer
2009-05-06 12:31:48 +00:00
parent 91cf3c83c3
commit 51c7a96369
2 changed files with 43 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import static org.junit.Assert.fail;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.junit.Test;
@@ -35,6 +36,10 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
@Qualifier("withInteger")
private PlaceholderTargetSource withInteger;
@Autowired
@Qualifier("withList")
private PlaceholderTargetSource withList;
@Autowired
@Qualifier("withMultiple")
private PlaceholderTargetSource withMultiple;
@@ -153,6 +158,13 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
assertEquals("bar-4321", target.getName());
}
@Test
public void testGetList() {
Node target = (Node) withList.getTarget();
assertEquals(3, target.getList().size());
assertEquals("[bar, foo-4321, bar-4321]", target.getList().toString());
}
@Test
public void testGetMultiple() {
Node target = (Node) withMultiple.getTarget();
@@ -186,6 +198,8 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
Date getDate();
Node getParent();
List<String> getList();
}
public static class Foo implements Node {
@@ -195,6 +209,8 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
private Date date;
private Node parent;
private List<String> list;
public Foo() {
}
@@ -227,6 +243,14 @@ public class PlaceholderTargetSourceTests extends ContextFactorySupport {
this.parent = parent;
}
public void setList(List<String> list) {
this.list = list;
}
public List<String> getList() {
return list;
}
}
}