Add test for empty constructor

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@405757 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2006-05-10 13:24:54 +00:00
parent 5d14b4debb
commit 9dc69a14b3

View File

@ -77,4 +77,23 @@ public class TestTextCharsAtom extends TestCase {
assertEquals(data[i],b[i]);
}
}
public void testCreateNew() throws Exception {
TextCharsAtom tca = new TextCharsAtom();
assertEquals(0, tca.getText().length());
tca.setText(data_text);
assertEquals(data_text, tca.getText());
// Check it's now like data
ByteArrayOutputStream baos = new ByteArrayOutputStream();
tca.writeOut(baos);
byte[] b = baos.toByteArray();
assertEquals(data.length, b.length);
for(int i=0; i<data.length; i++) {
assertEquals(data[i],b[i]);
}
}
}