01: /*
02: * StrBufferTest.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.util;
13:
14: import junit.framework.*;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public class StrBufferTest extends TestCase {
21:
22: public StrBufferTest() {
23: }
24:
25: public void testRemove() {
26: StrBuffer buffer = new StrBuffer("0123456789");
27: buffer.remove(5);
28: buffer.remove(5);
29: assertEquals("Remove not working", "01234789", buffer
30: .toString());
31: }
32:
33: public void testAppend() {
34: StrBuffer buffer = new StrBuffer("0");
35: buffer.append("1");
36: assertEquals("append not working", "01", buffer.toString());
37:
38: buffer.append(new StringBuilder("2"));
39: assertEquals("append not working", "012", buffer.toString());
40:
41: buffer.append(null);
42: assertEquals("append not working", "012", buffer.toString());
43:
44: }
45:
46: }
|