Add test for StringList.
This commit is contained in:
parent
b05606df83
commit
8ddcf131bc
1 changed files with 68 additions and 0 deletions
|
@ -232,4 +232,72 @@ public class StringListTest
|
|||
logger.debug("===== test done.");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testToString01()
|
||||
{
|
||||
//
|
||||
logger.debug("===== test starting...");
|
||||
|
||||
//
|
||||
StringList buffer = new StringList();
|
||||
|
||||
String target = buffer.toString();
|
||||
|
||||
Assert.assertTrue(target.equals(""));
|
||||
|
||||
//
|
||||
logger.debug("===== test done.");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testToString02()
|
||||
{
|
||||
//
|
||||
logger.debug("===== test starting...");
|
||||
|
||||
//
|
||||
String source = "abcdefghijklm";
|
||||
|
||||
StringList buffer = new StringList();
|
||||
buffer.append(source);
|
||||
|
||||
String target = buffer.toString();
|
||||
|
||||
Assert.assertEquals(source, target);
|
||||
Assert.assertTrue(target.equals(source));
|
||||
|
||||
//
|
||||
logger.debug("===== test done.");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testToString03()
|
||||
{
|
||||
//
|
||||
logger.debug("===== test starting...");
|
||||
|
||||
//
|
||||
String source1 = "abcdefghijklm";
|
||||
String source2 = "other stuff";
|
||||
|
||||
StringList buffer = new StringList();
|
||||
buffer.append(source1);
|
||||
buffer.append(source2);
|
||||
|
||||
String target = buffer.toString();
|
||||
|
||||
Assert.assertTrue(target.equals(source1 + source2));
|
||||
|
||||
//
|
||||
logger.debug("===== test done.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue