harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r442441 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/
Date Tue, 12 Sep 2006 03:50:51 GMT
Author: ndbeyer
Date: Mon Sep 11 20:50:50 2006
New Revision: 442441

URL: http://svn.apache.org/viewvc?view=rev&rev=442441
Log:
Remove unused test code and eliminate compilation warnings.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/Character_UnicodeBlockTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/NumberTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ObjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimePermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimeTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ShortTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBufferTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SystemTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadDeathTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadGroupTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/CharacterTest.java
Mon Sep 11 20:50:50 2006
@@ -119,6 +119,7 @@
         assertEquals(0x00010FFFF, result);
     }
 
+    @SuppressWarnings("cast")
     public void test_codePointAtLjava_lang_CharSequenceI() {
 
         assertEquals('a', Character.codePointAt((CharSequence) "abc", 0));
@@ -220,6 +221,7 @@
         }
     }
 
+    @SuppressWarnings("cast")
     public void test_codePointBeforeLjava_lang_CharSequenceI() {
 
         assertEquals('a', Character.codePointBefore((CharSequence) "abc", 1));
@@ -933,6 +935,7 @@
     /**
      * @tests java.lang.Character#isJavaLetter(char)
      */
+    @SuppressWarnings("deprecation")
     public void test_isJavaLetterC() {
         // Test for method boolean java.lang.Character.isJavaLetter(char)
         assertTrue("letter returned false", Character.isJavaLetter('l'));
@@ -941,7 +944,7 @@
                 .isJavaLetter('_'));
 
         assertTrue("digit returned true", !Character.isJavaLetter('9'));
-        assertTrue("ignirable control returned true", !Character
+        assertTrue("ignored control returned true", !Character
                 .isJavaLetter('\u200b'));
         assertTrue("semi returned true", !Character.isJavaLetter(';'));
     }
@@ -949,6 +952,7 @@
     /**
      * @tests java.lang.Character#isJavaLetterOrDigit(char)
      */
+    @SuppressWarnings("deprecation")
     public void test_isJavaLetterOrDigitC() {
         // Test for method boolean java.lang.Character.isJavaLetterOrDigit(char)
         assertTrue("letter returned false", Character.isJavaLetterOrDigit('l'));
@@ -993,7 +997,7 @@
         assertTrue("Digit returned false", Character.isLetterOrDigit('9'));
         assertTrue("Letter returned false", Character.isLetterOrDigit('K'));
         assertTrue("Control returned true", !Character.isLetterOrDigit('\n'));
-        assertTrue("Puncutation returned true", !Character.isLetterOrDigit('?'));
+        assertTrue("Punctuation returned true", !Character.isLetterOrDigit('?'));
     }
     
     /**
@@ -1045,6 +1049,7 @@
     /**
      * @tests java.lang.Character#isSpace(char)
      */
+    @SuppressWarnings("deprecation")
     public void test_isSpaceC() {
         // Test for method boolean java.lang.Character.isSpace(char)
         assertTrue("space returned false", Character.isSpace('\n'));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/Character_UnicodeBlockTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/Character_UnicodeBlockTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/Character_UnicodeBlockTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/Character_UnicodeBlockTest.java
Mon Sep 11 20:50:50 2006
@@ -568,6 +568,7 @@
         }
     }
     
+    @SuppressWarnings("deprecation")
     public void test_forNameLjava_lang_String() {
         assertEquals(Character.UnicodeBlock.SURROGATES_AREA, Character.UnicodeBlock.forName("SURROGATES_AREA"));
         assertEquals(Character.UnicodeBlock.BASIC_LATIN, Character.UnicodeBlock.forName("BASIC_LATIN"));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ClassLoaderTest.java
Mon Sep 11 20:50:50 2006
@@ -40,7 +40,7 @@
         try {
             Policy.setPolicy(plc);
 
-            Class a = new Ldr().define();
+            Class<?> a = new Ldr().define();
 
             Permission p = new SecurityPermission("abc");
             assertFalse("impossible! misconfiguration?", a.getProtectionDomain().implies(p));
@@ -121,14 +121,17 @@
 
     public PermissionCollection pc;
 
+    @Override
     public PermissionCollection getPermissions(ProtectionDomain pd) {
         return pc;
     }
 
+    @Override
     public PermissionCollection getPermissions(CodeSource codesource) {
         return pc;
     }
 
+    @Override
     public void refresh() {
     }
 }
@@ -137,7 +140,8 @@
 }
 
 class Ldr extends ClassLoader {
-    public Class define() throws Exception {
+    @SuppressWarnings("deprecation")
+    public Class<?> define() throws Exception {
         Package p = getClass().getPackage();
         String path = p == null ? "" : p.getName().replace('.', File.separatorChar)
                 + File.separator;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/NumberTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/NumberTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/NumberTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/NumberTest.java
Mon Sep 11 20:50:50 2006
@@ -18,13 +18,6 @@
 public class NumberTest extends junit.framework.TestCase {
 
 	/**
-	 * @tests java.lang.Number#Number()
-	 */
-	public void test_Constructor() {
-		assertTrue("Nothing to test", true);
-	}
-
-	/**
 	 * @tests java.lang.Number#byteValue()
 	 */
 	public void test_byteValue() {
@@ -67,11 +60,5 @@
 				((short) new Integer(number).intValue()) == new Integer(number)
 						.shortValue());
 
-	}
-
-	protected void setUp() {
-	}
-
-	protected void tearDown() {
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ObjectTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ObjectTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ObjectTest.java
Mon Sep 11 20:50:50 2006
@@ -54,7 +54,7 @@
 		// Test for method java.lang.Class java.lang.Object.getClass()
 		String classNames[] = { "java.lang.Object", "java.lang.Throwable",
 				"java.lang.StringBuffer" };
-		Class classToTest = null;
+		Class<?> classToTest = null;
 		Object instanceToTest = null;
 
 		status = 0;
@@ -386,19 +386,5 @@
 			}
 		}
 
-	}
-
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
Mon Sep 11 20:50:50 2006
@@ -44,7 +44,7 @@
 
 		// All attributes in the package entry
 		java.net.URL[] urls = new java.net.URL[1];
-		Class c = null;
+		Class<?> c = null;
 		java.net.URLClassLoader ucl = null;
 		Support_Resources.copyFile(resources, "Package",
 				"hyts_all_attributes.jar");
@@ -198,7 +198,7 @@
 		for (int i = 0; i < parameters.length; i++) {
 			types[i] = parameters[i].getClass();
 		}
-		Class c = null;
+		Class<?> c = null;
 		if (obj instanceof Class)
 			c = (Class) obj;
 		else
@@ -222,7 +222,7 @@
 	 */
 	public void test_getName() {
 		java.net.URL[] urls = new java.net.URL[1];
-		Class c = null;
+		Class<?> c = null;
 		java.net.URLClassLoader ucl = null;
 		Support_Resources.copyFile(resources, "Package", "hyts_pq.jar");
 		try {
@@ -309,7 +309,7 @@
 		// Test for method boolean
 		// java.lang.Package.isCompatibleWith(java.lang.String)
 		java.net.URL[] urls = new java.net.URL[1];
-		Class c = null;
+		Class<?> c = null;
 		java.net.URLClassLoader ucl = null;
 		Support_Resources.copyFile(resources, "Package", "hyts_c.jar");
 		try {
@@ -338,7 +338,7 @@
 	public void test_isSealed() {
 		// Test for method boolean java.lang.Package.isSealed()
 		java.net.URL[] urls = new java.net.URL[1];
-		Class c = null;
+		Class<?> c = null;
 		java.net.URLClassLoader ucl = null;
 		Support_Resources.copyFile(resources, "Package", "hyts_pq.jar");
 		try {
@@ -362,7 +362,7 @@
 	public void test_isSealedLjava_net_URL() {
 		// Test for method boolean java.lang.Package.isSealed(java.net.URL)
 		java.net.URL[] urls = new java.net.URL[1];
-		Class c = null;
+		Class<?> c = null;
 		java.net.URLClassLoader ucl = null;
 		Support_Resources.copyFile(resources, "Package", "hyts_c.jar");
 		try {
@@ -390,7 +390,7 @@
 	public void test_toString() {
 		// Test for method java.lang.String java.lang.Package.toString()
 		java.net.URL[] urls = new java.net.URL[1];
-		Class c = null;
+		Class<?> c = null;
 		java.net.URLClassLoader ucl = null;
 		Support_Resources.copyFile(resources, "Package", "hyts_c.jar");
 		try {
@@ -406,22 +406,11 @@
 		}
 	}
 
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		resources = Support_Resources.createTempFolder();
 		resPath = resources.toString();
 		if (resPath.charAt(0) == '/' || resPath.charAt(0) == '\\')
 			resPath = resPath.substring(1);
-
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimePermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimePermissionTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimePermissionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimePermissionTest.java
Mon Sep 11 20:50:50 2006
@@ -39,18 +39,4 @@
 		assertEquals("Returned incorrect name", 
 				"createClassLoader", r.getName());
 	}
-
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimeTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimeTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimeTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/RuntimeTest.java
Mon Sep 11 20:50:50 2006
@@ -38,12 +38,14 @@
 			internalString = s;
 		}
 
-		protected void finalize() {
+		@Override
+        protected void finalize() {
 			internalString = "hit";
 		}
 	}
 
-	protected void finalize() {
+	@Override
+    protected void finalize() {
 		if (flag)
 			ranFinalize = true;
 	}
@@ -94,7 +96,7 @@
 			r.gc(); // ensure all garbage objects have been collected
 			r.gc(); // two GCs force collection phase to complete
 			long firstRead = r.totalMemory() - r.freeMemory();
-			Vector v = new Vector();
+			Vector<StringBuffer> v = new Vector<StringBuffer>();
 			for (int i = 1; i < 10; i++)
 				v.addElement(new StringBuffer(10000));
 			long secondRead = r.totalMemory() - r.freeMemory();
@@ -144,22 +146,6 @@
 		// Test for method long java.lang.Runtime.totalMemory()
 		assertTrue("totalMemory returned nonsense value", r.totalMemory() >= r
 				.freeMemory());
-	}
-
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-		flag = false;
-		ranFinalize = false;
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
 	}
 
 	public RuntimeTest() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ShortTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ShortTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ShortTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ShortTest.java
Mon Sep 11 20:50:50 2006
@@ -19,7 +19,6 @@
 
 public class ShortTest extends TestCase {
     private Short sp = new Short((short) 18000);
-    private Short sp2 = new Short((short) 18000);
     private Short sn = new Short((short) -19000);
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/String2Test.java
Mon Sep 11 20:50:50 2006
@@ -60,7 +60,8 @@
 	/**
 	 * @tests java.lang.String#String(byte[], int)
 	 */
-	public void test_Constructor$BI() {
+	@SuppressWarnings("deprecation")
+    public void test_Constructor$BI() {
 		// Test for method java.lang.String(byte [], int)
 		String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0);
 		assertTrue("Incorrect string returned: " + s, s.equals("ABCDE"));
@@ -88,7 +89,8 @@
 	/**
 	 * @tests java.lang.String#String(byte[], int, int, int)
 	 */
-	public void test_Constructor$BIII() {
+	@SuppressWarnings("deprecation")
+    public void test_Constructor$BIII() {
 		// Test for method java.lang.String(byte [], int, int, int)
 		String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0, 1, 3);
 		assertTrue("Incorrect string returned: " + s, s.equals("BCD"));
@@ -416,14 +418,14 @@
 	/**
 	 * @tests java.lang.String#getBytes(int, int, byte[], int)
 	 */
-	public void test_getBytesII$BI() {
+	@SuppressWarnings("deprecation")
+    public void test_getBytesII$BI() {
 		// Test for method void java.lang.String.getBytes(int, int, byte [],
 		// int)
 		byte[] buf = new byte[5];
 		"Hello World".getBytes(6, 11, buf, 0);
 		assertEquals("Returned incorrect bytes", "World", new String(buf));
 
-		Exception exception = null;
 		try {
 			"Hello World".getBytes(-1, 1, null, 0);
 			fail("Expected StringIndexOutOfBoundsException");
@@ -483,7 +485,7 @@
 		final int hwLength = hw1.length();
 		int powerOfThirtyOne = 1;
 		for (int counter = hwLength - 1; counter >= 0; counter--) {
-			hwHashCode += ((int) hw1.charAt(counter)) * powerOfThirtyOne;
+			hwHashCode += hw1.charAt(counter) * powerOfThirtyOne;
 			powerOfThirtyOne *= 31;
 		}
 		assertTrue("String did not hash to correct value--got: "
@@ -734,24 +736,6 @@
 				new Locale("tr", "")));
 	}
 
-	private static String writeString(String in) {
-		StringBuffer result = new StringBuffer();
-		result.append("\"");
-		for (int i = 0; i < in.length(); i++) {
-			result.append(" 0x" + Integer.toHexString(in.charAt(i)));
-		}
-		result.append("\"");
-		return result.toString();
-	}
-
-	/**
-	 * @tests java.lang.String#toLowerCase(java.util.Locale)
-	 */
-	public void test_toLowerCaseLjava_util_Locale_subtest0() {
-		// Test for method java.lang.String
-		// java.lang.String.toLowerCase(java.util.Locale)
-	}
-
 	/**
 	 * @tests java.lang.String#toString()
 	 */
@@ -917,22 +901,5 @@
 		String.format(null);
 		fail("NPE is expected on null format");
 	    } catch (NullPointerException ok){}
-	}
-
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-	}
-
-	protected void doneSuite() {
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuffer2Test.java
Mon Sep 11 20:50:50 2006
@@ -597,21 +597,8 @@
 				);
 	}
 
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		testBuffer = new StringBuffer("This is a test buffer");
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-	}
-
-	protected void doneSuite() {
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBufferTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBufferTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBufferTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBufferTest.java
Mon Sep 11 20:50:50 2006
@@ -79,6 +79,7 @@
     /**
      * @tests java.lang.StringBuffer.append(CharSequence, int, int)
      */
+    @SuppressWarnings("cast")
     public void test_appendLjava_lang_CharSequenceII() {
         StringBuffer sb = new StringBuffer();
         assertSame(sb, sb.append((CharSequence) "ab", 0, 2));
@@ -103,7 +104,7 @@
     public void test_append$CII_2() {
         StringBuffer obj = new StringBuffer();
         try {
-            obj.append(new char[0], (int) -1, (int) -1);
+            obj.append(new char[0], -1, -1);
             fail("ArrayIndexOutOfBoundsException expected");
         } catch (ArrayIndexOutOfBoundsException e) {
             // expected
@@ -116,7 +117,7 @@
     public void test_append$CII_3() throws Exception {
         StringBuffer obj = new StringBuffer();
         try {
-            obj.append((char[]) null, (int) -1, (int) -1);
+            obj.append((char[]) null, -1, -1);
             fail("NullPointerException expected");
         } catch (NullPointerException e) {
             // expected
@@ -168,6 +169,7 @@
     /**
      * @tests java.lang.StringBuffer.insert(int, CharSequence, int, int)
      */
+    @SuppressWarnings("cast")
     public void test_insertILjava_lang_CharSequenceII() {
         final String fixture = "0000";
         StringBuffer sb = new StringBuffer(fixture);
@@ -252,7 +254,7 @@
     public void test_insertIC() {
         StringBuffer obj = new StringBuffer();
         try {
-            obj.insert((int) -1, ' ');
+            obj.insert(-1, ' ');
             fail("ArrayIndexOutOfBoundsException expected");
         } catch (ArrayIndexOutOfBoundsException e) {
             // expected
@@ -383,7 +385,7 @@
     public void test_getCharsII$CI() {
         StringBuffer obj = new StringBuffer();
         try {
-            obj.getChars((int) 0, (int) 0,  new char[0], (int) -1);
+            obj.getChars(0, 0,  new char[0], -1);
             fail("ArrayIndexOutOfBoundsException expected");
         } catch (ArrayIndexOutOfBoundsException e) {
             // expected

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
Mon Sep 11 20:50:50 2006
@@ -57,7 +57,8 @@
 	/**
 	 * @tests java.lang.StringBuilder.StringBuilder(CharSequence)
 	 */
-	public void test_ConstructorLjava_lang_CharSequence() {
+	@SuppressWarnings("cast")
+    public void test_ConstructorLjava_lang_CharSequence() {
 		StringBuilder sb = new StringBuilder((CharSequence) "fixture");
 		assertEquals("fixture", sb.toString());
 		assertEquals("fixture".length() + 16, sb.capacity());
@@ -201,7 +202,8 @@
 	/**
 	 * @tests java.lang.StringBuilder.append(CharSequence, int, int)
 	 */
-	public void test_appendLjava_lang_CharSequenceII() {
+	@SuppressWarnings("cast")
+    public void test_appendLjava_lang_CharSequenceII() {
 		StringBuilder sb = new StringBuilder();
 		assertSame(sb, sb.append((CharSequence) "ab", 0, 2));
 		assertEquals("ab", sb.toString());
@@ -840,7 +842,7 @@
     public void test_insertIC_2() {
         StringBuilder obj = new StringBuilder();
         try {
-            obj.insert((int) -1, '?');
+            obj.insert(-1, '?');
             fail("ArrayIndexOutOfBoundsException expected");
         } catch (ArrayIndexOutOfBoundsException e) {
             // expected
@@ -1033,7 +1035,8 @@
 	/**
 	 * @tests java.lang.StringBuilder.insert(int, CharSequence, int, int)
 	 */
-	public void test_insertILjava_lang_CharSequenceII() {
+	@SuppressWarnings("cast")
+    public void test_insertILjava_lang_CharSequenceII() {
 		final String fixture = "0000";
 		StringBuilder sb = new StringBuilder(fixture);
 		assertSame(sb, sb.insert(0, (CharSequence) "ab", 0, 2));
@@ -1811,7 +1814,8 @@
 			super();
 		}
 
-		public String toString() {
+		@Override
+        public String toString() {
 			return "fixture";
 		}
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StringTest.java
Mon Sep 11 20:50:50 2006
@@ -23,9 +23,9 @@
 
 public class StringTest extends TestCase {
 
-    private static final Constructor UNSAFE_CONSTRUCTOR;
+    private static final Constructor<String> UNSAFE_CONSTRUCTOR;
     static {
-        Constructor uc;
+        Constructor<String> uc;
         try {
             uc = String.class.getDeclaredConstructor(new Class[] { int.class,
                     int.class, char[].class });
@@ -42,8 +42,8 @@
         }
 
         try {
-            return (String) UNSAFE_CONSTRUCTOR.newInstance(new Object[] {
-                    Integer.valueOf(start), Integer.valueOf(len), data });
+            return UNSAFE_CONSTRUCTOR.newInstance(Integer.valueOf(start), Integer.valueOf(len),
+                    data);
         } catch (Exception e) {
             throw new AssertionError(e);
         }
@@ -67,6 +67,7 @@
     /**
      * @tests java.lang.String#String(byte[], int)
      */
+    @SuppressWarnings("deprecation")
     public void test_Constructor$BI() {
         String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0);
         assertEquals("Incorrect string returned: " + s, "ABCDE", s);
@@ -92,6 +93,7 @@
     /**
      * @tests java.lang.String#String(byte[], int, int, int)
      */
+    @SuppressWarnings("deprecation")
     public void test_Constructor$BIII() {
         String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0, 1, 3);
         assertEquals("Incorrect string returned: " + s, "BCD", s);
@@ -249,6 +251,7 @@
     /**
      * @tests java.lang.String#contains(CharSequence)
      */
+    @SuppressWarnings("cast")
     public void test_containsLjava_lang_CharSequence() {
         String s = "abcdefghijklmnopqrstuvwxyz";
         assertTrue(s.contains((CharSequence) new StringBuffer("abc")));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SystemTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SystemTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SystemTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SystemTest.java
Mon Sep 11 20:50:50 2006
@@ -267,15 +267,14 @@
 	/**
 	 * @tests java.lang.System#runFinalizersOnExit(boolean)
 	 */
-	public void test_runFinalizersOnExitZ() {
-		// Test for method void java.lang.System.runFinalizersOnExit(boolean)
+	@SuppressWarnings("deprecation")
+    public void test_runFinalizersOnExitZ() {
 		// Can we call the method at least?
 		try {
 			System.runFinalizersOnExit(false);
 		} catch (Throwable t) {
 			fail("Failed to set runFinalizersOnExit");
 		}
-		assertTrue("Passed runFinalizersOnExit", true);
 	}
 
 	/**
@@ -299,37 +298,18 @@
 		}
 	}
 
-	/**
-	 * @tests java.lang.System#setSecurityManager(java.lang.SecurityManager)
-	 */
-	public void test_setSecurityManagerLjava_lang_SecurityManager() {
-		// Test for method void
-		// java.lang.System.setSecurityManager(java.lang.SecurityManager)
-		// tested in System_Destructive ??
-	}
-
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
+	@Override
+    protected void setUp() {
 		flag = false;
 		ranFinalize = false;
 	}
 
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-		// System.setProperties(orgProps);
-	}
-
 	protected SystemTest createInstance() {
 		return new SystemTest("FT");
 	}
 
-	protected void finalize() {
+	@Override
+    protected void finalize() {
 		if (flag)
 			ranFinalize = true;
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadDeathTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadDeathTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadDeathTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadDeathTest.java
Mon Sep 11 20:50:50 2006
@@ -21,24 +21,8 @@
 	 * @tests java.lang.ThreadDeath#ThreadDeath()
 	 */
 	public void test_Constructor() {
-		// Test for method java.lang.ThreadDeath()
-
 		ThreadDeath td = new ThreadDeath();
-
-		assertTrue(" Should be a Threaddeath", td instanceof ThreadDeath);
-	}
-
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
+        assertNull(td.getCause());
+        assertNull(td.getMessage());
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadGroupTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadGroupTest.java?view=diff&rev=442441&r1=442440&r2=442441
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadGroupTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/ThreadGroupTest.java
Mon Sep 11 20:50:50 2006
@@ -746,7 +746,8 @@
 	/**
 	 * @tests java.lang.ThreadGroup#stop()
 	 */
-	public void test_stop() throws OutOfMemoryError {
+	@SuppressWarnings("deprecation")
+    public void test_stop() throws OutOfMemoryError {
 		// Test for method void java.lang.ThreadGroup.stop()
 
 		final ThreadGroup originalCurrent = getInitialThreadGroup();
@@ -810,7 +811,8 @@
 	/**
 	 * @tests java.lang.ThreadGroup#suspend()
 	 */
-	public void test_suspend() throws OutOfMemoryError {
+	@SuppressWarnings("deprecation")
+    public void test_suspend() throws OutOfMemoryError {
 		// Test for method void java.lang.ThreadGroup.suspend()
 
 		final ThreadGroup originalCurrent = getInitialThreadGroup();
@@ -901,7 +903,8 @@
 	 * @tests java.lang.ThreadGroup#uncaughtException(java.lang.Thread,
 	 *        java.lang.Throwable)
 	 */
-	public void test_uncaughtExceptionLjava_lang_ThreadLjava_lang_Throwable() {
+	@SuppressWarnings("deprecation")
+    public void test_uncaughtExceptionLjava_lang_ThreadLjava_lang_Throwable() {
 		// Test for method void
 		// java.lang.ThreadGroup.uncaughtException(java.lang.Thread,
 		// java.lang.Throwable)
@@ -925,14 +928,15 @@
 
 		// Our own exception class
 		class TestException extends RuntimeException {
+            private static final long serialVersionUID = 1L;
 		}
-		;
 
 		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 		// - - - - - - -
 		testRoot = new ThreadGroup(originalCurrent,
 				"Test killing a Thread, forcing it to throw ThreadDeath") {
-			public void uncaughtException(Thread t, Throwable e) {
+			@Override
+            public void uncaughtException(Thread t, Throwable e) {
 				if (e instanceof ThreadDeath) {
                     passed[TEST_KILLING] = true;
                 }
@@ -943,7 +947,8 @@
 
 		// Test if a Thread tells its ThreadGroup about ThreadDeath
 		thread = new Thread(testRoot, null, "victim thread (to be killed)") {
-			public void run() {
+			@Override
+            public void run() {
 				while (true) {
 					Thread.yield();
 				}
@@ -981,7 +986,8 @@
 		// - - - - - - -
 		testRoot = new ThreadGroup(originalCurrent,
 				"Test Forcing a throw of ThreadDeath") {
-			public void uncaughtException(Thread t, Throwable e) {
+			@Override
+            public void uncaughtException(Thread t, Throwable e) {
 				if (e instanceof ThreadDeath) {
                     passed[TEST_FORCING_THROW_THREAD_DEATH] = true;
                 }
@@ -992,7 +998,8 @@
 
 		// Test if a Thread tells its ThreadGroup about ThreadDeath
 		thread = new Thread(testRoot, null, "suicidal thread") {
-			public void run() {
+			@Override
+            public void run() {
 				throw new ThreadDeath();
 			}
 		};
@@ -1011,7 +1018,8 @@
 		// - - - - - - -
 
 		testRoot = new ThreadGroup(originalCurrent, "Test ThreadDeath") {
-			public void uncaughtException(Thread t, Throwable e) {
+			@Override
+            public void uncaughtException(Thread t, Throwable e) {
 				passed[TEST_DEATH] = false;
 				// always forward, any exception
 				super.uncaughtException(t, e);
@@ -1035,7 +1043,8 @@
 		// - - - - - - -
 
 		testRoot = new ThreadGroup(originalCurrent, "Test other Exception") {
-			public void uncaughtException(Thread t, Throwable e) {
+			@Override
+            public void uncaughtException(Thread t, Throwable e) {
 				if (e instanceof TestException) {
                     passed[TEST_OTHER] = true;
                 } else {
@@ -1047,7 +1056,8 @@
 
 		// Test if a Thread tells its ThreadGroup about an Exception
 		thread = new Thread(testRoot, null, "no-op thread") {
-			public void run() {
+			@Override
+            public void run() {
 				throw new TestException();
 			}
 		};
@@ -1067,28 +1077,29 @@
 
 		// Our own uncaught exception class
 		class UncaughtException extends TestException {
+            private static final long serialVersionUID = 1L;
 		}
-		;
 
 		testRoot = new ThreadGroup(originalCurrent,
 				"Test Exception in uncaught exception") {
-			public void uncaughtException(Thread t, Throwable e) {
+			@Override
+            public void uncaughtException(Thread t, Throwable e) {
 				if (e instanceof TestException) {
 					passed[TEST_EXCEPTION_IN_UNCAUGHT] = true;
 					// Let's simulate an error inside our uncaughtException
 					// method.
 					// This should be no-op according to the spec
 					throw new UncaughtException();
-				} else {
-                    // only forward exceptions other than our test
-					super.uncaughtException(t, e);
-                }
+				}
+                // only forward exceptions other than our test
+                super.uncaughtException(t, e);
 			}
 		};
 
 		// Test if an Exception in uncaughtException is really a no-op
 		thread = new Thread(testRoot, null, "no-op thread") {
-			public void run() {
+			@Override
+            public void run() {
 				try {
 					throw new TestException();
 				} catch (UncaughtException ue) {
@@ -1120,7 +1131,8 @@
 		// (so that a ThreadGroup can know its Thread died)
 		testRoot = new ThreadGroup(originalCurrent,
 				"Test Uncaught followed by ThreadDeath") {
-			public void uncaughtException(Thread t, Throwable e) {
+			@Override
+            public void uncaughtException(Thread t, Throwable e) {
 				if (e instanceof ThreadDeath) {
                     passed[TEST_DEATH_AFTER_UNCAUGHT] = true;
                 }
@@ -1136,7 +1148,8 @@
 		// Test if a Thread tells its ThreadGroup about an Exception and also
 		// ThreadDeath
 		thread = new Thread(testRoot, null, "no-op thread") {
-			public void run() {
+			@Override
+            public void run() {
 				throw new TestException();
 			}
 		};
@@ -1229,17 +1242,6 @@
 
 	}
 
-	private boolean wipeAllThreads(final Vector<?> threads) {
-		boolean ok = true;
-		for (int i = 0; i < threads.size(); i++) {
-			Thread t = (Thread) threads.elementAt(i);
-			ok = ok && wipeThread(t);
-		}
-
-		return ok;
-
-	}
-
 	private boolean wipeSideEffectThreads(ThreadGroup aGroup) {
 		boolean ok = true;
 		Thread[] threads = threads(aGroup);
@@ -1292,7 +1294,8 @@
 			// Use concurrency to maximize chance of exposing concurrency bugs
 			// in ThreadGroups
 			Thread t = new Thread(aGroup, name) {
-				public void run() {
+				@Override
+                public void run() {
 					ThreadGroup newGroup = new ThreadGroup(aGroup, name);
 					allCreated.addElement(newGroup);
 					asyncBuildRandomTreeUnder(newGroup, depth - 1, allCreated);
@@ -1334,18 +1337,6 @@
 		return true;
 	}
 
-	private boolean allNotSuspended(Vector<?> threads) {
-		for (int i = 0; i < threads.size(); i++) {
-			MyThread t = (MyThread) threads.elementAt(i);
-			if (!t.isActivelyRunning()) {
-                return false;
-            }
-		}
-
-		return true;
-
-	}
-
 	private boolean allSuspended(Vector<MyThread> threads) {
 		for (int i = 0; i < threads.size(); i++) {
 			MyThread t = threads.elementAt(i);
@@ -1358,35 +1349,6 @@
 
 	}
 
-	private boolean sameThreads(Thread[] allThreads, Vector<?> threads) {
-		if (allThreads.length != threads.size()) {
-            return false;
-        }
-
-		// The complexity of this method is N2, and we do it twice !!
-
-		// First make sure that all threads in @threads are also in @allThreads
-		for (int i = 0; i < allThreads.length; i++) {
-			Thread t = (Thread) threads.elementAt(i);
-			if (!arrayIncludes(allThreads, t)) {
-                return false;
-            }
-		}
-
-		// Now make sure that all threads in @allThreads are also in @threads
-		Thread[] vectorThreads = new Thread[threads.size()];
-		threads.copyInto(vectorThreads);
-		for (int i = 0; i < vectorThreads.length; i++) {
-			Thread t = allThreads[i];
-			if (!arrayIncludes(vectorThreads, t)) {
-                return false;
-            }
-		}
-
-		return true;
-
-	}
-
 	private ThreadGroup[] groups(ThreadGroup parent) {
 		// No API to get the count of immediate children only ?
 		int count = parent.activeGroupCount();
@@ -1444,19 +1406,8 @@
 
 	}
 
-	private boolean parentOfAll(ThreadGroup parentCandidate,
-			ThreadGroup[] childrenCandidates) {
-		for (ThreadGroup element : childrenCandidates) {
-			if (!parentCandidate.parentOf(element)) {
-                return false;
-            }
-		}
-
-		return true;
-
-	}
-
-	private boolean wipeThread(Thread t) {
+	@SuppressWarnings("deprecation")
+    private boolean wipeThread(Thread t) {
 		t.stop();
 		try {
 			t.join(1000);



Mime
View raw message