poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r405757 - /jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java
Date Wed, 10 May 2006 13:25:25 GMT
Author: nick
Date: Wed May 10 06:24:54 2006
New Revision: 405757

URL: http://svn.apache.org/viewcvs?rev=405757&view=rev
Log:
Add test for empty constructor

Modified:
    jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java

Modified: jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java
URL: http://svn.apache.org/viewcvs/jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java?rev=405757&r1=405756&r2=405757&view=diff
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java
Wed May 10 06:24:54 2006
@@ -65,7 +65,7 @@
 			assertEquals(alt_data[i],b[i]);
 		}
 	}
-
+	
 	public void testWrite() throws Exception {
 		TextCharsAtom tca = new TextCharsAtom(data,0,data.length);
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -77,4 +77,23 @@
 			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]);
+		}
+	}
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message