From: Scott S. <sco...@jb...> - 2006-04-13 23:56:26
|
User: starksm Date: 06/04/13 19:56:20 Added: src/test/org/jboss/test/strings StringBuilderTestCase.java Log: Add some StringBuilder tests Revision Changes Path 1.1 date: 2006/04/13 23:56:20; author: starksm; state: Exp;jbossretro/src/test/org/jboss/test/strings/StringBuilderTestCase.java Index: StringBuilderTestCase.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.strings; import junit.framework.TestCase; /** * StringBuilder translation testcases. * * @author Sc...@jb... * @version $Revision: 1.1 $ */ public class StringBuilderTestCase extends TestCase { public void testReplace() { StringBuilder sb = new StringBuilder("testReplace"); String s = sb.toString(); assertEquals("testReplace", s); } public void testAppend() { StringBuilder sb = new StringBuilder("test"); sb.append("Append"); String s = sb.toString(); assertEquals("testAppend", s); } public void testAppendCharSequence() { StringBuilder sb = new StringBuilder("test"); sb.append(sb); String s = sb.toString(); assertEquals("testtest", s); } public void testAppendStringBuffer() { StringBuilder sb = new StringBuilder("test"); StringBuffer sb2 = new StringBuffer("AppendStringBuffer"); sb.append(sb2); String s = sb.toString(); assertEquals("testAppendStringBuffer", s); } } |