hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r315055 - /jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestCharArrayBuffer.java
Date Wed, 12 Oct 2005 21:38:58 GMT
Author: olegk
Date: Wed Oct 12 14:38:55 2005
New Revision: 315055

URL: http://svn.apache.org/viewcvs?rev=315055&view=rev
Log:
Additional test cases for CharArrayBuffer

Modified:
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestCharArrayBuffer.java

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestCharArrayBuffer.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestCharArrayBuffer.java?rev=315055&r1=315054&r2=315055&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestCharArrayBuffer.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestCharArrayBuffer.java
Wed Oct 12 14:38:55 2005
@@ -88,6 +88,8 @@
         	assertEquals(tmp[i], b2[i]);
         	assertEquals(tmp[i], buffer.charAt(i));
     	}
+    	assertEquals("1234", buffer.toString());
+    	
     	buffer.clear();
     	assertEquals(16, buffer.capacity()); 
     	assertEquals(0, buffer.length());
@@ -110,6 +112,32 @@
     	
     	assertEquals(16, buffer.capacity()); 
     	assertEquals(10, buffer.length());
+    	
+    	assertEquals("1212341234", buffer.toString());
+    }
+
+    public void testAppendString() throws Exception {
+    	CharArrayBuffer buffer = new CharArrayBuffer(8);
+    	buffer.append("stuff");
+    	buffer.append(" and more stuff");
+    	assertEquals("stuff and more stuff", buffer.toString());
+    }
+    
+    public void testAppendNullString() throws Exception {
+    	CharArrayBuffer buffer = new CharArrayBuffer(8);
+    	buffer.append(null);
+    	assertEquals("null", buffer.toString());
+    }
+    
+    public void testAppendSingleChar() throws Exception {
+    	CharArrayBuffer buffer = new CharArrayBuffer(4);
+    	buffer.append('1');
+    	buffer.append('2');
+    	buffer.append('3');
+    	buffer.append('4');
+    	buffer.append('5');
+    	buffer.append('6');
+    	assertEquals("123456", buffer.toString());
     }
     
     public void testInvalidAppend() throws Exception {



Mime
View raw message