Change constructor from String[] to String... and add tests.

This commit is contained in:
Christian P. MOMON 2014-08-13 18:12:03 +02:00
parent fef9eb81c8
commit 39963f9bf1
2 changed files with 39 additions and 1 deletions

View file

@ -75,7 +75,7 @@ public class StringList extends ArrayList<String> implements CharSequence
/** /**
* *
*/ */
public StringList(final String[] source) public StringList(final String... source)
{ {
super(); super();

View file

@ -300,4 +300,42 @@ public class StringListTest
// //
logger.debug("===== test done."); 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.");
}
} }