Change constructor from String[] to String... and add tests.
This commit is contained in:
parent
fef9eb81c8
commit
39963f9bf1
2 changed files with 39 additions and 1 deletions
|
@ -75,7 +75,7 @@ public class StringList extends ArrayList<String> implements CharSequence
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public StringList(final String[] source)
|
||||
public StringList(final String... source)
|
||||
{
|
||||
super();
|
||||
|
||||
|
|
|
@ -300,4 +300,42 @@ public class StringListTest
|
|||
//
|
||||
logger.debug("===== test done.");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testConstructor01()
|
||||
{
|
||||
//
|
||||
logger.debug("===== test starting...");
|
||||
|
||||
String[] source = { "a", "b", "c"};
|
||||
|
||||
//
|
||||
StringList target = new StringList(source);
|
||||
|
||||
Assert.assertEquals(3, target.size());
|
||||
|
||||
//
|
||||
logger.debug("===== test done.");
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testConstructor02()
|
||||
{
|
||||
//
|
||||
logger.debug("===== test starting...");
|
||||
|
||||
//
|
||||
StringList target = new StringList("a", "b", "c");
|
||||
|
||||
Assert.assertEquals(3, target.size());
|
||||
|
||||
//
|
||||
logger.debug("===== test done.");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue