harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r379434 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang: AllTests.java StringBufferTest.java
Date Tue, 21 Feb 2006 12:00:20 GMT
Author: tellison
Date: Tue Feb 21 04:00:15 2006
New Revision: 379434

URL: http://svn.apache.org/viewcvs?rev=379434&view=rev
Log:
Added regression test for HARMONY-90 (StringBuffer.setLength(int) doesn't throw IndexOutOfBoundsException
if the argument is negative)

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/StringBufferTest.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java?rev=379434&r1=379433&r2=379434&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/AllTests.java
Tue Feb 21 04:00:15 2006
@@ -29,6 +29,7 @@
 				"Test for org.apache.harmony.tests.java.lang");
 		//$JUnit-BEGIN$
 		suite.addTestSuite(FloatTest.class);
+		suite.addTestSuite(StringBufferTest.class);
 		suite.addTestSuite(SecurityManagerTest.class);
 		suite.addTestSuite(DoubleTest.class);
 		//$JUnit-END$

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/StringBufferTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/StringBufferTest.java?rev=379434&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/StringBufferTest.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/StringBufferTest.java
Tue Feb 21 04:00:15 2006
@@ -0,0 +1,35 @@
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.tests.java.lang;
+
+import junit.framework.TestCase;
+
+public class StringBufferTest extends TestCase {
+
+	/**
+	 * @tests java.lang.StringBuffer#setLength(int)
+	 */
+	public void test_setLengthI() {
+		// Regression for HARMONY-90
+		StringBuffer buffer = new StringBuffer("abcde");
+		try {
+			buffer.setLength(-1);
+			fail("Assert 0: IndexOutOfBoundsException must be thrown");
+		} catch (IndexOutOfBoundsException e) {
+			// expected
+		}
+	}
+}



Mime
View raw message