diff options
author | Elliott Hughes <enh@google.com> | 2010-05-13 10:58:28 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-05-13 10:58:28 -0700 |
commit | fd6bb3510c2f94d636f3572dcf5f7f4dcd1a2726 (patch) | |
tree | 2ae4bdcf29582fa8ccc75d42656b539ce3ed7c5b /luni/src/test | |
parent | 2620ff9a08ce7fc6d66b60784b1eecd78eb001ba (diff) | |
download | libcore-fd6bb3510c2f94d636f3572dcf5f7f4dcd1a2726.zip libcore-fd6bb3510c2f94d636f3572dcf5f7f4dcd1a2726.tar.gz libcore-fd6bb3510c2f94d636f3572dcf5f7f4dcd1a2726.tar.bz2 |
Remove //$NON-NLS-\d$ cruft.
Mostly done by perl(1), with manual cleanup of the few misspelled instances.
This makes our trailing whitespace slightly worse, but I'll fix all that with
a follow-on change.
Change-Id: I0b4ca98819be6f9519c4ba980d759bd1ee1a0303
Diffstat (limited to 'luni/src/test')
68 files changed, 2491 insertions, 2491 deletions
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java index 837b443..5b2b60b 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java @@ -399,7 +399,7 @@ public class OutputStreamWriterTest extends TestCase { } public void testHandleEarlyEOFChar_1() throws IOException { - String str = "All work and no play makes Jack a dull boy\n"; //$NON-NLS-1$ + String str = "All work and no play makes Jack a dull boy\n"; int NUMBER = 2048; int j = 0; int len = str.length() * NUMBER; @@ -432,7 +432,7 @@ public class OutputStreamWriterTest extends TestCase { } String inputStr = new String(bytes); int len = inputStr.length(); - File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$ + File f = File.createTempFile("FileWriterBugTest ", null); f.deleteOnExit(); FileWriter writer = new FileWriter(f); writer.write(inputStr); diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java index bc14d6f..3302c3c 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java @@ -27,9 +27,9 @@ import org.apache.harmony.testframework.serialization.SerializationTest.Serializ public class HttpRetryExceptionTest extends TestCase { - private static final String LOCATION = "Http test"; //$NON-NLS-1$ + private static final String LOCATION = "Http test"; - private static final String DETAIL = "detail"; //$NON-NLS-1$ + private static final String DETAIL = "detail"; // comparator for HttpRetryException objects private static final SerializableAssert comparator = new SerializableAssert() { diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpURLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpURLConnectionTest.java index a655c4f..78e645a 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpURLConnectionTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpURLConnectionTest.java @@ -220,20 +220,20 @@ public class HttpURLConnectionTest extends junit.framework.TestCase { }) public void test_getRequestPropertyLjava_lang_String_BeforeConnected() throws MalformedURLException, IOException { - uc.setRequestProperty("whatever", "you like"); //$NON-NLS-1$//$NON-NLS-2$ - String res = uc.getRequestProperty("whatever"); //$NON-NLS-1$ - assertEquals("you like", res); //$NON-NLS-1$ + uc.setRequestProperty("whatever", "you like"); + String res = uc.getRequestProperty("whatever"); + assertEquals("you like", res); - uc.setRequestProperty("", "you like"); //$NON-NLS-1$//$NON-NLS-2$ - res = uc.getRequestProperty(""); //$NON-NLS-1$ - assertEquals("you like", res); //$NON-NLS-1$ + uc.setRequestProperty("", "you like"); + res = uc.getRequestProperty(""); + assertEquals("you like", res); - uc.setRequestProperty("", null); //$NON-NLS-1$ - res = uc.getRequestProperty(""); //$NON-NLS-1$ + uc.setRequestProperty("", null); + res = uc.getRequestProperty(""); assertEquals(null, res); try { - uc.setRequestProperty(null, "you like"); //$NON-NLS-1$ - fail("Should throw NullPointerException"); //$NON-NLS-1$ + uc.setRequestProperty(null, "you like"); + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -260,24 +260,24 @@ public class HttpURLConnectionTest extends junit.framework.TestCase { throws IOException { uc.connect(); try { - uc.setRequestProperty("whatever", "you like"); //$NON-NLS-1$//$NON-NLS-2$ - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + uc.setRequestProperty("whatever", "you like"); + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // expected } try { - uc.setRequestProperty(null, "you like"); //$NON-NLS-1$ - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + uc.setRequestProperty(null, "you like"); + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // expected } - String res = uc.getRequestProperty("whatever"); //$NON-NLS-1$ + String res = uc.getRequestProperty("whatever"); assertEquals(null, res); res = uc.getRequestProperty(null); assertEquals(null, res); try { uc.getRequestProperties(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java index 4053271..7457462 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java @@ -683,7 +683,7 @@ public class InetAddressTest extends junit.framework.TestCase { assertFalse(ia.isReachable(null, 0, 1000)); // Regression test for HARMONY-1842. - ia = InetAddress.getByName("localhost"); //$NON-NLS-1$ + ia = InetAddress.getByName("localhost"); Enumeration<NetworkInterface> nif = NetworkInterface.getNetworkInterfaces(); NetworkInterface netif; while(nif.hasMoreElements()) { diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java index e7be391..d7dfdcb 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java @@ -48,7 +48,7 @@ public class URITest extends TestCase { // URI("ascheme://user\u00df\u00a3info@host:0/a\u0080path?qu\u00a9\u00aeery#fr\u00e4\u00e8g"), // multiple arg constructors - new URI("http", "user%60%20info", "host", 80, "/a%20path", //$NON-NLS-4$ + new URI("http", "user%60%20info", "host", 80, "/a%20path", "qu%60%20ery", "fr%5E%20ag"), // escaped octets for illegal new URI("http", "user%C3%9F%C2%A3info", "host", -1, diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java index 5468914..1edfca7 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterTest.java @@ -1807,284 +1807,284 @@ public class FormatterTest extends TestCase { china.set(Calendar.MILLISECOND, 609); final Object[][] lowerCaseGermanTriple = { - {0L, 'a', "Do."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'a', "So."}, //$NON-NLS-2$ - {-1000L, 'a', "Do."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'a', "Do."}, //$NON-NLS-2$ - {paris, 'a', "Mo."}, //$NON-NLS-2$ - {china, 'a', "Mo."}, //$NON-NLS-2$ - {0L, 'b', "Jan"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'b', "Aug"}, //$NON-NLS-2$ - {-1000L, 'b', "Jan"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'b', "Mai"}, //$NON-NLS-2$ - {paris, 'b', "Mai"}, //$NON-NLS-2$ - {china, 'b', "Mai"}, //$NON-NLS-2$ - {0L, 'c', "Do. Jan 01 08:00:00 GMT+08:00 1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'c', "So. Aug 17 15:18:47 GMT+08:00 292278994"}, //$NON-NLS-2$ - {-1000L, 'c', "Do. Jan 01 07:59:59 GMT+08:00 1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'c', "Do. Mai 11 13:59:07 GMT+08:00 2006"}, //$NON-NLS-2$ - {paris, 'c', "Mo. Mai 08 12:00:00 MESZ 2006"}, //$NON-NLS-2$ - {china, 'c', "Mo. Mai 08 12:00:00 GMT-08:00 2006"}, //$NON-NLS-2$ - {0L, 'd', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'd', "17"}, //$NON-NLS-2$ - {-1000L, 'd', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'd', "11"}, //$NON-NLS-2$ - {paris, 'd', "08"}, //$NON-NLS-2$ - {china, 'd', "08"}, //$NON-NLS-2$ - {0L, 'e', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'e', "17"}, //$NON-NLS-2$ - {-1000L, 'e', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'e', "11"}, //$NON-NLS-2$ - {paris, 'e', "8"}, //$NON-NLS-2$ - {china, 'e', "8"}, //$NON-NLS-2$ - {0L, 'h', "Jan"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'h', "Aug"}, //$NON-NLS-2$ - {-1000L, 'h', "Jan"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'h', "Mai"}, //$NON-NLS-2$ - {paris, 'h', "Mai"}, //$NON-NLS-2$ - {china, 'h', "Mai"}, //$NON-NLS-2$ - {0L, 'j', "001"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'j', "229"}, //$NON-NLS-2$ - {-1000L, 'j', "001"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'j', "131"}, //$NON-NLS-2$ - {paris, 'j', "128"}, //$NON-NLS-2$ - {china, 'j', "128"}, //$NON-NLS-2$ - {0L, 'k', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'k', "15"}, //$NON-NLS-2$ - {-1000L, 'k', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'k', "13"}, //$NON-NLS-2$ - {paris, 'k', "12"}, //$NON-NLS-2$ - {china, 'k', "12"}, //$NON-NLS-2$ - {0L, 'l', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'l', "3"}, //$NON-NLS-2$ - {-1000L, 'l', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'l', "1"}, //$NON-NLS-2$ - {paris, 'l', "12"}, //$NON-NLS-2$ - {china, 'l', "12"}, //$NON-NLS-2$ - {0L, 'm', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'm', "08"}, //$NON-NLS-2$ - {-1000L, 'm', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'm', "05"}, //$NON-NLS-2$ - {paris, 'm', "05"}, //$NON-NLS-2$ - {china, 'm', "05"}, //$NON-NLS-2$ - {0L, 'p', "vorm."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'p', "nachm."}, //$NON-NLS-2$ - {-1000L, 'p', "vorm."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'p', "nachm."}, //$NON-NLS-2$ - {paris, 'p', "nachm."}, //$NON-NLS-2$ - {china, 'p', "nachm."}, //$NON-NLS-2$ - {0L, 'r', "08:00:00 vorm."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'r', "03:18:47 nachm."}, //$NON-NLS-2$ - {-1000L, 'r', "07:59:59 vorm."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'r', "01:59:07 nachm."}, //$NON-NLS-2$ - {paris, 'r', "12:00:00 nachm."}, //$NON-NLS-2$ - {china, 'r', "12:00:00 nachm."}, //$NON-NLS-2$ - {0L, 's', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 's', "9223372036854775"}, //$NON-NLS-2$ - {-1000L, 's', "-1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 's', "1147327147"}, //$NON-NLS-2$ - {paris, 's', "1147082400"}, //$NON-NLS-2$ - {china, 's', "1147118400"}, //$NON-NLS-2$ - {0L, 'y', "70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'y', "94"}, //$NON-NLS-2$ - {-1000L, 'y', "70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'y', "06"}, //$NON-NLS-2$ - {paris, 'y', "06"}, //$NON-NLS-2$ - {china, 'y', "06"}, //$NON-NLS-2$ - {0L, 'z', "+0800"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'z', "+0800"}, //$NON-NLS-2$ - {-1000L, 'z', "+0800"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'z', "+0800"}, //$NON-NLS-2$ - {paris, 'z', "+0100"}, //$NON-NLS-2$ - {china, 'z', "-0800"}, //$NON-NLS-2$ + {0L, 'a', "Do."}, + {Long.MAX_VALUE, 'a', "So."}, + {-1000L, 'a', "Do."}, + {new Date(1147327147578L), 'a', "Do."}, + {paris, 'a', "Mo."}, + {china, 'a', "Mo."}, + {0L, 'b', "Jan"}, + {Long.MAX_VALUE, 'b', "Aug"}, + {-1000L, 'b', "Jan"}, + {new Date(1147327147578L), 'b', "Mai"}, + {paris, 'b', "Mai"}, + {china, 'b', "Mai"}, + {0L, 'c', "Do. Jan 01 08:00:00 GMT+08:00 1970"}, + {Long.MAX_VALUE, 'c', "So. Aug 17 15:18:47 GMT+08:00 292278994"}, + {-1000L, 'c', "Do. Jan 01 07:59:59 GMT+08:00 1970"}, + {new Date(1147327147578L), 'c', "Do. Mai 11 13:59:07 GMT+08:00 2006"}, + {paris, 'c', "Mo. Mai 08 12:00:00 MESZ 2006"}, + {china, 'c', "Mo. Mai 08 12:00:00 GMT-08:00 2006"}, + {0L, 'd', "01"}, + {Long.MAX_VALUE, 'd', "17"}, + {-1000L, 'd', "01"}, + {new Date(1147327147578L), 'd', "11"}, + {paris, 'd', "08"}, + {china, 'd', "08"}, + {0L, 'e', "1"}, + {Long.MAX_VALUE, 'e', "17"}, + {-1000L, 'e', "1"}, + {new Date(1147327147578L), 'e', "11"}, + {paris, 'e', "8"}, + {china, 'e', "8"}, + {0L, 'h', "Jan"}, + {Long.MAX_VALUE, 'h', "Aug"}, + {-1000L, 'h', "Jan"}, + {new Date(1147327147578L), 'h', "Mai"}, + {paris, 'h', "Mai"}, + {china, 'h', "Mai"}, + {0L, 'j', "001"}, + {Long.MAX_VALUE, 'j', "229"}, + {-1000L, 'j', "001"}, + {new Date(1147327147578L), 'j', "131"}, + {paris, 'j', "128"}, + {china, 'j', "128"}, + {0L, 'k', "8"}, + {Long.MAX_VALUE, 'k', "15"}, + {-1000L, 'k', "7"}, + {new Date(1147327147578L), 'k', "13"}, + {paris, 'k', "12"}, + {china, 'k', "12"}, + {0L, 'l', "8"}, + {Long.MAX_VALUE, 'l', "3"}, + {-1000L, 'l', "7"}, + {new Date(1147327147578L), 'l', "1"}, + {paris, 'l', "12"}, + {china, 'l', "12"}, + {0L, 'm', "01"}, + {Long.MAX_VALUE, 'm', "08"}, + {-1000L, 'm', "01"}, + {new Date(1147327147578L), 'm', "05"}, + {paris, 'm', "05"}, + {china, 'm', "05"}, + {0L, 'p', "vorm."}, + {Long.MAX_VALUE, 'p', "nachm."}, + {-1000L, 'p', "vorm."}, + {new Date(1147327147578L), 'p', "nachm."}, + {paris, 'p', "nachm."}, + {china, 'p', "nachm."}, + {0L, 'r', "08:00:00 vorm."}, + {Long.MAX_VALUE, 'r', "03:18:47 nachm."}, + {-1000L, 'r', "07:59:59 vorm."}, + {new Date(1147327147578L), 'r', "01:59:07 nachm."}, + {paris, 'r', "12:00:00 nachm."}, + {china, 'r', "12:00:00 nachm."}, + {0L, 's', "0"}, + {Long.MAX_VALUE, 's', "9223372036854775"}, + {-1000L, 's', "-1"}, + {new Date(1147327147578L), 's', "1147327147"}, + {paris, 's', "1147082400"}, + {china, 's', "1147118400"}, + {0L, 'y', "70"}, + {Long.MAX_VALUE, 'y', "94"}, + {-1000L, 'y', "70"}, + {new Date(1147327147578L), 'y', "06"}, + {paris, 'y', "06"}, + {china, 'y', "06"}, + {0L, 'z', "+0800"}, + {Long.MAX_VALUE, 'z', "+0800"}, + {-1000L, 'z', "+0800"}, + {new Date(1147327147578L), 'z', "+0800"}, + {paris, 'z', "+0100"}, + {china, 'z', "-0800"}, }; final Object[][] lowerCaseFranceTriple = { - {0L, 'a', "jeu."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'a', "dim."}, //$NON-NLS-2$ - {-1000L, 'a', "jeu."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'a', "jeu."}, //$NON-NLS-2$ - {paris, 'a', "lun."}, //$NON-NLS-2$ - {china, 'a', "lun."}, //$NON-NLS-2$ - {0L, 'b', "janv."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'b', "ao\u00fbt"}, //$NON-NLS-2$ - {-1000L, 'b', "janv."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'b', "mai"}, //$NON-NLS-2$ - {paris, 'b', "mai"}, //$NON-NLS-2$ - {china, 'b', "mai"}, //$NON-NLS-2$ - {0L, 'c', "jeu. janv. 01 08:00:00 UTC+08:00 1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'c', "dim. ao\u00fbt 17 15:18:47 UTC+08:00 292278994"}, //$NON-NLS-2$ - {-1000L, 'c', "jeu. janv. 01 07:59:59 UTC+08:00 1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'c', "jeu. mai 11 13:59:07 UTC+08:00 2006"}, //$NON-NLS-2$ - {paris, 'c', "lun. mai 08 12:00:00 HAEC 2006"}, //$NON-NLS-2$ - {china, 'c', "lun. mai 08 12:00:00 UTC-08:00 2006"}, //$NON-NLS-2$ - {0L, 'd', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'd', "17"}, //$NON-NLS-2$ - {-1000L, 'd', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'd', "11"}, //$NON-NLS-2$ - {paris, 'd', "08"}, //$NON-NLS-2$ - {china, 'd', "08"}, //$NON-NLS-2$ - {0L, 'e', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'e', "17"}, //$NON-NLS-2$ - {-1000L, 'e', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'e', "11"}, //$NON-NLS-2$ - {paris, 'e', "8"}, //$NON-NLS-2$ - {china, 'e', "8"}, //$NON-NLS-2$ - {0L, 'h', "janv."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'h', "ao\u00fbt"}, //$NON-NLS-2$ - {-1000L, 'h', "janv."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'h', "mai"}, //$NON-NLS-2$ - {paris, 'h', "mai"}, //$NON-NLS-2$ - {china, 'h', "mai"}, //$NON-NLS-2$ - {0L, 'j', "001"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'j', "229"}, //$NON-NLS-2$ - {-1000L, 'j', "001"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'j', "131"}, //$NON-NLS-2$ - {paris, 'j', "128"}, //$NON-NLS-2$ - {china, 'j', "128"}, //$NON-NLS-2$ - {0L, 'k', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'k', "15"}, //$NON-NLS-2$ - {-1000L, 'k', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'k', "13"}, //$NON-NLS-2$ - {paris, 'k', "12"}, //$NON-NLS-2$ - {china, 'k', "12"}, //$NON-NLS-2$ - {0L, 'l', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'l', "3"}, //$NON-NLS-2$ - {-1000L, 'l', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'l', "1"}, //$NON-NLS-2$ - {paris, 'l', "12"}, //$NON-NLS-2$ - {china, 'l', "12"}, //$NON-NLS-2$ - {0L, 'm', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'm', "08"}, //$NON-NLS-2$ - {-1000L, 'm', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'm', "05"}, //$NON-NLS-2$ - {paris, 'm', "05"}, //$NON-NLS-2$ - {china, 'm', "05"}, //$NON-NLS-2$ - {0L, 'p', "am"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'p', "pm"}, //$NON-NLS-2$ - {-1000L, 'p', "am"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'p', "pm"}, //$NON-NLS-2$ - {paris, 'p', "pm"}, //$NON-NLS-2$ - {china, 'p', "pm"}, //$NON-NLS-2$ - {0L, 'r', "08:00:00 AM"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'r', "03:18:47 PM"}, //$NON-NLS-2$ - {-1000L, 'r', "07:59:59 AM"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'r', "01:59:07 PM"}, //$NON-NLS-2$ - {paris, 'r', "12:00:00 PM"}, //$NON-NLS-2$ - {china, 'r', "12:00:00 PM"}, //$NON-NLS-2$ - {0L, 's', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 's', "9223372036854775"}, //$NON-NLS-2$ - {-1000L, 's', "-1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 's', "1147327147"}, //$NON-NLS-2$ - {paris, 's', "1147082400"}, //$NON-NLS-2$ - {china, 's', "1147118400"}, //$NON-NLS-2$ - {0L, 'y', "70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'y', "94"}, //$NON-NLS-2$ - {-1000L, 'y', "70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'y', "06"}, //$NON-NLS-2$ - {paris, 'y', "06"}, //$NON-NLS-2$ - {china, 'y', "06"}, //$NON-NLS-2$ - {0L, 'z', "+0800"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'z', "+0800"}, //$NON-NLS-2$ - {-1000L, 'z', "+0800"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'z', "+0800"}, //$NON-NLS-2$ - {paris, 'z', "+0100"}, //$NON-NLS-2$ - {china, 'z', "-0800"}, //$NON-NLS-2$ + {0L, 'a', "jeu."}, + {Long.MAX_VALUE, 'a', "dim."}, + {-1000L, 'a', "jeu."}, + {new Date(1147327147578L), 'a', "jeu."}, + {paris, 'a', "lun."}, + {china, 'a', "lun."}, + {0L, 'b', "janv."}, + {Long.MAX_VALUE, 'b', "ao\u00fbt"}, + {-1000L, 'b', "janv."}, + {new Date(1147327147578L), 'b', "mai"}, + {paris, 'b', "mai"}, + {china, 'b', "mai"}, + {0L, 'c', "jeu. janv. 01 08:00:00 UTC+08:00 1970"}, + {Long.MAX_VALUE, 'c', "dim. ao\u00fbt 17 15:18:47 UTC+08:00 292278994"}, + {-1000L, 'c', "jeu. janv. 01 07:59:59 UTC+08:00 1970"}, + {new Date(1147327147578L), 'c', "jeu. mai 11 13:59:07 UTC+08:00 2006"}, + {paris, 'c', "lun. mai 08 12:00:00 HAEC 2006"}, + {china, 'c', "lun. mai 08 12:00:00 UTC-08:00 2006"}, + {0L, 'd', "01"}, + {Long.MAX_VALUE, 'd', "17"}, + {-1000L, 'd', "01"}, + {new Date(1147327147578L), 'd', "11"}, + {paris, 'd', "08"}, + {china, 'd', "08"}, + {0L, 'e', "1"}, + {Long.MAX_VALUE, 'e', "17"}, + {-1000L, 'e', "1"}, + {new Date(1147327147578L), 'e', "11"}, + {paris, 'e', "8"}, + {china, 'e', "8"}, + {0L, 'h', "janv."}, + {Long.MAX_VALUE, 'h', "ao\u00fbt"}, + {-1000L, 'h', "janv."}, + {new Date(1147327147578L), 'h', "mai"}, + {paris, 'h', "mai"}, + {china, 'h', "mai"}, + {0L, 'j', "001"}, + {Long.MAX_VALUE, 'j', "229"}, + {-1000L, 'j', "001"}, + {new Date(1147327147578L), 'j', "131"}, + {paris, 'j', "128"}, + {china, 'j', "128"}, + {0L, 'k', "8"}, + {Long.MAX_VALUE, 'k', "15"}, + {-1000L, 'k', "7"}, + {new Date(1147327147578L), 'k', "13"}, + {paris, 'k', "12"}, + {china, 'k', "12"}, + {0L, 'l', "8"}, + {Long.MAX_VALUE, 'l', "3"}, + {-1000L, 'l', "7"}, + {new Date(1147327147578L), 'l', "1"}, + {paris, 'l', "12"}, + {china, 'l', "12"}, + {0L, 'm', "01"}, + {Long.MAX_VALUE, 'm', "08"}, + {-1000L, 'm', "01"}, + {new Date(1147327147578L), 'm', "05"}, + {paris, 'm', "05"}, + {china, 'm', "05"}, + {0L, 'p', "am"}, + {Long.MAX_VALUE, 'p', "pm"}, + {-1000L, 'p', "am"}, + {new Date(1147327147578L), 'p', "pm"}, + {paris, 'p', "pm"}, + {china, 'p', "pm"}, + {0L, 'r', "08:00:00 AM"}, + {Long.MAX_VALUE, 'r', "03:18:47 PM"}, + {-1000L, 'r', "07:59:59 AM"}, + {new Date(1147327147578L), 'r', "01:59:07 PM"}, + {paris, 'r', "12:00:00 PM"}, + {china, 'r', "12:00:00 PM"}, + {0L, 's', "0"}, + {Long.MAX_VALUE, 's', "9223372036854775"}, + {-1000L, 's', "-1"}, + {new Date(1147327147578L), 's', "1147327147"}, + {paris, 's', "1147082400"}, + {china, 's', "1147118400"}, + {0L, 'y', "70"}, + {Long.MAX_VALUE, 'y', "94"}, + {-1000L, 'y', "70"}, + {new Date(1147327147578L), 'y', "06"}, + {paris, 'y', "06"}, + {china, 'y', "06"}, + {0L, 'z', "+0800"}, + {Long.MAX_VALUE, 'z', "+0800"}, + {-1000L, 'z', "+0800"}, + {new Date(1147327147578L), 'z', "+0800"}, + {paris, 'z', "+0100"}, + {china, 'z', "-0800"}, }; final Object[][] lowerCaseJapanTriple = { - {0L, 'a', "\u6728"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'a', "\u65e5"}, //$NON-NLS-2$ - {-1000L, 'a', "\u6728"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'a', "\u6728"}, //$NON-NLS-2$ - {paris, 'a', "\u6708"}, //$NON-NLS-2$ - {china, 'a', "\u6708"}, //$NON-NLS-2$ - {0L, 'b', "1\u6708"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'b', "8\u6708"}, //$NON-NLS-2$ - {-1000L, 'b', "1\u6708"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'b', "5\u6708"}, //$NON-NLS-2$ - {paris, 'b', "5\u6708"}, //$NON-NLS-2$ - {china, 'b', "5\u6708"}, //$NON-NLS-2$ - {0L, 'c', "\u6728 1\u6708 01 08:00:00 GMT+08:00 1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'c', "\u65e5 8\u6708 17 15:18:47 GMT+08:00 292278994"}, //$NON-NLS-2$ - {-1000L, 'c', "\u6728 1\u6708 01 07:59:59 GMT+08:00 1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'c', "\u6728 5\u6708 11 13:59:07 GMT+08:00 2006"}, //$NON-NLS-2$ - {paris, 'c', "\u6708 5\u6708 08 12:00:00 GMT+02:00 2006"}, //$NON-NLS-2$ - {china, 'c', "\u6708 5\u6708 08 12:00:00 GMT-08:00 2006"}, //$NON-NLS-2$ - {0L, 'd', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'd', "17"}, //$NON-NLS-2$ - {-1000L, 'd', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'd', "11"}, //$NON-NLS-2$ - {paris, 'd', "08"}, //$NON-NLS-2$ - {china, 'd', "08"}, //$NON-NLS-2$ - {0L, 'e', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'e', "17"}, //$NON-NLS-2$ - {-1000L, 'e', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'e', "11"}, //$NON-NLS-2$ - {paris, 'e', "8"}, //$NON-NLS-2$ - {china, 'e', "8"}, //$NON-NLS-2$ - {0L, 'h', "1\u6708"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'h', "8\u6708"}, //$NON-NLS-2$ - {-1000L, 'h', "1\u6708"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'h', "5\u6708"}, //$NON-NLS-2$ - {paris, 'h', "5\u6708"}, //$NON-NLS-2$ - {china, 'h', "5\u6708"}, //$NON-NLS-2$ - {0L, 'j', "001"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'j', "229"}, //$NON-NLS-2$ - {-1000L, 'j', "001"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'j', "131"}, //$NON-NLS-2$ - {paris, 'j', "128"}, //$NON-NLS-2$ - {china, 'j', "128"}, //$NON-NLS-2$ - {0L, 'k', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'k', "15"}, //$NON-NLS-2$ - {-1000L, 'k', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'k', "13"}, //$NON-NLS-2$ - {paris, 'k', "12"}, //$NON-NLS-2$ - {china, 'k', "12"}, //$NON-NLS-2$ - {0L, 'l', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'l', "3"}, //$NON-NLS-2$ - {-1000L, 'l', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'l', "1"}, //$NON-NLS-2$ - {paris, 'l', "12"}, //$NON-NLS-2$ - {china, 'l', "12"}, //$NON-NLS-2$ - {0L, 'm', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'm', "08"}, //$NON-NLS-2$ - {-1000L, 'm', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'm', "05"}, //$NON-NLS-2$ - {paris, 'm', "05"}, //$NON-NLS-2$ - {china, 'm', "05"}, //$NON-NLS-2$ - {0L, 'p', "\u5348\u524d"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'p', "\u5348\u5f8c"}, //$NON-NLS-2$ - {-1000L, 'p', "\u5348\u524d"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'p', "\u5348\u5f8c"}, //$NON-NLS-2$ - {paris, 'p', "\u5348\u5f8c"}, //$NON-NLS-2$ - {china, 'p', "\u5348\u5f8c"}, //$NON-NLS-2$ - {0L, 'r', "08:00:00 \u5348\u524d"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'r', "03:18:47 \u5348\u5f8c"}, //$NON-NLS-2$ - {-1000L, 'r', "07:59:59 \u5348\u524d"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'r', "01:59:07 \u5348\u5f8c"}, //$NON-NLS-2$ - {paris, 'r', "12:00:00 \u5348\u5f8c"}, //$NON-NLS-2$ - {china, 'r', "12:00:00 \u5348\u5f8c"}, //$NON-NLS-2$ - {0L, 's', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 's', "9223372036854775"}, //$NON-NLS-2$ - {-1000L, 's', "-1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 's', "1147327147"}, //$NON-NLS-2$ - {paris, 's', "1147082400"}, //$NON-NLS-2$ - {china, 's', "1147118400"}, //$NON-NLS-2$ - {0L, 'y', "70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'y', "94"}, //$NON-NLS-2$ - {-1000L, 'y', "70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'y', "06"}, //$NON-NLS-2$ - {paris, 'y', "06"}, //$NON-NLS-2$ - {china, 'y', "06"}, //$NON-NLS-2$ - {0L, 'z', "+0800"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'z', "+0800"}, //$NON-NLS-2$ - {-1000L, 'z', "+0800"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'z', "+0800"}, //$NON-NLS-2$ - {paris, 'z', "+0100"}, //$NON-NLS-2$ - {china, 'z', "-0800"}, //$NON-NLS-2$ + {0L, 'a', "\u6728"}, + {Long.MAX_VALUE, 'a', "\u65e5"}, + {-1000L, 'a', "\u6728"}, + {new Date(1147327147578L), 'a', "\u6728"}, + {paris, 'a', "\u6708"}, + {china, 'a', "\u6708"}, + {0L, 'b', "1\u6708"}, + {Long.MAX_VALUE, 'b', "8\u6708"}, + {-1000L, 'b', "1\u6708"}, + {new Date(1147327147578L), 'b', "5\u6708"}, + {paris, 'b', "5\u6708"}, + {china, 'b', "5\u6708"}, + {0L, 'c', "\u6728 1\u6708 01 08:00:00 GMT+08:00 1970"}, + {Long.MAX_VALUE, 'c', "\u65e5 8\u6708 17 15:18:47 GMT+08:00 292278994"}, + {-1000L, 'c', "\u6728 1\u6708 01 07:59:59 GMT+08:00 1970"}, + {new Date(1147327147578L), 'c', "\u6728 5\u6708 11 13:59:07 GMT+08:00 2006"}, + {paris, 'c', "\u6708 5\u6708 08 12:00:00 GMT+02:00 2006"}, + {china, 'c', "\u6708 5\u6708 08 12:00:00 GMT-08:00 2006"}, + {0L, 'd', "01"}, + {Long.MAX_VALUE, 'd', "17"}, + {-1000L, 'd', "01"}, + {new Date(1147327147578L), 'd', "11"}, + {paris, 'd', "08"}, + {china, 'd', "08"}, + {0L, 'e', "1"}, + {Long.MAX_VALUE, 'e', "17"}, + {-1000L, 'e', "1"}, + {new Date(1147327147578L), 'e', "11"}, + {paris, 'e', "8"}, + {china, 'e', "8"}, + {0L, 'h', "1\u6708"}, + {Long.MAX_VALUE, 'h', "8\u6708"}, + {-1000L, 'h', "1\u6708"}, + {new Date(1147327147578L), 'h', "5\u6708"}, + {paris, 'h', "5\u6708"}, + {china, 'h', "5\u6708"}, + {0L, 'j', "001"}, + {Long.MAX_VALUE, 'j', "229"}, + {-1000L, 'j', "001"}, + {new Date(1147327147578L), 'j', "131"}, + {paris, 'j', "128"}, + {china, 'j', "128"}, + {0L, 'k', "8"}, + {Long.MAX_VALUE, 'k', "15"}, + {-1000L, 'k', "7"}, + {new Date(1147327147578L), 'k', "13"}, + {paris, 'k', "12"}, + {china, 'k', "12"}, + {0L, 'l', "8"}, + {Long.MAX_VALUE, 'l', "3"}, + {-1000L, 'l', "7"}, + {new Date(1147327147578L), 'l', "1"}, + {paris, 'l', "12"}, + {china, 'l', "12"}, + {0L, 'm', "01"}, + {Long.MAX_VALUE, 'm', "08"}, + {-1000L, 'm', "01"}, + {new Date(1147327147578L), 'm', "05"}, + {paris, 'm', "05"}, + {china, 'm', "05"}, + {0L, 'p', "\u5348\u524d"}, + {Long.MAX_VALUE, 'p', "\u5348\u5f8c"}, + {-1000L, 'p', "\u5348\u524d"}, + {new Date(1147327147578L), 'p', "\u5348\u5f8c"}, + {paris, 'p', "\u5348\u5f8c"}, + {china, 'p', "\u5348\u5f8c"}, + {0L, 'r', "08:00:00 \u5348\u524d"}, + {Long.MAX_VALUE, 'r', "03:18:47 \u5348\u5f8c"}, + {-1000L, 'r', "07:59:59 \u5348\u524d"}, + {new Date(1147327147578L), 'r', "01:59:07 \u5348\u5f8c"}, + {paris, 'r', "12:00:00 \u5348\u5f8c"}, + {china, 'r', "12:00:00 \u5348\u5f8c"}, + {0L, 's', "0"}, + {Long.MAX_VALUE, 's', "9223372036854775"}, + {-1000L, 's', "-1"}, + {new Date(1147327147578L), 's', "1147327147"}, + {paris, 's', "1147082400"}, + {china, 's', "1147118400"}, + {0L, 'y', "70"}, + {Long.MAX_VALUE, 'y', "94"}, + {-1000L, 'y', "70"}, + {new Date(1147327147578L), 'y', "06"}, + {paris, 'y', "06"}, + {china, 'y', "06"}, + {0L, 'z', "+0800"}, + {Long.MAX_VALUE, 'z', "+0800"}, + {-1000L, 'z', "+0800"}, + {new Date(1147327147578L), 'z', "+0800"}, + {paris, 'z', "+0100"}, + {china, 'z', "-0800"}, }; final int input = 0; @@ -2092,353 +2092,353 @@ public class FormatterTest extends TestCase { final int output = 2; for (int i = 0; i < 90; i++) { // go through legal conversion - String formatSpecifier = "%t" + lowerCaseGermanTriple[i][pattern]; //$NON-NLS-2$ - String formatSpecifierUpper = "%T" + lowerCaseGermanTriple[i][pattern]; //$NON-NLS-2$ + String formatSpecifier = "%t" + lowerCaseGermanTriple[i][pattern]; + String formatSpecifierUpper = "%T" + lowerCaseGermanTriple[i][pattern]; // test '%t' f = new Formatter(Locale.GERMAN); f.format(formatSpecifier, lowerCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + lowerCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + lowerCaseGermanTriple[i][input], lowerCaseGermanTriple[i][output], f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.FRANCE, formatSpecifier, lowerCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + lowerCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + lowerCaseFranceTriple[i][input], lowerCaseFranceTriple[i][output], f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.JAPAN, formatSpecifier, lowerCaseJapanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + lowerCaseJapanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + lowerCaseJapanTriple[i][input], lowerCaseJapanTriple[i][output], f.toString()); // test '%T' f = new Formatter(Locale.GERMAN); f.format(formatSpecifierUpper, lowerCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + lowerCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + lowerCaseGermanTriple[i][input], ((String)lowerCaseGermanTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.FRANCE, formatSpecifierUpper, lowerCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + lowerCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + lowerCaseFranceTriple[i][input], ((String)lowerCaseFranceTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.JAPAN, formatSpecifierUpper, lowerCaseJapanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + lowerCaseJapanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + lowerCaseJapanTriple[i][input], ((String)lowerCaseJapanTriple[i][output]) .toUpperCase(Locale.US), f.toString()); } final Object[][] upperCaseGermanTriple = { - {0L, 'A', "Donnerstag"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'A', "Sonntag"}, //$NON-NLS-2$ - {-1000L, 'A', "Donnerstag"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'A', "Donnerstag"}, //$NON-NLS-2$ - {paris, 'A', "Montag"}, //$NON-NLS-2$ - {china, 'A', "Montag"}, //$NON-NLS-2$ - {0L, 'B', "Januar"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'B', "August"}, //$NON-NLS-2$ - {-1000L, 'B', "Januar"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'B', "Mai"}, //$NON-NLS-2$ - {paris, 'B', "Mai"}, //$NON-NLS-2$ - {china, 'B', "Mai"}, //$NON-NLS-2$ - {0L, 'C', "19"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'C', "2922789"}, //$NON-NLS-2$ - {-1000L, 'C', "19"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'C', "20"}, //$NON-NLS-2$ - {paris, 'C', "20"}, //$NON-NLS-2$ - {china, 'C', "20"}, //$NON-NLS-2$ - {0L, 'D', "01/01/70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'D', "08/17/94"}, //$NON-NLS-2$ - {-1000L, 'D', "01/01/70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'D', "05/11/06"}, //$NON-NLS-2$ - {paris, 'D', "05/08/06"}, //$NON-NLS-2$ - {china, 'D', "05/08/06"}, //$NON-NLS-2$ - {0L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'F', "292278994-08-17"}, //$NON-NLS-2$ - {-1000L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'F', "2006-05-11"}, //$NON-NLS-2$ - {paris, 'F', "2006-05-08"}, //$NON-NLS-2$ - {china, 'F', "2006-05-08"}, //$NON-NLS-2$ - {0L, 'H', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'H', "15"}, //$NON-NLS-2$ - {-1000L, 'H', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'H', "13"}, //$NON-NLS-2$ - {paris, 'H', "12"}, //$NON-NLS-2$ - {china, 'H', "12"}, //$NON-NLS-2$ - {0L, 'I', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'I', "03"}, //$NON-NLS-2$ - {-1000L, 'I', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'I', "01"}, //$NON-NLS-2$ - {paris, 'I', "12"}, //$NON-NLS-2$ - {china, 'I', "12"}, //$NON-NLS-2$ - {0L, 'L', "000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'L', "807"}, //$NON-NLS-2$ - {-1000L, 'L', "000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'L', "578"}, //$NON-NLS-2$ - {paris, 'L', "453"}, //$NON-NLS-2$ - {china, 'L', "609"}, //$NON-NLS-2$ - {0L, 'M', "00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'M', "18"}, //$NON-NLS-2$ - {-1000L, 'M', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'M', "59"}, //$NON-NLS-2$ - {paris, 'M', "00"}, //$NON-NLS-2$ - {china, 'M', "00"}, //$NON-NLS-2$ - {0L, 'N', "000000000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'N', "807000000"}, //$NON-NLS-2$ - {-1000L, 'N', "000000000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'N', "578000000"}, //$NON-NLS-2$ - {paris, 'N', "609000000"}, //$NON-NLS-2$ - {china, 'N', "609000000"}, //$NON-NLS-2$ - {0L, 'Q', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Q', "9223372036854775807"}, //$NON-NLS-2$ - {-1000L, 'Q', "-1000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Q', "1147327147578"}, //$NON-NLS-2$ - {paris, 'Q', "1147082400453"}, //$NON-NLS-2$ - {china, 'Q', "1147118400609"}, //$NON-NLS-2$ - {0L, 'R', "08:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'R', "15:18"}, //$NON-NLS-2$ - {-1000L, 'R', "07:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'R', "13:59"}, //$NON-NLS-2$ - {paris, 'R', "12:00"}, //$NON-NLS-2$ - {china, 'R', "12:00"}, //$NON-NLS-2$ - {0L, 'S', "00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'S', "47"}, //$NON-NLS-2$ - {-1000L, 'S', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'S', "07"}, //$NON-NLS-2$ - {paris, 'S', "00"}, //$NON-NLS-2$ - {china, 'S', "00"}, //$NON-NLS-2$ - {0L, 'T', "08:00:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'T', "15:18:47"}, //$NON-NLS-2$ - {-1000L, 'T', "07:59:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'T', "13:59:07"}, //$NON-NLS-2$ - {paris, 'T', "12:00:00"}, //$NON-NLS-2$ - {china, 'T', "12:00:00"}, //$NON-NLS-2$ - {0L, 'Y', "1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Y', "292278994"}, //$NON-NLS-2$ - {-1000L, 'Y', "1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Y', "2006"}, //$NON-NLS-2$ - {paris, 'Y', "2006"}, //$NON-NLS-2$ - {china, 'Y', "2006"}, //$NON-NLS-2$ - {0L, 'Z', "CST"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Z', "CST"}, //$NON-NLS-2$ - {-1000L, 'Z', "CST"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Z', "CST"}, //$NON-NLS-2$ - {paris, 'Z', "CEST"}, //$NON-NLS-2$ - {china, 'Z', "GMT-08:00"}, //$NON-NLS-2$ + {0L, 'A', "Donnerstag"}, + {Long.MAX_VALUE, 'A', "Sonntag"}, + {-1000L, 'A', "Donnerstag"}, + {new Date(1147327147578L), 'A', "Donnerstag"}, + {paris, 'A', "Montag"}, + {china, 'A', "Montag"}, + {0L, 'B', "Januar"}, + {Long.MAX_VALUE, 'B', "August"}, + {-1000L, 'B', "Januar"}, + {new Date(1147327147578L), 'B', "Mai"}, + {paris, 'B', "Mai"}, + {china, 'B', "Mai"}, + {0L, 'C', "19"}, + {Long.MAX_VALUE, 'C', "2922789"}, + {-1000L, 'C', "19"}, + {new Date(1147327147578L), 'C', "20"}, + {paris, 'C', "20"}, + {china, 'C', "20"}, + {0L, 'D', "01/01/70"}, + {Long.MAX_VALUE, 'D', "08/17/94"}, + {-1000L, 'D', "01/01/70"}, + {new Date(1147327147578L), 'D', "05/11/06"}, + {paris, 'D', "05/08/06"}, + {china, 'D', "05/08/06"}, + {0L, 'F', "1970-01-01"}, + {Long.MAX_VALUE, 'F', "292278994-08-17"}, + {-1000L, 'F', "1970-01-01"}, + {new Date(1147327147578L), 'F', "2006-05-11"}, + {paris, 'F', "2006-05-08"}, + {china, 'F', "2006-05-08"}, + {0L, 'H', "08"}, + {Long.MAX_VALUE, 'H', "15"}, + {-1000L, 'H', "07"}, + {new Date(1147327147578L), 'H', "13"}, + {paris, 'H', "12"}, + {china, 'H', "12"}, + {0L, 'I', "08"}, + {Long.MAX_VALUE, 'I', "03"}, + {-1000L, 'I', "07"}, + {new Date(1147327147578L), 'I', "01"}, + {paris, 'I', "12"}, + {china, 'I', "12"}, + {0L, 'L', "000"}, + {Long.MAX_VALUE, 'L', "807"}, + {-1000L, 'L', "000"}, + {new Date(1147327147578L), 'L', "578"}, + {paris, 'L', "453"}, + {china, 'L', "609"}, + {0L, 'M', "00"}, + {Long.MAX_VALUE, 'M', "18"}, + {-1000L, 'M', "59"}, + {new Date(1147327147578L), 'M', "59"}, + {paris, 'M', "00"}, + {china, 'M', "00"}, + {0L, 'N', "000000000"}, + {Long.MAX_VALUE, 'N', "807000000"}, + {-1000L, 'N', "000000000"}, + {new Date(1147327147578L), 'N', "578000000"}, + {paris, 'N', "609000000"}, + {china, 'N', "609000000"}, + {0L, 'Q', "0"}, + {Long.MAX_VALUE, 'Q', "9223372036854775807"}, + {-1000L, 'Q', "-1000"}, + {new Date(1147327147578L), 'Q', "1147327147578"}, + {paris, 'Q', "1147082400453"}, + {china, 'Q', "1147118400609"}, + {0L, 'R', "08:00"}, + {Long.MAX_VALUE, 'R', "15:18"}, + {-1000L, 'R', "07:59"}, + {new Date(1147327147578L), 'R', "13:59"}, + {paris, 'R', "12:00"}, + {china, 'R', "12:00"}, + {0L, 'S', "00"}, + {Long.MAX_VALUE, 'S', "47"}, + {-1000L, 'S', "59"}, + {new Date(1147327147578L), 'S', "07"}, + {paris, 'S', "00"}, + {china, 'S', "00"}, + {0L, 'T', "08:00:00"}, + {Long.MAX_VALUE, 'T', "15:18:47"}, + {-1000L, 'T', "07:59:59"}, + {new Date(1147327147578L), 'T', "13:59:07"}, + {paris, 'T', "12:00:00"}, + {china, 'T', "12:00:00"}, + {0L, 'Y', "1970"}, + {Long.MAX_VALUE, 'Y', "292278994"}, + {-1000L, 'Y', "1970"}, + {new Date(1147327147578L), 'Y', "2006"}, + {paris, 'Y', "2006"}, + {china, 'Y', "2006"}, + {0L, 'Z', "CST"}, + {Long.MAX_VALUE, 'Z', "CST"}, + {-1000L, 'Z', "CST"}, + {new Date(1147327147578L), 'Z', "CST"}, + {paris, 'Z', "CEST"}, + {china, 'Z', "GMT-08:00"}, }; final Object[][] upperCaseFranceTriple = { - {0L, 'A', "jeudi"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'A', "dimanche"}, //$NON-NLS-2$ - {-1000L, 'A', "jeudi"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'A', "jeudi"}, //$NON-NLS-2$ - {paris, 'A', "lundi"}, //$NON-NLS-2$ - {china, 'A', "lundi"}, //$NON-NLS-2$ - {0L, 'B', "janvier"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'B', "ao\u00fbt"}, //$NON-NLS-2$ - {-1000L, 'B', "janvier"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'B', "mai"}, //$NON-NLS-2$ - {paris, 'B', "mai"}, //$NON-NLS-2$ - {china, 'B', "mai"}, //$NON-NLS-2$ - {0L, 'C', "19"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'C', "2922789"}, //$NON-NLS-2$ - {-1000L, 'C', "19"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'C', "20"}, //$NON-NLS-2$ - {paris, 'C', "20"}, //$NON-NLS-2$ - {china, 'C', "20"}, //$NON-NLS-2$ - {0L, 'D', "01/01/70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'D', "08/17/94"}, //$NON-NLS-2$ - {-1000L, 'D', "01/01/70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'D', "05/11/06"}, //$NON-NLS-2$ - {paris, 'D', "05/08/06"}, //$NON-NLS-2$ - {china, 'D', "05/08/06"}, //$NON-NLS-2$ - {0L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'F', "292278994-08-17"}, //$NON-NLS-2$ - {-1000L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'F', "2006-05-11"}, //$NON-NLS-2$ - {paris, 'F', "2006-05-08"}, //$NON-NLS-2$ - {china, 'F', "2006-05-08"}, //$NON-NLS-2$ - {0L, 'H', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'H', "15"}, //$NON-NLS-2$ - {-1000L, 'H', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'H', "13"}, //$NON-NLS-2$ - {paris, 'H', "12"}, //$NON-NLS-2$ - {china, 'H', "12"}, //$NON-NLS-2$ - {0L, 'I', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'I', "03"}, //$NON-NLS-2$ - {-1000L, 'I', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'I', "01"}, //$NON-NLS-2$ - {paris, 'I', "12"}, //$NON-NLS-2$ - {china, 'I', "12"}, //$NON-NLS-2$ - {0L, 'L', "000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'L', "807"}, //$NON-NLS-2$ - {-1000L, 'L', "000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'L', "578"}, //$NON-NLS-2$ - {paris, 'L', "453"}, //$NON-NLS-2$ - {china, 'L', "609"}, //$NON-NLS-2$ - {0L, 'M', "00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'M', "18"}, //$NON-NLS-2$ - {-1000L, 'M', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'M', "59"}, //$NON-NLS-2$ - {paris, 'M', "00"}, //$NON-NLS-2$ - {china, 'M', "00"}, //$NON-NLS-2$ - {0L, 'N', "000000000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'N', "807000000"}, //$NON-NLS-2$ - {-1000L, 'N', "000000000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'N', "578000000"}, //$NON-NLS-2$ - {paris, 'N', "453000000"}, //$NON-NLS-2$ - {china, 'N', "468000000"}, //$NON-NLS-2$ - {0L, 'Q', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Q', "9223372036854775807"}, //$NON-NLS-2$ - {-1000L, 'Q', "-1000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Q', "1147327147578"}, //$NON-NLS-2$ - {paris, 'Q', "1147082400453"}, //$NON-NLS-2$ - {china, 'Q', "1147118400609"}, //$NON-NLS-2$ - {0L, 'R', "08:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'R', "15:18"}, //$NON-NLS-2$ - {-1000L, 'R', "07:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'R', "13:59"}, //$NON-NLS-2$ - {paris, 'R', "12:00"}, //$NON-NLS-2$ - {china, 'R', "12:00"}, //$NON-NLS-2$ - {0L, 'S', "00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'S', "47"}, //$NON-NLS-2$ - {-1000L, 'S', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'S', "07"}, //$NON-NLS-2$ - {paris, 'S', "00"}, //$NON-NLS-2$ - {china, 'S', "00"}, //$NON-NLS-2$ - {0L, 'T', "08:00:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'T', "15:18:47"}, //$NON-NLS-2$ - {-1000L, 'T', "07:59:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'T', "13:59:07"}, //$NON-NLS-2$ - {paris, 'T', "12:00:00"}, //$NON-NLS-2$ - {china, 'T', "12:00:00"}, //$NON-NLS-2$ - {0L, 'Y', "1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Y', "292278994"}, //$NON-NLS-2$ - {-1000L, 'Y', "1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Y', "2006"}, //$NON-NLS-2$ - {paris, 'Y', "2006"}, //$NON-NLS-2$ - {china, 'Y', "2006"}, //$NON-NLS-2$ - {0L, 'Z', "CST"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Z', "CST"}, //$NON-NLS-2$ - {-1000L, 'Z', "CST"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Z', "CST"}, //$NON-NLS-2$ - {paris, 'Z', "CEST"}, //$NON-NLS-2$ - {china, 'Z', "GMT-08:00"}, //$NON-NLS-2$ + {0L, 'A', "jeudi"}, + {Long.MAX_VALUE, 'A', "dimanche"}, + {-1000L, 'A', "jeudi"}, + {new Date(1147327147578L), 'A', "jeudi"}, + {paris, 'A', "lundi"}, + {china, 'A', "lundi"}, + {0L, 'B', "janvier"}, + {Long.MAX_VALUE, 'B', "ao\u00fbt"}, + {-1000L, 'B', "janvier"}, + {new Date(1147327147578L), 'B', "mai"}, + {paris, 'B', "mai"}, + {china, 'B', "mai"}, + {0L, 'C', "19"}, + {Long.MAX_VALUE, 'C', "2922789"}, + {-1000L, 'C', "19"}, + {new Date(1147327147578L), 'C', "20"}, + {paris, 'C', "20"}, + {china, 'C', "20"}, + {0L, 'D', "01/01/70"}, + {Long.MAX_VALUE, 'D', "08/17/94"}, + {-1000L, 'D', "01/01/70"}, + {new Date(1147327147578L), 'D', "05/11/06"}, + {paris, 'D', "05/08/06"}, + {china, 'D', "05/08/06"}, + {0L, 'F', "1970-01-01"}, + {Long.MAX_VALUE, 'F', "292278994-08-17"}, + {-1000L, 'F', "1970-01-01"}, + {new Date(1147327147578L), 'F', "2006-05-11"}, + {paris, 'F', "2006-05-08"}, + {china, 'F', "2006-05-08"}, + {0L, 'H', "08"}, + {Long.MAX_VALUE, 'H', "15"}, + {-1000L, 'H', "07"}, + {new Date(1147327147578L), 'H', "13"}, + {paris, 'H', "12"}, + {china, 'H', "12"}, + {0L, 'I', "08"}, + {Long.MAX_VALUE, 'I', "03"}, + {-1000L, 'I', "07"}, + {new Date(1147327147578L), 'I', "01"}, + {paris, 'I', "12"}, + {china, 'I', "12"}, + {0L, 'L', "000"}, + {Long.MAX_VALUE, 'L', "807"}, + {-1000L, 'L', "000"}, + {new Date(1147327147578L), 'L', "578"}, + {paris, 'L', "453"}, + {china, 'L', "609"}, + {0L, 'M', "00"}, + {Long.MAX_VALUE, 'M', "18"}, + {-1000L, 'M', "59"}, + {new Date(1147327147578L), 'M', "59"}, + {paris, 'M', "00"}, + {china, 'M', "00"}, + {0L, 'N', "000000000"}, + {Long.MAX_VALUE, 'N', "807000000"}, + {-1000L, 'N', "000000000"}, + {new Date(1147327147578L), 'N', "578000000"}, + {paris, 'N', "453000000"}, + {china, 'N', "468000000"}, + {0L, 'Q', "0"}, + {Long.MAX_VALUE, 'Q', "9223372036854775807"}, + {-1000L, 'Q', "-1000"}, + {new Date(1147327147578L), 'Q', "1147327147578"}, + {paris, 'Q', "1147082400453"}, + {china, 'Q', "1147118400609"}, + {0L, 'R', "08:00"}, + {Long.MAX_VALUE, 'R', "15:18"}, + {-1000L, 'R', "07:59"}, + {new Date(1147327147578L), 'R', "13:59"}, + {paris, 'R', "12:00"}, + {china, 'R', "12:00"}, + {0L, 'S', "00"}, + {Long.MAX_VALUE, 'S', "47"}, + {-1000L, 'S', "59"}, + {new Date(1147327147578L), 'S', "07"}, + {paris, 'S', "00"}, + {china, 'S', "00"}, + {0L, 'T', "08:00:00"}, + {Long.MAX_VALUE, 'T', "15:18:47"}, + {-1000L, 'T', "07:59:59"}, + {new Date(1147327147578L), 'T', "13:59:07"}, + {paris, 'T', "12:00:00"}, + {china, 'T', "12:00:00"}, + {0L, 'Y', "1970"}, + {Long.MAX_VALUE, 'Y', "292278994"}, + {-1000L, 'Y', "1970"}, + {new Date(1147327147578L), 'Y', "2006"}, + {paris, 'Y', "2006"}, + {china, 'Y', "2006"}, + {0L, 'Z', "CST"}, + {Long.MAX_VALUE, 'Z', "CST"}, + {-1000L, 'Z', "CST"}, + {new Date(1147327147578L), 'Z', "CST"}, + {paris, 'Z', "CEST"}, + {china, 'Z', "GMT-08:00"}, }; final Object[][] upperCaseJapanTriple = { - {0L, 'A', "\u6728\u66dc\u65e5"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'A', "\u65e5\u66dc\u65e5"}, //$NON-NLS-2$ - {-1000L, 'A', "\u6728\u66dc\u65e5"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'A', "\u6728\u66dc\u65e5"}, //$NON-NLS-2$ - {paris, 'A', "\u6708\u66dc\u65e5"}, //$NON-NLS-2$ - {china, 'A', "\u6708\u66dc\u65e5"}, //$NON-NLS-2$ - {0L, 'B', "1\u6708"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'B', "8\u6708"}, //$NON-NLS-2$ - {-1000L, 'B', "1\u6708"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'B', "5\u6708"}, //$NON-NLS-2$ - {paris, 'B', "5\u6708"}, //$NON-NLS-2$ - {china, 'B', "5\u6708"}, //$NON-NLS-2$ - {0L, 'C', "19"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'C', "2922789"}, //$NON-NLS-2$ - {-1000L, 'C', "19"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'C', "20"}, //$NON-NLS-2$ - {paris, 'C', "20"}, //$NON-NLS-2$ - {china, 'C', "20"}, //$NON-NLS-2$ - {0L, 'D', "01/01/70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'D', "08/17/94"}, //$NON-NLS-2$ - {-1000L, 'D', "01/01/70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'D', "05/11/06"}, //$NON-NLS-2$ - {paris, 'D', "05/08/06"}, //$NON-NLS-2$ - {china, 'D', "05/08/06"}, //$NON-NLS-2$ - {0L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'F', "292278994-08-17"}, //$NON-NLS-2$ - {-1000L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'F', "2006-05-11"}, //$NON-NLS-2$ - {paris, 'F', "2006-05-08"}, //$NON-NLS-2$ - {china, 'F', "2006-05-08"}, //$NON-NLS-2$ - {0L, 'H', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'H', "15"}, //$NON-NLS-2$ - {-1000L, 'H', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'H', "13"}, //$NON-NLS-2$ - {paris, 'H', "12"}, //$NON-NLS-2$ - {china, 'H', "12"}, //$NON-NLS-2$ - {0L, 'I', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'I', "03"}, //$NON-NLS-2$ - {-1000L, 'I', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'I', "01"}, //$NON-NLS-2$ - {paris, 'I', "12"}, //$NON-NLS-2$ - {china, 'I', "12"}, //$NON-NLS-2$ - {0L, 'L', "000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'L', "807"}, //$NON-NLS-2$ - {-1000L, 'L', "000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'L', "578"}, //$NON-NLS-2$ - {paris, 'L', "453"}, //$NON-NLS-2$ - {china, 'L', "609"}, //$NON-NLS-2$ - {0L, 'M', "00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'M', "18"}, //$NON-NLS-2$ - {-1000L, 'M', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'M', "59"}, //$NON-NLS-2$ - {paris, 'M', "00"}, //$NON-NLS-2$ - {china, 'M', "00"}, //$NON-NLS-2$ - {0L, 'N', "000000000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'N', "807000000"}, //$NON-NLS-2$ - {-1000L, 'N', "000000000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'N', "578000000"}, //$NON-NLS-2$ - {paris, 'N', "453000000"}, //$NON-NLS-2$ - {china, 'N', "468000000"}, //$NON-NLS-2$ - {0L, 'Q', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Q', "9223372036854775807"}, //$NON-NLS-2$ - {-1000L, 'Q', "-1000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Q', "1147327147578"}, //$NON-NLS-2$ - {paris, 'Q', "1147082400453"}, //$NON-NLS-2$ - {china, 'Q', "1147118400609"}, //$NON-NLS-2$ - {0L, 'R', "08:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'R', "15:18"}, //$NON-NLS-2$ - {-1000L, 'R', "07:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'R', "13:59"}, //$NON-NLS-2$ - {paris, 'R', "12:00"}, //$NON-NLS-2$ - {china, 'R', "12:00"}, //$NON-NLS-2$ - {0L, 'S', "00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'S', "47"}, //$NON-NLS-2$ - {-1000L, 'S', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'S', "07"}, //$NON-NLS-2$ - {paris, 'S', "00"}, //$NON-NLS-2$ - {china, 'S', "00"}, //$NON-NLS-2$ - {0L, 'T', "08:00:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'T', "15:18:47"}, //$NON-NLS-2$ - {-1000L, 'T', "07:59:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'T', "13:59:07"}, //$NON-NLS-2$ - {paris, 'T', "12:00:00"}, //$NON-NLS-2$ - {china, 'T', "12:00:00"}, //$NON-NLS-2$ - {0L, 'Y', "1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Y', "292278994"}, //$NON-NLS-2$ - {-1000L, 'Y', "1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Y', "2006"}, //$NON-NLS-2$ - {paris, 'Y', "2006"}, //$NON-NLS-2$ - {china, 'Y', "2006"}, //$NON-NLS-2$ - {0L, 'Z', "CST"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Z', "CST"}, //$NON-NLS-2$ - {-1000L, 'Z', "CST"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Z', "CST"}, //$NON-NLS-2$ - {paris, 'Z', "CEST"}, //$NON-NLS-2$ - {china, 'Z', "GMT-08:00"}, //$NON-NLS-2$ + {0L, 'A', "\u6728\u66dc\u65e5"}, + {Long.MAX_VALUE, 'A', "\u65e5\u66dc\u65e5"}, + {-1000L, 'A', "\u6728\u66dc\u65e5"}, + {new Date(1147327147578L), 'A', "\u6728\u66dc\u65e5"}, + {paris, 'A', "\u6708\u66dc\u65e5"}, + {china, 'A', "\u6708\u66dc\u65e5"}, + {0L, 'B', "1\u6708"}, + {Long.MAX_VALUE, 'B', "8\u6708"}, + {-1000L, 'B', "1\u6708"}, + {new Date(1147327147578L), 'B', "5\u6708"}, + {paris, 'B', "5\u6708"}, + {china, 'B', "5\u6708"}, + {0L, 'C', "19"}, + {Long.MAX_VALUE, 'C', "2922789"}, + {-1000L, 'C', "19"}, + {new Date(1147327147578L), 'C', "20"}, + {paris, 'C', "20"}, + {china, 'C', "20"}, + {0L, 'D', "01/01/70"}, + {Long.MAX_VALUE, 'D', "08/17/94"}, + {-1000L, 'D', "01/01/70"}, + {new Date(1147327147578L), 'D', "05/11/06"}, + {paris, 'D', "05/08/06"}, + {china, 'D', "05/08/06"}, + {0L, 'F', "1970-01-01"}, + {Long.MAX_VALUE, 'F', "292278994-08-17"}, + {-1000L, 'F', "1970-01-01"}, + {new Date(1147327147578L), 'F', "2006-05-11"}, + {paris, 'F', "2006-05-08"}, + {china, 'F', "2006-05-08"}, + {0L, 'H', "08"}, + {Long.MAX_VALUE, 'H', "15"}, + {-1000L, 'H', "07"}, + {new Date(1147327147578L), 'H', "13"}, + {paris, 'H', "12"}, + {china, 'H', "12"}, + {0L, 'I', "08"}, + {Long.MAX_VALUE, 'I', "03"}, + {-1000L, 'I', "07"}, + {new Date(1147327147578L), 'I', "01"}, + {paris, 'I', "12"}, + {china, 'I', "12"}, + {0L, 'L', "000"}, + {Long.MAX_VALUE, 'L', "807"}, + {-1000L, 'L', "000"}, + {new Date(1147327147578L), 'L', "578"}, + {paris, 'L', "453"}, + {china, 'L', "609"}, + {0L, 'M', "00"}, + {Long.MAX_VALUE, 'M', "18"}, + {-1000L, 'M', "59"}, + {new Date(1147327147578L), 'M', "59"}, + {paris, 'M', "00"}, + {china, 'M', "00"}, + {0L, 'N', "000000000"}, + {Long.MAX_VALUE, 'N', "807000000"}, + {-1000L, 'N', "000000000"}, + {new Date(1147327147578L), 'N', "578000000"}, + {paris, 'N', "453000000"}, + {china, 'N', "468000000"}, + {0L, 'Q', "0"}, + {Long.MAX_VALUE, 'Q', "9223372036854775807"}, + {-1000L, 'Q', "-1000"}, + {new Date(1147327147578L), 'Q', "1147327147578"}, + {paris, 'Q', "1147082400453"}, + {china, 'Q', "1147118400609"}, + {0L, 'R', "08:00"}, + {Long.MAX_VALUE, 'R', "15:18"}, + {-1000L, 'R', "07:59"}, + {new Date(1147327147578L), 'R', "13:59"}, + {paris, 'R', "12:00"}, + {china, 'R', "12:00"}, + {0L, 'S', "00"}, + {Long.MAX_VALUE, 'S', "47"}, + {-1000L, 'S', "59"}, + {new Date(1147327147578L), 'S', "07"}, + {paris, 'S', "00"}, + {china, 'S', "00"}, + {0L, 'T', "08:00:00"}, + {Long.MAX_VALUE, 'T', "15:18:47"}, + {-1000L, 'T', "07:59:59"}, + {new Date(1147327147578L), 'T', "13:59:07"}, + {paris, 'T', "12:00:00"}, + {china, 'T', "12:00:00"}, + {0L, 'Y', "1970"}, + {Long.MAX_VALUE, 'Y', "292278994"}, + {-1000L, 'Y', "1970"}, + {new Date(1147327147578L), 'Y', "2006"}, + {paris, 'Y', "2006"}, + {china, 'Y', "2006"}, + {0L, 'Z', "CST"}, + {Long.MAX_VALUE, 'Z', "CST"}, + {-1000L, 'Z', "CST"}, + {new Date(1147327147578L), 'Z', "CST"}, + {paris, 'Z', "CEST"}, + {china, 'Z', "GMT-08:00"}, }; for (int i = 0; i < 90; i++) { - String formatSpecifier = "%t" + upperCaseGermanTriple[i][pattern]; //$NON-NLS-2$ - String formatSpecifierUpper = "%T" + upperCaseGermanTriple[i][pattern]; //$NON-NLS-2$ + String formatSpecifier = "%t" + upperCaseGermanTriple[i][pattern]; + String formatSpecifierUpper = "%T" + upperCaseGermanTriple[i][pattern]; if ((Character)upperCaseGermanTriple[i][pattern] == 'N') { // result can't be predicted on RI, so skip this test continue; @@ -2446,52 +2446,52 @@ public class FormatterTest extends TestCase { // test '%t' f = new Formatter(Locale.JAPAN); f.format(formatSpecifier, upperCaseJapanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + upperCaseJapanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + upperCaseJapanTriple[i][input], upperCaseJapanTriple[i][output], f.toString()); f = new Formatter(Locale.JAPAN); f.format(Locale.GERMAN, formatSpecifier, upperCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + upperCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + upperCaseGermanTriple[i][input], upperCaseGermanTriple[i][output], f.toString()); f = new Formatter(Locale.JAPAN); f.format(Locale.FRANCE, formatSpecifier, upperCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + upperCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + upperCaseFranceTriple[i][input], upperCaseFranceTriple[i][output], f.toString()); // test '%T' f = new Formatter(Locale.GERMAN); f.format(formatSpecifierUpper, upperCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + upperCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + upperCaseGermanTriple[i][input], ((String)upperCaseGermanTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.JAPAN, formatSpecifierUpper, upperCaseJapanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + upperCaseJapanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + upperCaseJapanTriple[i][input], ((String)upperCaseJapanTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.FRANCE, formatSpecifierUpper, upperCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + upperCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + upperCaseFranceTriple[i][input], ((String)upperCaseFranceTriple[i][output]) .toUpperCase(Locale.US), f.toString()); } f = new Formatter(Locale.US); - f.format("%-10ta", now); //$NON-NLS-2$ - assertEquals("Thu ", f.toString()); //$NON-NLS-2$ + f.format("%-10ta", now); + assertEquals("Thu ", f.toString()); f = new Formatter(Locale.US); - f.format("%10000000000000000000000000000000001ta", now); //$NON-NLS-2$ - assertEquals("Thu", f.toString().trim()); //$NON-NLS-2$ + f.format("%10000000000000000000000000000000001ta", now); + assertEquals("Thu", f.toString().trim()); } /** @@ -2527,26 +2527,26 @@ public class FormatterTest extends TestCase { */ public void test_formatLjava_lang_String$LBigInteger() { final Object[][] tripleD = { - {new BigInteger("123456789012345678901234567890"), "%d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%10d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-1d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%+d", "+123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "% d", " 123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%,d", "123.456.789.012.345.678.901.234.567.890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%(d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%08d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-+,(11d", "+123.456.789.012.345.678.901.234.567.890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%0 ,(11d", " 123.456.789.012.345.678.901.234.567.890"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%10d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-1d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%+d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "% d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%,d", "-9.876.543.210.987.654.321.098.765.432.100.000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%(d", "(9876543210987654321098765432100000)"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%08d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-+,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%0 ,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, //$NON-NLS-2$ + {new BigInteger("123456789012345678901234567890"), "%d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%10d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%-1d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%+d", "+123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "% d", " 123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%,d", "123.456.789.012.345.678.901.234.567.890"}, + {new BigInteger("123456789012345678901234567890"), "%(d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%08d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%-+,(11d", "+123.456.789.012.345.678.901.234.567.890"}, + {new BigInteger("123456789012345678901234567890"), "%0 ,(11d", " 123.456.789.012.345.678.901.234.567.890"}, + {new BigInteger("-9876543210987654321098765432100000"), "%d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%10d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-1d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%+d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "% d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%,d", "-9.876.543.210.987.654.321.098.765.432.100.000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%(d", "(9876543210987654321098765432100000)"}, + {new BigInteger("-9876543210987654321098765432100000"), "%08d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-+,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, + {new BigInteger("-9876543210987654321098765432100000"), "%0 ,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, }; final int input = 0; @@ -2564,18 +2564,18 @@ public class FormatterTest extends TestCase { } final Object[][] tripleO = { - {new BigInteger("123456789012345678901234567890"), "%o", "143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-6o", "143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%08o", "143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%#o", "0143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%0#11o", "0143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-#9o", "0143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%o", "-36336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-6o", "-36336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%08o", "-36336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%#o", "-036336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%0#11o", "-036336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-#9o", "-036336340043453651353467270113157312240"}, //$NON-NLS-2$ + {new BigInteger("123456789012345678901234567890"), "%o", "143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%-6o", "143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%08o", "143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%#o", "0143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%0#11o", "0143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%-#9o", "0143564417755415637016711617605322"}, + {new BigInteger("-9876543210987654321098765432100000"), "%o", "-36336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-6o", "-36336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%08o", "-36336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%#o", "-036336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%0#11o", "-036336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-#9o", "-036336340043453651353467270113157312240"}, }; for (int i = 0; i < tripleO.length; i++) { f = new Formatter(Locale.ITALY); @@ -2588,18 +2588,18 @@ public class FormatterTest extends TestCase { } final Object[][] tripleX = { - {new BigInteger("123456789012345678901234567890"), "%x", "18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-8x", "18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%06x", "18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%#x", "0x18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%0#12x", "0x18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-#9x", "0x18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%x", "-1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-8x", "-1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%06x", "-1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%#x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%0#12x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-#9x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ + {new BigInteger("123456789012345678901234567890"), "%x", "18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%-8x", "18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%06x", "18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%#x", "0x18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%0#12x", "0x18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%-#9x", "0x18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("-9876543210987654321098765432100000"), "%x", "-1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-8x", "-1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%06x", "-1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%#x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%0#12x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-#9x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, }; for (int i = 0; i < tripleX.length; i++) { diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java index 60c5dc7..bbdea57 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java @@ -25,7 +25,7 @@ import org.apache.harmony.testframework.serialization.SerializationTest; public class InputMismatchExceptionTest extends TestCase { - private static final String ERROR_MESSAGE = "for serialization test"; //$NON-NLS-1$ + private static final String ERROR_MESSAGE = "for serialization test"; /** * @tests java.util.InputMismatchException#InputMismatchException() diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LocaleTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LocaleTest.java index 1abfc49..d2cb99c 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LocaleTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LocaleTest.java @@ -139,8 +139,8 @@ public class LocaleTest extends junit.framework.TestCase { // Regression for Harmony-1146 // Non-bug difference for HARMONY-5442 - Locale l_countryCD = new Locale("", "CD"); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("Congo - Kinshasa", //$NON-NLS-1$ + Locale l_countryCD = new Locale("", "CD"); + assertEquals("Congo - Kinshasa", l_countryCD.getDisplayCountry()); } @@ -165,15 +165,15 @@ public class LocaleTest extends junit.framework.TestCase { .getDisplayLanguage().equals("English")); // Regression for Harmony-1146 - Locale l_languageAE = new Locale("ae", ""); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("Avestan", l_languageAE.getDisplayLanguage()); //$NON-NLS-1$ + Locale l_languageAE = new Locale("ae", ""); + assertEquals("Avestan", l_languageAE.getDisplayLanguage()); // Regression for HARMONY-4402 Locale defaultLocale = Locale.getDefault(); try { Locale locale = new Locale("no", "NO"); Locale.setDefault(locale); - assertEquals("norsk", locale.getDisplayLanguage()); //$NON-NLS-1$ + assertEquals("norsk", locale.getDisplayLanguage()); } finally { Locale.setDefault(defaultLocale); } @@ -258,12 +258,12 @@ public class LocaleTest extends junit.framework.TestCase { // Regression for Harmony-1146 // Non-bug difference for HARMONY-5442 - Locale l_CountryCS = new Locale("", "CS"); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("SCG", l_CountryCS.getISO3Country()); //$NON-NLS-1$ + Locale l_CountryCS = new Locale("", "CS"); + assertEquals("SCG", l_CountryCS.getISO3Country()); // Regression for Harmony-1129 - l = new Locale("ak", ""); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("aka", l.getISO3Language()); //$NON-NLS-1$ + l = new Locale("ak", ""); + assertEquals("aka", l.getISO3Language()); } /** diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/AbstractBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/AbstractBufferTest.java index d0fc537..9152a9b 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/AbstractBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/AbstractBufferTest.java @@ -74,7 +74,7 @@ public abstract class AbstractBufferTest extends TestCase { assertEquals(baseBuf.limit(), baseBuf.capacity()); try { baseBuf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$S + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -103,7 +103,7 @@ public abstract class AbstractBufferTest extends TestCase { assertEquals(oldPosition, baseBuf.limit()); try { baseBuf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -191,20 +191,20 @@ public abstract class AbstractBufferTest extends TestCase { // mark should be invalid try { baseBuf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } try { baseBuf.limit(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { baseBuf.limit(baseBuf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } @@ -274,13 +274,13 @@ public abstract class AbstractBufferTest extends TestCase { try { baseBuf.position(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { baseBuf.position(baseBuf.limit() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } @@ -304,7 +304,7 @@ public abstract class AbstractBufferTest extends TestCase { // mark should be invalid try { baseBuf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -354,7 +354,7 @@ public abstract class AbstractBufferTest extends TestCase { baseBuf.clear(); try { baseBuf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -380,7 +380,7 @@ public abstract class AbstractBufferTest extends TestCase { assertSame(ret, baseBuf); try { baseBuf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ByteBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ByteBufferTest.java index fc026db..128f870 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ByteBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ByteBufferTest.java @@ -231,7 +231,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.compact(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -252,7 +252,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { // actually nothing to be done by compact(). So RI doesn't reset // mark position buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -268,7 +268,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, (byte) 0, buf.capacity()); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -285,7 +285,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, (byte) 1, 4); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -415,7 +415,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { } try { buf.get(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -445,14 +445,14 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.get(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } try { buf.get((byte[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -474,52 +474,52 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.get(new byte[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } assertEquals(0, buf.position()); try { buf.get(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } buf.get(array, array.length, 0); try { buf.get(array, array.length + 1, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(0, buf.position()); try { buf.get(array, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get((byte[])null, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.get(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -550,13 +550,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { } try { buf.get(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(buf.limit()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -694,7 +694,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.put((byte) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -710,7 +710,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { } try { buf.put((byte) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -737,7 +737,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -754,13 +754,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { } try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.put((byte[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -781,7 +781,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.put(array, 0, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -790,20 +790,20 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.put(new byte[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } assertEquals(0, buf.position()); try { buf.put(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, array.length + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -811,32 +811,32 @@ public abstract class ByteBufferTest extends AbstractBufferTest { assertEquals(0, buf.position()); try { buf.put(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 2, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((byte[])null, 2, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -865,14 +865,14 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.put(other); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.clear(); buf.put((ByteBuffer)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -881,20 +881,20 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.put(buf); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { buf.put(ByteBuffer.allocate(buf.capacity() + 1)); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.put((ByteBuffer)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -921,7 +921,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.put(0, (byte) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -937,13 +937,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { } try { buf.put(-1, (byte) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(buf.limit(), (byte) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -975,7 +975,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { assertEquals(buf.remaining(), slice.capacity()); try { slice.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -1424,7 +1424,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getChar(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -1457,13 +1457,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getChar(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.getChar(buf.limit() - nbytes + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -1482,7 +1482,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.putChar((char) 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -1508,7 +1508,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putChar(value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -1533,7 +1533,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.putChar(0, (char) 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -1558,13 +1558,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putChar(-1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.putChar(buf.limit() - nbytes + 1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -1612,7 +1612,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getDouble(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -1648,13 +1648,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getDouble(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.getDouble(buf.limit() - nbytes + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -1679,7 +1679,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.putDouble(1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -1705,7 +1705,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putDouble(value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -1739,7 +1739,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.putDouble(0, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -1764,13 +1764,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putDouble(-1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.putDouble(buf.limit() - nbytes + 1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -1818,7 +1818,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getFloat(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -1854,13 +1854,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getFloat(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.getFloat(buf.limit() - nbytes + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -1879,7 +1879,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.putFloat(1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -1905,7 +1905,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putFloat(value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -1939,7 +1939,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.putFloat(0, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -1964,13 +1964,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putFloat(-1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.putFloat(buf.limit() - nbytes + 1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -2015,7 +2015,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getInt(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -2048,13 +2048,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getInt(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.getInt(buf.limit() - nbytes + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -2078,7 +2078,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.putInt(1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -2104,7 +2104,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putInt(value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -2129,7 +2129,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.putInt(0, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -2154,13 +2154,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putInt(-1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.putInt(buf.limit() - nbytes + 1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -2199,7 +2199,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getLong(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -2232,13 +2232,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getLong(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.getLong(buf.limit() - nbytes + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -2257,7 +2257,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.putLong(1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -2283,7 +2283,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putLong(value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -2308,7 +2308,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.putLong(0, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -2333,13 +2333,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putLong(-1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.putLong(buf.limit() - nbytes + 1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -2378,7 +2378,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getShort(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -2411,13 +2411,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.getShort(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.getShort(buf.limit() - nbytes + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -2436,7 +2436,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.clear(); buf.putShort((short) 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -2462,7 +2462,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putShort(value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -2487,7 +2487,7 @@ public abstract class ByteBufferTest extends AbstractBufferTest { if (buf.isReadOnly()) { try { buf.putShort(0, (short) 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -2512,13 +2512,13 @@ public abstract class ByteBufferTest extends AbstractBufferTest { try { buf.putShort(-1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.putShort(buf.limit() - nbytes + 1, value); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -2545,12 +2545,12 @@ public abstract class ByteBufferTest extends AbstractBufferTest { byte array[] = null; try { ByteBuffer.wrap(array, -1, 0); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { } try { ByteBuffer.wrap(new byte[10], Integer.MAX_VALUE, 2); - fail("Should throw IndexOutOfBoundsException"); //$NON-NLS-1$ + fail("Should throw IndexOutOfBoundsException"); } catch (IndexOutOfBoundsException e) { } } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/CharBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/CharBufferTest.java index 576fec5..0e761fe 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/CharBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/CharBufferTest.java @@ -217,7 +217,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, (char) 0, buf.capacity()); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -235,7 +235,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { // failed on RI. Spec doesn't specify the behavior if // actually nothing to be done by compact() buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -252,7 +252,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, (char) 1, 4); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -403,7 +403,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { } try { buf.get(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -432,14 +432,14 @@ public abstract class CharBufferTest extends AbstractBufferTest { try { buf.get(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } try { buf.get((char[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -460,52 +460,52 @@ public abstract class CharBufferTest extends AbstractBufferTest { try { buf.get(new char[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } buf.get(array, array.length, 0); try { buf.get(array, array.length + 1, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get((char[])null, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.get(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -535,13 +535,13 @@ public abstract class CharBufferTest extends AbstractBufferTest { } try { buf.get(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(buf.limit()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -583,7 +583,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { } try { buf.put((char) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -611,13 +611,13 @@ public abstract class CharBufferTest extends AbstractBufferTest { } try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.put((char[]) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -637,26 +637,26 @@ public abstract class CharBufferTest extends AbstractBufferTest { char array[] = new char[buf.capacity()]; try { buf.put((char[]) null, 0, 1); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { buf.put(new char[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.put(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, array.length + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -664,31 +664,31 @@ public abstract class CharBufferTest extends AbstractBufferTest { assertEquals(buf.position(), 0); try { buf.put(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((char[])null, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -715,26 +715,26 @@ public abstract class CharBufferTest extends AbstractBufferTest { try { buf.put((CharBuffer) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(buf); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { buf.put(CharBuffer.allocate(buf.capacity() + 1)); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.flip(); buf.put((CharBuffer)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -768,13 +768,13 @@ public abstract class CharBufferTest extends AbstractBufferTest { } try { buf.put(-1, (char) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(buf.limit(), (char) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -800,7 +800,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { assertEquals(buf.remaining(), slice.capacity()); try { slice.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -841,13 +841,13 @@ public abstract class CharBufferTest extends AbstractBufferTest { } try { buf.charAt(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.charAt(buf.remaining()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -872,26 +872,26 @@ public abstract class CharBufferTest extends AbstractBufferTest { public void testSubSequence() { try { buf.subSequence(-1, buf.length()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.subSequence(buf.length() + 1, buf.length() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(buf.subSequence(buf.length(), buf.length()).length(), 0); try { buf.subSequence(1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.subSequence(1, buf.length() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -924,13 +924,13 @@ public abstract class CharBufferTest extends AbstractBufferTest { } try { buf.put(str); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.put((String) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -952,7 +952,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { try { buf.put(String.valueOf(new char[buf.capacity() + 1]), 0, buf .capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -963,7 +963,7 @@ public abstract class CharBufferTest extends AbstractBufferTest { try { buf.put((String) null, 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -972,19 +972,19 @@ public abstract class CharBufferTest extends AbstractBufferTest { buf.clear(); try { buf.put(str, -1, str.length()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(str, str.length() + 1, str.length() + 2); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((String) null, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -992,13 +992,13 @@ public abstract class CharBufferTest extends AbstractBufferTest { assertEquals(buf.position(), 0); try { buf.put(str, 2, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(str, 2, str.length() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectByteBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectByteBufferTest.java index e384a3d..3998ea8 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectByteBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectByteBufferTest.java @@ -49,7 +49,7 @@ public class DirectByteBufferTest extends ByteBufferTest { public void testAllocatedByteBuffer_IllegalArg() { try { ByteBuffer.allocateDirect(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } @@ -64,7 +64,7 @@ public class DirectByteBufferTest extends ByteBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // expected } @@ -79,7 +79,7 @@ public class DirectByteBufferTest extends ByteBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // expected } @@ -105,7 +105,7 @@ public class DirectByteBufferTest extends ByteBufferTest { assertFalse(buf.hasArray()); try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (UnsupportedOperationException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectCharBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectCharBufferTest.java index e910f92..ecef39f 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectCharBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectCharBufferTest.java @@ -56,7 +56,7 @@ public class DirectCharBufferTest extends CharBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } @@ -70,7 +70,7 @@ public class DirectCharBufferTest extends CharBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectDoubleBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectDoubleBufferTest.java index afc9b03..5cf051e 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectDoubleBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectDoubleBufferTest.java @@ -55,7 +55,7 @@ public class DirectDoubleBufferTest extends DoubleBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } @@ -69,7 +69,7 @@ public class DirectDoubleBufferTest extends DoubleBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectFloatBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectFloatBufferTest.java index 2c614c1..f0c336f 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectFloatBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectFloatBufferTest.java @@ -55,7 +55,7 @@ public class DirectFloatBufferTest extends FloatBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } @@ -69,7 +69,7 @@ public class DirectFloatBufferTest extends FloatBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { //expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectIntBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectIntBufferTest.java index 5227d47..8bba855 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectIntBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectIntBufferTest.java @@ -81,7 +81,7 @@ public class DirectIntBufferTest extends IntBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } @@ -95,7 +95,7 @@ public class DirectIntBufferTest extends IntBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { //expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectLongBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectLongBufferTest.java index 9653960..3e320ce 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectLongBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectLongBufferTest.java @@ -55,7 +55,7 @@ public class DirectLongBufferTest extends LongBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } @@ -69,7 +69,7 @@ public class DirectLongBufferTest extends LongBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { //expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectShortBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectShortBufferTest.java index 91762a7..114d44f 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectShortBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DirectShortBufferTest.java @@ -82,7 +82,7 @@ public class DirectShortBufferTest extends ShortBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } @@ -96,7 +96,7 @@ public class DirectShortBufferTest extends ShortBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { //expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DoubleBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DoubleBufferTest.java index cf2eb48..df7290b 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DoubleBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/DoubleBufferTest.java @@ -230,7 +230,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 0.0, buf.capacity()); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -249,7 +249,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { // actually nothing to be done by compact(). So RI doesn't reset // mark position buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -266,7 +266,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 1.0, 4); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -390,7 +390,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { } try { buf.get(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -419,14 +419,14 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { try { buf.get(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } try { buf.get((double[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -447,52 +447,52 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { try { buf.get(new double[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } buf.get(array, array.length, 0); try { buf.get(array, array.length + 1, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get((double[])null, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.get(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -522,13 +522,13 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { } try { buf.get(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(buf.limit()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -546,7 +546,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { } else { try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (UnsupportedOperationException e) { // expected // Note:can not tell when to catch @@ -623,7 +623,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { } try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -651,7 +651,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { } try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -672,20 +672,20 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { try { buf.put(new double[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.put(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, array.length + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -693,31 +693,31 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { assertEquals(buf.position(), 0); try { buf.put(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((double[])null, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -744,13 +744,13 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { try { buf.put(buf); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { buf.put(DoubleBuffer.allocate(buf.capacity() + 1)); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -784,13 +784,13 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { } try { buf.put(-1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(buf.limit(), 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -816,7 +816,7 @@ public abstract class DoubleBufferTest extends AbstractBufferTest { assertEquals(slice.capacity(), buf.remaining()); try { slice.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/FloatBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/FloatBufferTest.java index 8edd799..ec995b3 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/FloatBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/FloatBufferTest.java @@ -213,7 +213,7 @@ public abstract class FloatBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 0.0f, buf.capacity()); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -232,7 +232,7 @@ public abstract class FloatBufferTest extends AbstractBufferTest { // actually nothing to be done by compact(). So RI doesn't reset // mark position buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -249,7 +249,7 @@ public abstract class FloatBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 1.0f, 4); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -385,7 +385,7 @@ public abstract class FloatBufferTest extends AbstractBufferTest { } try { buf.get(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -414,14 +414,14 @@ public abstract class FloatBufferTest extends AbstractBufferTest { try { buf.get(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } try { buf.get((float[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -442,52 +442,52 @@ public abstract class FloatBufferTest extends AbstractBufferTest { try { buf.get(new float[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } buf.get(array, array.length, 0); try { buf.get(array, array.length + 1, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get((float[])null, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.get(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -517,13 +517,13 @@ public abstract class FloatBufferTest extends AbstractBufferTest { } try { buf.get(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(buf.limit()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -541,7 +541,7 @@ public abstract class FloatBufferTest extends AbstractBufferTest { } else { try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (UnsupportedOperationException e) { // expected // Note:can not tell when to catch @@ -620,7 +620,7 @@ public abstract class FloatBufferTest extends AbstractBufferTest { } try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -647,14 +647,14 @@ public abstract class FloatBufferTest extends AbstractBufferTest { } try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.position(buf.limit()); buf.put((float[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -674,20 +674,20 @@ public abstract class FloatBufferTest extends AbstractBufferTest { float array[] = new float[buf.capacity()]; try { buf.put(new float[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.put(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, array.length + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -695,31 +695,31 @@ public abstract class FloatBufferTest extends AbstractBufferTest { assertEquals(buf.position(), 0); try { buf.put(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((float[])null, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -745,20 +745,20 @@ public abstract class FloatBufferTest extends AbstractBufferTest { FloatBuffer other = FloatBuffer.allocate(buf.capacity()); try { buf.put(buf); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { buf.put(FloatBuffer.allocate(buf.capacity() + 1)); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.flip(); buf.put((FloatBuffer)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -792,13 +792,13 @@ public abstract class FloatBufferTest extends AbstractBufferTest { } try { buf.put(-1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(buf.limit(), 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -824,7 +824,7 @@ public abstract class FloatBufferTest extends AbstractBufferTest { assertEquals(slice.capacity(), buf.remaining()); try { slice.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapByteBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapByteBufferTest.java index e7235ca..99e3c6d 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapByteBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapByteBufferTest.java @@ -45,7 +45,7 @@ public class HeapByteBufferTest extends ByteBufferTest { public void testAllocatedByteBuffer_IllegalArg() { try { ByteBuffer.allocate(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapCharBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapCharBufferTest.java index 2ece6de..a739749 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapCharBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapCharBufferTest.java @@ -40,7 +40,7 @@ public class HeapCharBufferTest extends CharBufferTest { public void testAllocatedCharBuffer_IllegalArg() { try { CharBuffer.allocate(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapDoubleBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapDoubleBufferTest.java index c56f6a1..9e67c96 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapDoubleBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapDoubleBufferTest.java @@ -40,7 +40,7 @@ public class HeapDoubleBufferTest extends DoubleBufferTest { public void testAllocatedDoubleBuffer_IllegalArg() { try { DoubleBuffer.allocate(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapFloatBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapFloatBufferTest.java index 3a9fddc..3c880ad 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapFloatBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapFloatBufferTest.java @@ -40,7 +40,7 @@ public class HeapFloatBufferTest extends FloatBufferTest { public void testAllocatedFloatBuffer_IllegalArg() { try { FloatBuffer.allocate(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapIntBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapIntBufferTest.java index 203a743..1a039df 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapIntBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapIntBufferTest.java @@ -40,7 +40,7 @@ public class HeapIntBufferTest extends IntBufferTest { public void testAllocatedIntBuffer_IllegalArg() { try { IntBuffer.allocate(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapLongBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapLongBufferTest.java index 667c7ed..0acd8f0 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapLongBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapLongBufferTest.java @@ -40,7 +40,7 @@ public class HeapLongBufferTest extends LongBufferTest { public void testAllocatedLongBuffer_IllegalArg() { try { LongBuffer.allocate(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapShortBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapShortBufferTest.java index 679b0bd..55d47b1 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapShortBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/HeapShortBufferTest.java @@ -40,7 +40,7 @@ public class HeapShortBufferTest extends ShortBufferTest { public void testAllocatedShortBuffer_IllegalArg() { try { ShortBuffer.allocate(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/IntBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/IntBufferTest.java index a0153a8..5db587c 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/IntBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/IntBufferTest.java @@ -187,7 +187,7 @@ public abstract class IntBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 0, buf.capacity()); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -206,7 +206,7 @@ public abstract class IntBufferTest extends AbstractBufferTest { // actually nothing to be done by compact(). So RI doesn't reset // mark position buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -223,7 +223,7 @@ public abstract class IntBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 1, 4); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -341,7 +341,7 @@ public abstract class IntBufferTest extends AbstractBufferTest { } try { buf.get(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -370,14 +370,14 @@ public abstract class IntBufferTest extends AbstractBufferTest { try { buf.get(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } try { buf.get((int[])null); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { // expected } @@ -398,52 +398,52 @@ public abstract class IntBufferTest extends AbstractBufferTest { try { buf.get(new int[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } buf.get(array, array.length, 0); try { buf.get(array, array.length + 1, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get((int[])null, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.get(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -473,13 +473,13 @@ public abstract class IntBufferTest extends AbstractBufferTest { } try { buf.get(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(buf.limit()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -497,7 +497,7 @@ public abstract class IntBufferTest extends AbstractBufferTest { } else { try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (UnsupportedOperationException e) { // expected // Note:can not tell when to catch @@ -573,7 +573,7 @@ public abstract class IntBufferTest extends AbstractBufferTest { } try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -600,14 +600,14 @@ public abstract class IntBufferTest extends AbstractBufferTest { } try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.position(buf.limit()); buf.put((int[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -627,20 +627,20 @@ public abstract class IntBufferTest extends AbstractBufferTest { int array[] = new int[buf.capacity()]; try { buf.put(new int[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.put(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, array.length + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -648,31 +648,31 @@ public abstract class IntBufferTest extends AbstractBufferTest { assertEquals(buf.position(), 0); try { buf.put(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((int[])null, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -721,20 +721,20 @@ public abstract class IntBufferTest extends AbstractBufferTest { IntBuffer other = IntBuffer.allocate(buf.capacity()); try { buf.put(buf); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { buf.put(IntBuffer.allocate(buf.capacity() + 1)); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.flip(); buf.put((IntBuffer)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -768,13 +768,13 @@ public abstract class IntBufferTest extends AbstractBufferTest { } try { buf.put(-1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(buf.limit(), 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -800,7 +800,7 @@ public abstract class IntBufferTest extends AbstractBufferTest { assertEquals(slice.capacity(), buf.remaining()); try { slice.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/LongBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/LongBufferTest.java index cf40cb5..5011f80 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/LongBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/LongBufferTest.java @@ -186,7 +186,7 @@ public abstract class LongBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 0, buf.capacity()); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -205,7 +205,7 @@ public abstract class LongBufferTest extends AbstractBufferTest { // actually nothing to be done by compact(). So RI doesn't reset // mark position buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -222,7 +222,7 @@ public abstract class LongBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, 1, 4); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -340,7 +340,7 @@ public abstract class LongBufferTest extends AbstractBufferTest { } try { buf.get(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -369,14 +369,14 @@ public abstract class LongBufferTest extends AbstractBufferTest { try { buf.get(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } try { buf.get((long[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -397,52 +397,52 @@ public abstract class LongBufferTest extends AbstractBufferTest { try { buf.get(new long[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } buf.get(array, array.length, 0); try { buf.get(array, array.length + 1, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get((long[])null, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.get(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -472,13 +472,13 @@ public abstract class LongBufferTest extends AbstractBufferTest { } try { buf.get(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(buf.limit()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -496,7 +496,7 @@ public abstract class LongBufferTest extends AbstractBufferTest { } else { try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (UnsupportedOperationException e) { // expected // Note:can not tell when to catch @@ -572,7 +572,7 @@ public abstract class LongBufferTest extends AbstractBufferTest { } try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -599,14 +599,14 @@ public abstract class LongBufferTest extends AbstractBufferTest { } try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.position(buf.limit()); buf.put((long[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -626,20 +626,20 @@ public abstract class LongBufferTest extends AbstractBufferTest { long array[] = new long[buf.capacity()]; try { buf.put(new long[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.put(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, array.length + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -647,37 +647,37 @@ public abstract class LongBufferTest extends AbstractBufferTest { assertEquals(buf.position(), 0); try { buf.put(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((long[])null, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -703,20 +703,20 @@ public abstract class LongBufferTest extends AbstractBufferTest { LongBuffer other = LongBuffer.allocate(buf.capacity()); try { buf.put(buf); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { buf.put(LongBuffer.allocate(buf.capacity() + 1)); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.flip(); buf.put((LongBuffer)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -750,13 +750,13 @@ public abstract class LongBufferTest extends AbstractBufferTest { } try { buf.put(-1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(buf.limit(), 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -782,7 +782,7 @@ public abstract class LongBufferTest extends AbstractBufferTest { assertEquals(slice.capacity(), buf.remaining()); try { slice.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/MappedByteBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/MappedByteBufferTest.java index 3161fe1..26b3169 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/MappedByteBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/MappedByteBufferTest.java @@ -63,12 +63,12 @@ public class MappedByteBufferTest extends DirectByteBufferTest { ) public void test_asIntBuffer() { int len = buf.capacity(); - assertEquals("Got wrong number of bytes", BUFFER_LENGTH, len); //$NON-NLS-1$ + assertEquals("Got wrong number of bytes", BUFFER_LENGTH, len); // Read in our 26 bytes for (int i = 0; i < BUFFER_LENGTH - 20; i++) { byte b = buf.get(); - assertEquals("Got wrong byte value", (byte) i, b); //$NON-NLS-1$ + assertEquals("Got wrong byte value", (byte) i, b); } // Now convert to an IntBuffer to read our ints @@ -76,7 +76,7 @@ public class MappedByteBufferTest extends DirectByteBufferTest { for (int i = BUFFER_LENGTH - 20; i < BUFFER_LENGTH; i+=4) { int val = ibuffer.get(); int res = i * 16777216 + (i + 1) * 65536 + (i + 2) * 256 + (i + 3); - assertEquals("Got wrong int value", res, val); //$NON-NLS-1$ + assertEquals("Got wrong int value", res, val); } } @@ -161,7 +161,7 @@ public class MappedByteBufferTest extends DirectByteBufferTest { protected void setUp() throws IOException { // Create temp file with 26 bytes and 5 ints - tmpFile = File.createTempFile("MappedByteBufferTest", ".tmp"); //$NON-NLS-1$//$NON-NLS-2$ + tmpFile = File.createTempFile("MappedByteBufferTest", ".tmp"); tmpFile.createNewFile(); tmpFile.deleteOnExit(); diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyCharBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyCharBufferTest.java index 97fd2c6..7a7363c 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyCharBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyCharBufferTest.java @@ -64,7 +64,7 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { } } @@ -89,7 +89,7 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { } } @@ -103,7 +103,7 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { public void testCompact() { try { buf.compact(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -118,7 +118,7 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { public void testPutchar() { try { buf.put((char) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -134,13 +134,13 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { char array[] = new char[1]; try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((char[]) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -156,25 +156,25 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { char array[] = new char[1]; try { buf.put(array, 0, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((char[]) null, 0, 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(new char[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(array, -1, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -190,19 +190,19 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { CharBuffer other = CharBuffer.allocate(1); try { buf.put(other); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((CharBuffer) null); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(buf); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -217,13 +217,13 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { public void testPutintchar() { try { buf.put(0, (char) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(-1, (char) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -240,26 +240,26 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { String str = String.valueOf(new char[buf.capacity()]); try { buf.put(str, 0, str.length()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((String) null, 0, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(str, -1, str.length()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } String longStr = String.valueOf(new char[buf.capacity()+1]); try { buf.put(longStr, 0, longStr.length()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -275,13 +275,13 @@ public class ReadOnlyCharBufferTest extends CharBufferTest { String str = " "; try { buf.put(str); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((String)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyDoubleBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyDoubleBufferTest.java index 056c2e2..84a2a51 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyDoubleBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyDoubleBufferTest.java @@ -64,7 +64,7 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { } } @@ -89,7 +89,7 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { } } @@ -103,7 +103,7 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { public void testCompact() { try { buf.compact(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -118,7 +118,7 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { public void testPutdouble() { try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -134,13 +134,13 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { double array[] = new double[1]; try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((double[]) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -156,25 +156,25 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { double array[] = new double[1]; try { buf.put(array, 0, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((double[]) null, 0, 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(new double[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(array, -1, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -190,19 +190,19 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { DoubleBuffer other = DoubleBuffer.allocate(1); try { buf.put(other); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((DoubleBuffer) null); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(buf); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -217,13 +217,13 @@ public class ReadOnlyDoubleBufferTest extends DoubleBufferTest { public void testPutintdouble() { try { buf.put(0, (double) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(-1, (double) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyFloatBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyFloatBufferTest.java index 6bb572d..72a31b3 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyFloatBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyFloatBufferTest.java @@ -63,7 +63,7 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -89,7 +89,7 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -104,7 +104,7 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { public void testCompact() { try { buf.compact(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -119,7 +119,7 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { public void testPutfloat() { try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -135,13 +135,13 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { float array[] = new float[1]; try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((float[]) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -157,25 +157,25 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { float array[] = new float[1]; try { buf.put(array, 0, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((float[]) null, 0, 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(new float[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(array, -1, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -191,19 +191,19 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { FloatBuffer other = FloatBuffer.allocate(1); try { buf.put(other); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((FloatBuffer) null); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(buf); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -218,13 +218,13 @@ public class ReadOnlyFloatBufferTest extends FloatBufferTest { public void testPutintfloat() { try { buf.put(0, (float) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(-1, (float) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyHeapByteBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyHeapByteBufferTest.java index a0a04ff..1733f8a 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyHeapByteBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyHeapByteBufferTest.java @@ -44,7 +44,7 @@ public class ReadOnlyHeapByteBufferTest extends HeapByteBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -59,7 +59,7 @@ public class ReadOnlyHeapByteBufferTest extends HeapByteBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -85,7 +85,7 @@ public class ReadOnlyHeapByteBufferTest extends HeapByteBufferTest { assertFalse(buf.hasArray()); try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyIntBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyIntBufferTest.java index 3da8d2f..288e6b0 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyIntBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyIntBufferTest.java @@ -63,7 +63,7 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -89,7 +89,7 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -104,7 +104,7 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { public void testCompact() { try { buf.compact(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -119,7 +119,7 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { public void testPutint() { try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -135,13 +135,13 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { int array[] = new int[1]; try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((int[]) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -157,25 +157,25 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { int array[] = new int[1]; try { buf.put(array, 0, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((int[]) null, -1, 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(new int[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(array, -1, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -191,19 +191,19 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { IntBuffer other = IntBuffer.allocate(1); try { buf.put(other); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((IntBuffer) null); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(buf); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -218,13 +218,13 @@ public class ReadOnlyIntBufferTest extends IntBufferTest { public void testPutintint() { try { buf.put(0, (int) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(-1, (int) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyLongBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyLongBufferTest.java index 5337b3c..01d2783 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyLongBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyLongBufferTest.java @@ -63,7 +63,7 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -89,7 +89,7 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -104,7 +104,7 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { public void testCompact() { try { buf.compact(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -119,7 +119,7 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { public void testPutlong() { try { buf.put(0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -135,13 +135,13 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { long array[] = new long[1]; try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((long[]) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -157,25 +157,25 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { long array[] = new long[1]; try { buf.put(array, 0, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((long[]) null, 0, 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(new long[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(array, -1, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -191,19 +191,19 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { LongBuffer other = LongBuffer.allocate(1); try { buf.put(other); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((LongBuffer) null); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(buf); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -218,13 +218,13 @@ public class ReadOnlyLongBufferTest extends LongBufferTest { public void testPutintlong() { try { buf.put(0, (long) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(-1, (long) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyShortBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyShortBufferTest.java index a5aaa90..168920b 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyShortBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyShortBufferTest.java @@ -63,7 +63,7 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -89,7 +89,7 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { //expected } @@ -104,7 +104,7 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { public void testCompact() { try { buf.compact(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -119,7 +119,7 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { public void testPutshort() { try { buf.put((short)0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } @@ -135,13 +135,13 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { short array[] = new short[1]; try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((short[]) null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -157,25 +157,25 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { short array[] = new short[1]; try { buf.put(array, 0, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((short[]) null, 0, 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(new short[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(array, -1, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -191,19 +191,19 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { ShortBuffer other = ShortBuffer.allocate(1); try { buf.put(other); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((ShortBuffer) null); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(buf); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -218,13 +218,13 @@ public class ReadOnlyShortBufferTest extends ShortBufferTest { public void testPutintshort() { try { buf.put(0, (short) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put(-1, (short) 0); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyWrappedByteBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyWrappedByteBufferTest.java index 5986d96..5709035 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyWrappedByteBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ReadOnlyWrappedByteBufferTest.java @@ -44,7 +44,7 @@ public class ReadOnlyWrappedByteBufferTest extends WrappedByteBufferTest { public void testArray() { try { buf.array(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -59,7 +59,7 @@ public class ReadOnlyWrappedByteBufferTest extends WrappedByteBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } @@ -85,7 +85,7 @@ public class ReadOnlyWrappedByteBufferTest extends WrappedByteBufferTest { assertFalse(buf.hasArray()); try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (ReadOnlyBufferException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ShortBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ShortBufferTest.java index 2143d0b..f263ab0 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ShortBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/ShortBufferTest.java @@ -186,7 +186,7 @@ public abstract class ShortBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, (short) 0, buf.capacity()); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -205,7 +205,7 @@ public abstract class ShortBufferTest extends AbstractBufferTest { // actually nothing to be done by compact(). So RI doesn't reset // mark position buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -222,7 +222,7 @@ public abstract class ShortBufferTest extends AbstractBufferTest { assertContentLikeTestData1(buf, 0, (short) 1, 4); try { buf.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } @@ -340,7 +340,7 @@ public abstract class ShortBufferTest extends AbstractBufferTest { } try { buf.get(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } @@ -369,14 +369,14 @@ public abstract class ShortBufferTest extends AbstractBufferTest { try { buf.get(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } try { buf.get((short[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -397,46 +397,46 @@ public abstract class ShortBufferTest extends AbstractBufferTest { try { buf.get(new short[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferUnderflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.get(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } buf.get(array, array.length, 0); try { buf.get(array, array.length + 1, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } assertEquals(buf.position(), 0); try { buf.get((short[])null, 2, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.get(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -466,13 +466,13 @@ public abstract class ShortBufferTest extends AbstractBufferTest { } try { buf.get(-1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.get(buf.limit()); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -490,7 +490,7 @@ public abstract class ShortBufferTest extends AbstractBufferTest { } else { try { buf.array(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (UnsupportedOperationException e) { // expected // Note:can not tell when to catch @@ -566,7 +566,7 @@ public abstract class ShortBufferTest extends AbstractBufferTest { } try { buf.put((short) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } @@ -593,14 +593,14 @@ public abstract class ShortBufferTest extends AbstractBufferTest { } try { buf.put(array); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.position(buf.limit()); buf.put((short[])null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -620,20 +620,20 @@ public abstract class ShortBufferTest extends AbstractBufferTest { short array[] = new short[buf.capacity()]; try { buf.put(new short[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } assertEquals(buf.position(), 0); try { buf.put(array, -1, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, array.length + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -641,31 +641,31 @@ public abstract class ShortBufferTest extends AbstractBufferTest { assertEquals(buf.position(), 0); try { buf.put(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put((short[])null, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } try { buf.put(array, 2, array.length); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -714,20 +714,20 @@ public abstract class ShortBufferTest extends AbstractBufferTest { ShortBuffer other = ShortBuffer.allocate(buf.capacity()); try { buf.put(buf); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IllegalArgumentException e) { // expected } try { buf.put(ShortBuffer.allocate(buf.capacity() + 1)); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (BufferOverflowException e) { // expected } try { buf.flip(); buf.put((ShortBuffer)null); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -761,13 +761,13 @@ public abstract class ShortBufferTest extends AbstractBufferTest { } try { buf.put(-1, (short) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { buf.put(buf.limit(), (short) 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } @@ -793,7 +793,7 @@ public abstract class ShortBufferTest extends AbstractBufferTest { assertEquals(slice.capacity(), buf.remaining()); try { slice.reset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (InvalidMarkException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedByteBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedByteBufferTest.java index ec01f03..61aa6db 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedByteBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedByteBufferTest.java @@ -51,43 +51,43 @@ public class WrappedByteBufferTest extends ByteBufferTest { byte array[] = new byte[BUFFER_LENGTH]; try { ByteBuffer.wrap(array, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ByteBuffer.wrap(array, BUFFER_LENGTH + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ByteBuffer.wrap(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ByteBuffer.wrap(array, 0, BUFFER_LENGTH + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ByteBuffer.wrap(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ByteBuffer.wrap(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ByteBuffer.wrap((byte[])null, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest1.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest1.java index 2398cdb..c9a6b07 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest1.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest1.java @@ -51,43 +51,43 @@ public class WrappedCharBufferTest1 extends CharBufferTest { char array[] = new char[BUFFER_LENGTH]; try { CharBuffer.wrap(array, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(array, BUFFER_LENGTH + 1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(array, 0, BUFFER_LENGTH + 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap((char[])null, -1, 0); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { } } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest2.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest2.java index 8365c1c..9f62845 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest2.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedCharBufferTest2.java @@ -52,31 +52,31 @@ public class WrappedCharBufferTest2 extends ReadOnlyCharBufferTest { String str = TEST_STRING; try { CharBuffer.wrap(str, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(str, 21, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(str, 2, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap(str, 0, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { CharBuffer.wrap((String)null, -1, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (NullPointerException e) { // expected } @@ -91,7 +91,7 @@ public class WrappedCharBufferTest2 extends ReadOnlyCharBufferTest { public void testArray() { try { buf.array(); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } } @@ -105,7 +105,7 @@ public class WrappedCharBufferTest2 extends ReadOnlyCharBufferTest { public void testArrayOffset() { try { buf.arrayOffset(); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (UnsupportedOperationException e) { } } @@ -120,25 +120,25 @@ public class WrappedCharBufferTest2 extends ReadOnlyCharBufferTest { char array[] = new char[1]; try { buf.put(array, 0, array.length); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((char[]) null, 0, 1); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { buf.put(new char[buf.capacity() + 1], 0, buf.capacity() + 1); - fail("Should throw BufferOverflowException"); //$NON-NLS-1$ + fail("Should throw BufferOverflowException"); } catch (BufferOverflowException e) { // expected } try { buf.put(array, -1, array.length); - fail("Should throw IndexOutOfBoundsException"); //$NON-NLS-1$ + fail("Should throw IndexOutOfBoundsException"); } catch (IndexOutOfBoundsException e) { // expected } @@ -154,19 +154,19 @@ public class WrappedCharBufferTest2 extends ReadOnlyCharBufferTest { CharBuffer other = CharBuffer.allocate(1); try { buf.put(other); - fail("Should throw ReadOnlyBufferException"); //$NON-NLS-1$ + fail("Should throw ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { // expected } try { buf.put((CharBuffer) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { buf.put(buf); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedDoubleBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedDoubleBufferTest.java index d47ed75..5cc9399 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedDoubleBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedDoubleBufferTest.java @@ -49,43 +49,43 @@ public class WrappedDoubleBufferTest extends DoubleBufferTest { double array[] = new double[20]; try { DoubleBuffer.wrap(array, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { DoubleBuffer.wrap(array, 21, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { DoubleBuffer.wrap(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { DoubleBuffer.wrap(array, 0, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { DoubleBuffer.wrap(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { DoubleBuffer.wrap(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { DoubleBuffer.wrap((double[])null, -1, 0); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedFloatBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedFloatBufferTest.java index ee5095d..0f15323 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedFloatBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedFloatBufferTest.java @@ -49,43 +49,43 @@ public class WrappedFloatBufferTest extends FloatBufferTest { float array[] = new float[20]; try { FloatBuffer.wrap(array, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { FloatBuffer.wrap(array, 21, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { FloatBuffer.wrap(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { FloatBuffer.wrap(array, 0, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { FloatBuffer.wrap(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { FloatBuffer.wrap(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { FloatBuffer.wrap((float[])null, -1, 0); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedIntBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedIntBufferTest.java index b22258b..667e407 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedIntBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedIntBufferTest.java @@ -49,43 +49,43 @@ public class WrappedIntBufferTest extends IntBufferTest { int array[] = new int[20]; try { IntBuffer.wrap(array, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { IntBuffer.wrap(array, 21, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { IntBuffer.wrap(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { IntBuffer.wrap(array, 0, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { IntBuffer.wrap(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { IntBuffer.wrap(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { IntBuffer.wrap((int[])null, -1, 0); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedLongBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedLongBufferTest.java index 3faec21..2a5c7be 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedLongBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedLongBufferTest.java @@ -49,43 +49,43 @@ public class WrappedLongBufferTest extends LongBufferTest { long array[] = new long[20]; try { LongBuffer.wrap(array, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { LongBuffer.wrap(array, 21, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { LongBuffer.wrap(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { LongBuffer.wrap(array, 0, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { LongBuffer.wrap(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { LongBuffer.wrap(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { LongBuffer.wrap((long[])null, -1, 0); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedShortBufferTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedShortBufferTest.java index aa3c76e..b7df5ee 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedShortBufferTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/WrappedShortBufferTest.java @@ -49,43 +49,43 @@ public class WrappedShortBufferTest extends ShortBufferTest { short array[] = new short[20]; try { ShortBuffer.wrap(array, -1, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ShortBuffer.wrap(array, 21, 0); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ShortBuffer.wrap(array, 0, -1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ShortBuffer.wrap(array, 0, 21); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ShortBuffer.wrap(array, Integer.MAX_VALUE, 1); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ShortBuffer.wrap(array, 1, Integer.MAX_VALUE); - fail("Should throw Exception"); //$NON-NLS-1$ + fail("Should throw Exception"); } catch (IndexOutOfBoundsException e) { // expected } try { ShortBuffer.wrap((short[])null, -1, 0); - fail("Should throw NPE"); //$NON-NLS-1$ + fail("Should throw NPE"); } catch (NullPointerException e) { } diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/ChannelsTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/ChannelsTest.java index 46e9f4c..a5daa58 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/ChannelsTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/ChannelsTest.java @@ -53,9 +53,9 @@ import junit.framework.TestCase; */ @TestTargetClass(Channels.class) public class ChannelsTest extends TestCase { - private static final String CODE_SET = "GB2312"; //$NON-NLS-1$ + private static final String CODE_SET = "GB2312"; - private static final String BAD_CODE_SET = "GB2313"; //$NON-NLS-1$ + private static final String BAD_CODE_SET = "GB2313"; private FileInputStream fins; @@ -98,7 +98,7 @@ public class ChannelsTest extends TestCase { bit[0] = 80; this.fouts.write(bit); this.fouts.flush(); - String writebuf = ""; //$NON-NLS-1$ + String writebuf = ""; for (int val = 0; val < this.writebufSize / 2; val++) { writebuf = writebuf + ((char) (val + 64)); } @@ -510,7 +510,7 @@ public class ChannelsTest extends TestCase { ReadableByteChannel rbChannel = Channels.newChannel(this.fins); try { Channels.newReader(rbChannel, Charset.forName(BAD_CODE_SET) - .newDecoder(), //$NON-NLS-1$ + .newDecoder(), -1); fail(); } catch (UnsupportedCharsetException e) { @@ -610,7 +610,7 @@ public class ChannelsTest extends TestCase { ReadableByteChannel rbChannel = Channels.newChannel(this.fins); // channel with null inputs testReader = Channels.newReader(rbChannel, Charset.forName(CODE_SET) - .newDecoder(), //$NON-NLS-1$ + .newDecoder(), -1); assertNotNull(testReader); assertFalse(testReader.ready()); @@ -688,7 +688,7 @@ public class ChannelsTest extends TestCase { this.fins = new FileInputStream(tmpFile); // channel null Reader testReader = Channels.newReader(null, Charset.forName(CODE_SET) - .newDecoder(), //$NON-NLS-1$ + .newDecoder(), 0); assertNotNull(testReader); assertFalse(testReader.ready()); @@ -709,7 +709,7 @@ public class ChannelsTest extends TestCase { ReadableByteChannel rbChannel = Channels.newChannel(this.fins); // channel with null inputs testReader = Channels.newReader(rbChannel, Charset.forName(CODE_SET) - .newDecoder(), //$NON-NLS-1$ + .newDecoder(), -1); assertNotNull(testReader); assertFalse(testReader.ready()); @@ -793,9 +793,9 @@ public class ChannelsTest extends TestCase { this.fins = new FileInputStream(tmpFile); ReadableByteChannel rbChannel = Channels.newChannel(this.fins); Reader testReader = Channels.newReader(rbChannel, Charset.forName( - CODE_SET).newDecoder(), //$NON-NLS-1$ + CODE_SET).newDecoder(), -1); - Reader testReader_s = Channels.newReader(rbChannel, CODE_SET); //$NON-NLS-1$ + Reader testReader_s = Channels.newReader(rbChannel, CODE_SET); assertEquals(this.fileSize, this.fins.available()); // not ready... @@ -831,13 +831,13 @@ public class ChannelsTest extends TestCase { public void testNewWriterWritableByteChannelCharsetEncoderI_internalBufZero() throws IOException { - String writebuf = ""; //$NON-NLS-1$ + String writebuf = ""; for (int val = 0; val < this.writebufSize / 2; val++) { writebuf = writebuf + ((char) (val + 64)); } // null channel Writer testWriter = Channels.newWriter(null, Charset.forName(CODE_SET) - .newEncoder(), //$NON-NLS-1$ + .newEncoder(), -1); // can write to buffer testWriter.write(writebuf); @@ -858,7 +858,7 @@ public class ChannelsTest extends TestCase { this.fouts = null; WritableByteChannel wbChannel = Channels.newChannel(this.fouts); testWriter = Channels.newWriter(wbChannel, Charset.forName(CODE_SET) - .newEncoder(), //$NON-NLS-1$ + .newEncoder(), -1); // can write to buffer testWriter.write(writebuf); @@ -888,7 +888,7 @@ public class ChannelsTest extends TestCase { public void testNewWriterWritableByteChannelString_internalBufZero() throws IOException { - String writebuf = ""; //$NON-NLS-1$ + String writebuf = ""; for (int val = 0; val < this.writebufSize / 2; val++) { writebuf = writebuf + ((char) (val + 64)); } @@ -943,10 +943,10 @@ public class ChannelsTest extends TestCase { this.fouts = new FileOutputStream(tmpFile); WritableByteChannel wbChannel = Channels.newChannel(this.fouts); Writer testWriter = Channels.newWriter(wbChannel, Charset.forName( - CODE_SET).newEncoder(), //$NON-NLS-1$ + CODE_SET).newEncoder(), 1); - String writebuf = ""; //$NON-NLS-1$ + String writebuf = ""; for (int val = 0; val < this.writebufSize / 2; val++) { writebuf = writebuf + ((char) (val + 64)); } @@ -972,7 +972,7 @@ public class ChannelsTest extends TestCase { WritableByteChannel wbChannel = Channels.newChannel(this.fouts); Writer testWriter = Channels.newWriter(wbChannel, CODE_SET); - String writebuf = ""; //$NON-NLS-1$ + String writebuf = ""; for (int val = 0; val < this.writebufSize / 2; val++) { writebuf = writebuf + ((char) (val + 64)); } @@ -1004,12 +1004,12 @@ public class ChannelsTest extends TestCase { public void testNewWriterWritableByteChannelString() throws IOException { this.fouts = new FileOutputStream(tmpFile); WritableByteChannel wbChannel = Channels.newChannel(this.fouts); - Writer testWriter = Channels.newWriter(wbChannel, CODE_SET); //$NON-NLS-1$ + Writer testWriter = Channels.newWriter(wbChannel, CODE_SET); Writer testWriter_s = Channels.newWriter(wbChannel, Charset.forName( - CODE_SET).newEncoder(), //$NON-NLS-1$ + CODE_SET).newEncoder(), -1); - String writebuf = ""; //$NON-NLS-1$ + String writebuf = ""; for (int val = 0; val < this.writebufSize / 2; val++) { writebuf = writebuf + ((char) (val + 64)); } @@ -1070,7 +1070,7 @@ public class ChannelsTest extends TestCase { } writer = Channels.newWriter(chan, Charset.forName( - CODE_SET).newEncoder(), //$NON-NLS-1$ + CODE_SET).newEncoder(), -1); try { writer.write(10); diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java index 49c5faa..c4e0e84 100644 --- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java +++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/DatagramChannelTest.java @@ -955,7 +955,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isConnected()); try { this.channel1.connect(null); - fail("Should throw an IllegalArgumentException here."); //$NON-NLS-1$ + fail("Should throw an IllegalArgumentException here."); } catch (IllegalArgumentException e) { // OK. } @@ -1055,7 +1055,7 @@ public class DatagramChannelTest extends TestCase { "unresolved address", 1080); try { this.channel1.connect(unresolved); - fail("Should throw an UnresolvedAddressException here."); //$NON-NLS-1$ + fail("Should throw an UnresolvedAddressException here."); } catch (UnresolvedAddressException e) { // OK. } @@ -1071,7 +1071,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isConnected()); assertEquals(this.channel1, this.channel1 - .connect(new InetSocketAddress("", 1081))); //$NON-NLS-1$ + .connect(new InetSocketAddress("", 1081))); } @@ -1093,7 +1093,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isOpen()); try { this.channel1.connect(localAddr1); - fail("Should throw ClosedChannelException."); //$NON-NLS-1$ + fail("Should throw ClosedChannelException."); } catch (ClosedChannelException e) { // OK. } @@ -1118,7 +1118,7 @@ public class DatagramChannelTest extends TestCase { // connect after connected. try { this.channel1.connect(localAddr1); - fail("Should throw IllegalStateException."); //$NON-NLS-1$ + fail("Should throw IllegalStateException."); } catch (IllegalStateException e) { // OK. } @@ -1146,7 +1146,7 @@ public class DatagramChannelTest extends TestCase { // checking open is before checking status. try { this.channel1.connect(localAddr1); - fail("Should throw ClosedChannelException."); //$NON-NLS-1$ + fail("Should throw ClosedChannelException."); } catch (ClosedChannelException e) { // OK. } @@ -1324,7 +1324,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isConnected()); try { this.channel1.receive(null); - fail("Should throw a NPE here."); //$NON-NLS-1$ + fail("Should throw a NPE here."); } catch (NullPointerException e) { // OK. } @@ -1348,7 +1348,7 @@ public class DatagramChannelTest extends TestCase { assertTrue(dst.isReadOnly()); try { this.channel1.receive(dst); - fail("Should throw an IllegalArgumentException here."); //$NON-NLS-1$ + fail("Should throw an IllegalArgumentException here."); } catch (IllegalArgumentException e) { // OK. } @@ -1447,7 +1447,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isOpen()); try { assertNull(this.channel1.receive(dst)); - fail("Should throw a ClosedChannelException here."); //$NON-NLS-1$ + fail("Should throw a ClosedChannelException here."); } catch (ClosedChannelException e) { // OK. } @@ -1471,7 +1471,7 @@ public class DatagramChannelTest extends TestCase { // checking buffer before checking open try { this.channel1.receive(null); - fail("Should throw a NPE here."); //$NON-NLS-1$ + fail("Should throw a NPE here."); } catch (NullPointerException e) { // OK. } @@ -1497,7 +1497,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isOpen()); try { this.channel1.receive(dst); - fail("Should throw an IllegalArgumentException here."); //$NON-NLS-1$ + fail("Should throw an IllegalArgumentException here."); } catch (IllegalArgumentException e) { // OK. } @@ -1736,7 +1736,7 @@ public class DatagramChannelTest extends TestCase { connectWithoutServer(); try { this.channel1.receive(null); - fail("Should throw a NPE here."); //$NON-NLS-1$ + fail("Should throw a NPE here."); } catch (NullPointerException e) { // OK. } @@ -1749,7 +1749,7 @@ public class DatagramChannelTest extends TestCase { assertTrue(dst.isReadOnly()); try { this.channel1.receive(dst); - fail("Should throw an IllegalArgumentException here."); //$NON-NLS-1$ + fail("Should throw an IllegalArgumentException here."); } catch (IllegalArgumentException e) { // OK. } @@ -1768,7 +1768,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isOpen()); try { assertNull(this.channel1.receive(dst)); - fail("Should throw a ClosedChannelException here."); //$NON-NLS-1$ + fail("Should throw a ClosedChannelException here."); } catch (ClosedChannelException e) { // OK. } @@ -1780,7 +1780,7 @@ public class DatagramChannelTest extends TestCase { assertFalse(this.channel1.isOpen()); try { this.channel1.receive(null); - fail("Should throw a NPE here."); //$NON-NLS-1$ + fail("Should throw a NPE here."); } catch (NullPointerException e) { // OK. } @@ -1795,7 +1795,7 @@ public class DatagramChannelTest extends TestCase { assertTrue(dst.isReadOnly()); try { this.channel1.receive(dst); - fail("Should throw an IllegalArgumentException here."); //$NON-NLS-1$ + fail("Should throw an IllegalArgumentException here."); } catch (IllegalArgumentException e) { // OK. } diff --git a/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetDecoderTest.java b/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetDecoderTest.java index 70c6c8f..474b980 100644 --- a/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetDecoderTest.java +++ b/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetDecoderTest.java @@ -52,9 +52,9 @@ public class CharsetDecoderTest extends TestCase { public void test_ConstructorLjava_nio_charset_CharsetFF() { // Regression for HARMONY-142 try { - Charset cs = Charset.forName("UTF-8"); //$NON-NLS-1$ + Charset cs = Charset.forName("UTF-8"); new MockCharsetDecoderForHarmony142(cs, 1.1f, 1); - fail("Assert 0: Should throw IllegalArgumentException."); //$NON-NLS-1$ + fail("Assert 0: Should throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // expected } @@ -128,21 +128,21 @@ public class CharsetDecoderTest extends TestCase { ) public void test_decodeLjava_nio_ByteBuffer() throws Exception { MockMalfunctionCharset cs1 = new MockMalfunctionCharset( - "Harmony-124-1", null); //$NON-NLS-1$ + "Harmony-124-1", null); try { cs1.newDecoder().onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE).decode( ByteBuffer.wrap(new byte[] { 0x00, 0x11 })); - fail("Assert 0: should throw CoderMalfunctionError"); // NON-NLS-1$ + fail("Assert 0: should throw CoderMalfunctionError"); } catch (CoderMalfunctionError e) { // expected } MockMalfunctionCharset cs2 = new MockMalfunctionCharset( - "Harmony-124-2", null); //$NON-NLS-1$ + "Harmony-124-2", null); try { cs2.decode(ByteBuffer.wrap(new byte[] { 0x00, 0x11 })); - fail("Assert 1: Charset.decode should throw CoderMalfunctionError"); // NON-NLS-1 + fail("Assert 1: Charset.decode should throw CoderMalfunctionError"); } catch (CoderMalfunctionError e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetEncoderTest.java b/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetEncoderTest.java index c3e2256..dc5ddc3 100644 --- a/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetEncoderTest.java +++ b/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetEncoderTest.java @@ -56,18 +56,18 @@ public class CharsetEncoderTest extends TestCase { public void test_ConstructorLjava_nio_charset_CharsetFF() { // Regression for HARMONY-141 try { - Charset cs = Charset.forName("UTF-8"); //$NON-NLS-1$ + Charset cs = Charset.forName("UTF-8"); new MockCharsetEncoderForHarmony141(cs, 1.1f, 1); - fail("Assert 0: Should throw IllegalArgumentException."); //$NON-NLS-1$ + fail("Assert 0: Should throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // expected } try { - Charset cs = Charset.forName("ISO8859-1"); //$NON-NLS-1$ + Charset cs = Charset.forName("ISO8859-1"); new MockCharsetEncoderForHarmony141(cs, 1.1f, 1, new byte[] { 0x1a }); - fail("Assert 1: Should throw IllegalArgumentException."); //$NON-NLS-1$ + fail("Assert 1: Should throw IllegalArgumentException."); } catch (IllegalArgumentException e) { // expected } @@ -140,7 +140,7 @@ public class CharsetEncoderTest extends TestCase { MockMalfunctionCharset cs = new MockMalfunctionCharset("mock", null); try { cs.encode(CharBuffer.wrap("AB")); - fail("should throw CoderMalfunctionError");// NON-NLS-1$ + fail("should throw CoderMalfunctionError"); } catch (CoderMalfunctionError e) { // expected } diff --git a/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetTest.java b/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetTest.java index e7c5f5c..0d4d68c 100644 --- a/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetTest.java +++ b/luni/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/CharsetTest.java @@ -111,43 +111,43 @@ public class CharsetTest extends TestCase { String oldDefaultEncoding = System.getProperty("file.encoding"); try { // Normal behavior - charsetName = "UTF-8"; //$NON-NLS-1$ - System.setProperty("file.encoding", charsetName);//$NON-NLS-1$ + charsetName = "UTF-8"; + System.setProperty("file.encoding", charsetName); defaultCharsetName = Charset.defaultCharset().name(); assertEquals(charsetName, defaultCharsetName); - charsetName = "ISO-8859-1"; //$NON-NLS-1$ - System.setProperty("file.encoding", charsetName);//$NON-NLS-1$ + charsetName = "ISO-8859-1"; + System.setProperty("file.encoding", charsetName); defaultCharsetName = Charset.defaultCharset().name(); assertEquals(charsetName, defaultCharsetName); // Unsupported behavior - charsetName = "IMPOSSIBLE-8"; //$NON-NLS-1$ - System.setProperty("file.encoding", charsetName);//$NON-NLS-1$ + charsetName = "IMPOSSIBLE-8"; + System.setProperty("file.encoding", charsetName); defaultCharsetName = Charset.defaultCharset().name(); assertEquals("UTF-8", defaultCharsetName); // Null behavior try { Properties currentProps = System.getProperties(); - currentProps.remove("file.encoding");//$NON-NLS-1$ + currentProps.remove("file.encoding"); Charset.defaultCharset().name(); - fail("Should throw illegal IllegalArgumentException");//$NON-NLS-1$ + fail("Should throw illegal IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } // IllegalCharsetName behavior try { - charsetName = "IMP~~OSSIBLE-8"; //$NON-NLS-1$ - System.setProperty("file.encoding", charsetName);//$NON-NLS-1$ + charsetName = "IMP~~OSSIBLE-8"; + System.setProperty("file.encoding", charsetName); Charset.defaultCharset().name(); - fail("Should throw IllegalCharsetNameException");//$NON-NLS-1$ + fail("Should throw IllegalCharsetNameException"); } catch (IllegalCharsetNameException e) { // expected } } finally { - System.setProperty("file.encoding", oldDefaultEncoding);//$NON-NLS-1$ + System.setProperty("file.encoding", oldDefaultEncoding); } } diff --git a/luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java b/luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java index c6e0861..632f479 100644 --- a/luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java +++ b/luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java @@ -905,7 +905,7 @@ public class PreferencesTest extends TestCase { } pref.put("testGetFloatKey", "1"); pref.put("testGetFloatKey2", "value"); - assertEquals(1f, pref.getFloat("testGetFloatKey", 0f), 0); //$NON-NLS-1$ + assertEquals(1f, pref.getFloat("testGetFloatKey", 0f), 0); assertEquals(0f, pref.getFloat("testGetFloatKey2", 0f), 0); } diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java index eeef8ac..7702327 100644 --- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java +++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java @@ -414,7 +414,7 @@ public class CodeSourceTest extends TestCase { args = {} ) public void testGetCoderSignersNull() throws Exception{ - assertNull(new CodeSource(new URL("http://url"), (Certificate[])null).getCodeSigners()); //$NON-NLS-1$ + assertNull(new CodeSource(new URL("http://url"), (Certificate[])null).getCodeSigners()); } /** diff --git a/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java b/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java index 069d46f..42ca24d 100644 --- a/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java +++ b/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java @@ -214,11 +214,11 @@ public class DriverManagerTest extends TestCase { ) public void test_getConnection_LStringLProperties() { try { - DriverManager.getConnection("fff", //$NON-NLS-1$ + DriverManager.getConnection("fff", new Properties()); fail("Should throw SQLException."); } catch (SQLException e) { - assertEquals("08001", e.getSQLState()); //$NON-NLS-1$ + assertEquals("08001", e.getSQLState()); } try { @@ -226,7 +226,7 @@ public class DriverManagerTest extends TestCase { new Properties()); fail("Should throw SQLException."); } catch (SQLException e) { - assertEquals("08001", e.getSQLState()); //$NON-NLS-1$ + assertEquals("08001", e.getSQLState()); } } diff --git a/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java b/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java index c1c09a0..98f94b1 100644 --- a/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java +++ b/luni/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java @@ -512,16 +512,16 @@ public class TimestampTest extends TestCase { } // end for Timestamp t1 = new Timestamp(Long.MIN_VALUE); - assertEquals("292278994-08-17 07:12:55.192", t1.toString()); //$NON-NLS-1$ + assertEquals("292278994-08-17 07:12:55.192", t1.toString()); Timestamp t2 = new Timestamp(Long.MIN_VALUE + 1); - assertEquals("292278994-08-17 07:12:55.193", t2.toString()); //$NON-NLS-1$ + assertEquals("292278994-08-17 07:12:55.193", t2.toString()); Timestamp t3 = new Timestamp(Long.MIN_VALUE + 807); - assertEquals("292278994-08-17 07:12:55.999", t3.toString()); //$NON-NLS-1$ + assertEquals("292278994-08-17 07:12:55.999", t3.toString()); Timestamp t4 = new Timestamp(Long.MIN_VALUE + 808); - assertEquals("292269055-12-02 16:47:05.0", t4.toString()); //$NON-NLS-1$ + assertEquals("292269055-12-02 16:47:05.0", t4.toString()); } // end method testtoString private void testToString(String timeZone, long[] theTimeStamps, String[] theTimeStampStrings) { @@ -852,16 +852,16 @@ public class TimestampTest extends TestCase { public void test_toString() { Timestamp t1 = new Timestamp(Long.MIN_VALUE); - assertEquals("292278994-08-17 07:12:55.192", t1.toString()); //$NON-NLS-1$ + assertEquals("292278994-08-17 07:12:55.192", t1.toString()); Timestamp t2 = new Timestamp(Long.MIN_VALUE + 1); - assertEquals("292278994-08-17 07:12:55.193", t2.toString()); //$NON-NLS-1$ + assertEquals("292278994-08-17 07:12:55.193", t2.toString()); Timestamp t3 = new Timestamp(Long.MIN_VALUE + 807); - assertEquals("292278994-08-17 07:12:55.999", t3.toString()); //$NON-NLS-1$ + assertEquals("292278994-08-17 07:12:55.999", t3.toString()); Timestamp t4 = new Timestamp(Long.MIN_VALUE + 808); - assertEquals("292269055-12-02 16:47:05.0", t4.toString()); //$NON-NLS-1$ + assertEquals("292269055-12-02 16:47:05.0", t4.toString()); } // Reset defualt timezone diff --git a/luni/src/test/java/tests/api/java/io/FileWriterTest.java b/luni/src/test/java/tests/api/java/io/FileWriterTest.java index 8e30fd0..6008d12 100644 --- a/luni/src/test/java/tests/api/java/io/FileWriterTest.java +++ b/luni/src/test/java/tests/api/java/io/FileWriterTest.java @@ -307,7 +307,7 @@ public class FileWriterTest extends junit.framework.TestCase { args = {char[].class, int.class, int.class} ) public void test_handleEarlyEOFChar_1() { - String str = "All work and no play makes Jack a dull boy\n"; //$NON-NLS-1$ + String str = "All work and no play makes Jack a dull boy\n"; int NUMBER = 2048; int j = 0; int len = str.length() * NUMBER; @@ -360,7 +360,7 @@ public class FileWriterTest extends junit.framework.TestCase { } String inputStr = new String(bytes); int len = inputStr.length(); - File f = File.createTempFile("FileWriterBugTest ", null); //$NON-NLS-1$ + File f = File.createTempFile("FileWriterBugTest ", null); FileWriter writer = new FileWriter(f); writer.write(inputStr); writer.close(); diff --git a/luni/src/test/java/tests/api/java/io/PipedInputStreamTest.java b/luni/src/test/java/tests/api/java/io/PipedInputStreamTest.java index a5dcc34..d7860fa 100644 --- a/luni/src/test/java/tests/api/java/io/PipedInputStreamTest.java +++ b/luni/src/test/java/tests/api/java/io/PipedInputStreamTest.java @@ -395,14 +395,14 @@ public class PipedInputStreamTest extends junit.framework.TestCase { try { pis = new PipedInputStream(null, -1); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } try { pis = new PipedInputStream(null, 0); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } @@ -420,14 +420,14 @@ public class PipedInputStreamTest extends junit.framework.TestCase { try { pis = new PipedInputStream(-1); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } try { pis = new PipedInputStream(0); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/tests/api/java/io/PipedReaderTest.java b/luni/src/test/java/tests/api/java/io/PipedReaderTest.java index edbb5f5..0190393 100644 --- a/luni/src/test/java/tests/api/java/io/PipedReaderTest.java +++ b/luni/src/test/java/tests/api/java/io/PipedReaderTest.java @@ -83,14 +83,14 @@ public class PipedReaderTest extends TestCase { // int) try { preader = new PipedReader(null, -1); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } try { preader = new PipedReader(null, 0); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } @@ -104,14 +104,14 @@ public class PipedReaderTest extends TestCase { // Test for method java.io.PipedReader(int) try { preader = new PipedReader(-1); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } try { preader = new PipedReader(0); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } @@ -259,7 +259,7 @@ public class PipedReaderTest extends TestCase { pr.close(); try { pr.read(buf, 0, 10); - fail("Should throws IOException"); //$NON-NLS-1$ + fail("Should throws IOException"); } catch (IOException e) { // expected } finally { @@ -272,7 +272,7 @@ public class PipedReaderTest extends TestCase { pr.close(); try { pr.read(buf, 0, 10); - fail("Should throws IOException"); //$NON-NLS-1$ + fail("Should throws IOException"); } catch (IOException e) { // expected } finally { @@ -285,7 +285,7 @@ public class PipedReaderTest extends TestCase { pr.close(); try { pr.read(buf, -1, 0); - fail("Should throws IOException"); //$NON-NLS-1$ + fail("Should throws IOException"); } catch (IOException e) { // expected } finally { @@ -299,7 +299,7 @@ public class PipedReaderTest extends TestCase { pr.close(); try { pr.read(buf, 0, -1); - fail("Should throws IOException"); //$NON-NLS-1$ + fail("Should throws IOException"); } catch (IOException e) { // expected } finally { @@ -313,7 +313,7 @@ public class PipedReaderTest extends TestCase { pr.close(); try { pr.read(buf, 1, 10); - fail("Should throws IOException"); //$NON-NLS-1$ + fail("Should throws IOException"); } catch (IOException e) { // expected } finally { @@ -326,7 +326,7 @@ public class PipedReaderTest extends TestCase { pr.close(); try { pr.read(new char[0], -1, -1); - fail("should throw IOException"); //$NON-NLS-1$ + fail("should throw IOException"); } catch (IOException e) { // expected } finally { @@ -339,7 +339,7 @@ public class PipedReaderTest extends TestCase { pr.close(); try { pr.read(null, 0, 1); - fail("should throw IOException"); //$NON-NLS-1$ + fail("should throw IOException"); } catch (IOException e) { // expected } finally { @@ -351,7 +351,7 @@ public class PipedReaderTest extends TestCase { pr = new PipedReader(pw); try { pr.read(null, -1, 1); - fail("should throw IndexOutOfBoundsException"); //$NON-NLS-1$ + fail("should throw IndexOutOfBoundsException"); } catch (NullPointerException expected) { // android-added } catch (IndexOutOfBoundsException e) { // expected @@ -364,7 +364,7 @@ public class PipedReaderTest extends TestCase { pr = new PipedReader(pw); try { pr.read(null, 0, -1); - fail("should throw NullPointerException"); //$NON-NLS-1$ + fail("should throw NullPointerException"); } catch (NullPointerException e) { // expected } finally { @@ -376,7 +376,7 @@ public class PipedReaderTest extends TestCase { pr = new PipedReader(pw); try { pr.read(new char[10], 11, 0); - fail("should throw IndexOutOfBoundsException"); //$NON-NLS-1$ + fail("should throw IndexOutOfBoundsException"); } catch (IndexOutOfBoundsException e) { // expected } finally { @@ -388,7 +388,7 @@ public class PipedReaderTest extends TestCase { pr = new PipedReader(pw); try { pr.read(null, 1, 0); - fail("should throw NullPointerException"); //$NON-NLS-1$ + fail("should throw NullPointerException"); } catch (NullPointerException e) { // expected } finally { diff --git a/luni/src/test/java/tests/api/java/net/URITest.java b/luni/src/test/java/tests/api/java/net/URITest.java index 3922b13..c8c9aa8 100644 --- a/luni/src/test/java/tests/api/java/net/URITest.java +++ b/luni/src/test/java/tests/api/java/net/URITest.java @@ -118,7 +118,7 @@ public class URITest extends TestCase { // URI("ascheme://user\u00df\u00a3info@host:0/a\u0080path?qu\u00a9\u00aeery#fr\u00e4\u00e8g"), // multiple arg constructors - new URI("http", "user%60%20info", "host", 80, "/a%20path", //$NON-NLS-4$ + new URI("http", "user%60%20info", "host", 80, "/a%20path", "qu%60%20ery", "fr%5E%20ag"), // escaped octets for illegal new URI("http", "user%C3%9F%C2%A3info", "host", -1, diff --git a/luni/src/test/java/tests/api/java/net/URLClassLoaderTest.java b/luni/src/test/java/tests/api/java/net/URLClassLoaderTest.java index 2e3baae..3fc96ac 100644 --- a/luni/src/test/java/tests/api/java/net/URLClassLoaderTest.java +++ b/luni/src/test/java/tests/api/java/net/URLClassLoaderTest.java @@ -587,16 +587,16 @@ public class URLClassLoaderTest extends junit.framework.TestCase { String tempPath3 = "http://localhost:" + port + "/"; URLClassLoader urlLoader = getURLClassLoader(tempPath1, tempPath2); assertNull("Found inexistant resource", - urlLoader.findResource("XXX")); //$NON-NLS-1$ + urlLoader.findResource("XXX")); assertNotNull("Couldn't find resource from directory", - urlLoader.findResource(tempFile1.getName())); //$NON-NLS-1$ + urlLoader.findResource(tempFile1.getName())); assertNotNull("Couldn't find resource from jar", - urlLoader.findResource("Blah.txt")); //$NON-NLS-1$ + urlLoader.findResource("Blah.txt")); urlLoader = getURLClassLoader(tempPath1, tempPath2, tempPath3); assertNotNull("Couldn't find resource from web", - urlLoader.findResource("test1")); //$NON-NLS-1$ + urlLoader.findResource("test1")); assertNull("Found inexistant resource from web", - urlLoader.findResource("test3")); //$NON-NLS-1$ + urlLoader.findResource("test3")); } finally { server.close(); } diff --git a/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java b/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java index e2c47b8..cab91be 100644 --- a/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java +++ b/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java @@ -70,13 +70,13 @@ public class AbstractSequentialListTest extends TestCase { ) public void test_addAll_ILCollection() { AbstractSequentialList<String> al = new ASLT<String>(); - String[] someList = { "Aardvark" , //$NON-NLS-1$ - "Bear" , //$NON-NLS-1$ - "Chimpanzee", //$NON-NLS-1$ - "Duck" }; //$NON-NLS-1$ + String[] someList = { "Aardvark" , + "Bear" , + "Chimpanzee", + "Duck" }; Collection<String> c = Arrays.asList(someList); al.addAll(c); - assertTrue("Should return true", al.addAll(2, c)); //$NON-NLS-1$ + assertTrue("Should return true", al.addAll(2, c)); } class Mock_unsupportedListIterator implements ListIterator { diff --git a/luni/src/test/java/tests/api/java/util/EnumMapTest.java b/luni/src/test/java/tests/api/java/util/EnumMapTest.java index 26e11c3..a43c845 100644 --- a/luni/src/test/java/tests/api/java/util/EnumMapTest.java +++ b/luni/src/test/java/tests/api/java/util/EnumMapTest.java @@ -93,7 +93,7 @@ public class EnumMapTest extends TestCase { public void test_ConstructorLjava_lang_Class() { try { new EnumMap((Class) null); - fail("Expected NullPointerException"); //$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } @@ -101,52 +101,52 @@ public class EnumMapTest extends TestCase { try { new EnumMap(Size.Big.getClass()); - fail("Expected NullPointerException"); //$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } try { new EnumMap(Integer.class); - fail("Expected NullPointerException"); //$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); - assertNull("Return non-null for non mapped key", enumColorMap.put( //$NON-NLS-1$ + assertNull("Return non-null for non mapped key", enumColorMap.put( Color.Green, 2)); - assertEquals("Get returned incorrect value for given key", 2, //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", 2, enumColorMap.get(Color.Green)); EnumMap enumEmptyMap = new EnumMap<Empty, Double>(Empty.class); try { enumEmptyMap.put(Color.Red, 2); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } EnumMap enumSizeMap = new EnumMap(Size.class); - assertNull("Return non-null for non mapped key", enumSizeMap.put( //$NON-NLS-1$ + assertNull("Return non-null for non mapped key", enumSizeMap.put( Size.Big, 2)); - assertEquals("Get returned incorrect value for given key", 2, //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", 2, enumSizeMap.get(Size.Big)); try { enumSizeMap.put(Color.Red, 2); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } enumSizeMap = new EnumMap(Size.Middle.getClass()); - assertNull("Return non-null for non mapped key", enumSizeMap.put( //$NON-NLS-1$ + assertNull("Return non-null for non mapped key", enumSizeMap.put( Size.Small, 1)); - assertEquals("Get returned incorrect value for given key", 1, //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", 1, enumSizeMap.get(Size.Small)); try { enumSizeMap.put(Color.Red, 2); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } @@ -167,7 +167,7 @@ public class EnumMapTest extends TestCase { EnumMap enumColorMap = null; try { enumMap = new EnumMap(enumColorMap); - fail("Expected NullPointerException"); //$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } @@ -178,15 +178,15 @@ public class EnumMapTest extends TestCase { enumColorMap.put(Color.Blue, double1); enumMap = new EnumMap(enumColorMap); - assertEquals("Constructor fails", 2, enumMap.get(Color.Green)); //$NON-NLS-1$ - assertSame("Constructor fails", double1, enumMap.get(Color.Blue)); //$NON-NLS-1$ - assertNull("Constructor fails", enumMap.get(Color.Red)); //$NON-NLS-1$ + assertEquals("Constructor fails", 2, enumMap.get(Color.Green)); + assertSame("Constructor fails", double1, enumMap.get(Color.Blue)); + assertNull("Constructor fails", enumMap.get(Color.Red)); enumMap.put(Color.Red, 1); - assertEquals("Wrong value", 1, enumMap.get(Color.Red)); //$NON-NLS-1$ + assertEquals("Wrong value", 1, enumMap.get(Color.Red)); try { enumMap.put(Size.Middle, 2); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } @@ -207,7 +207,7 @@ public class EnumMapTest extends TestCase { Map enumColorMap = null; try { enumMap = new EnumMap(enumColorMap); - fail("Expected NullPointerException"); //$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } @@ -219,7 +219,7 @@ public class EnumMapTest extends TestCase { HashMap hashColorMap = null; try { enumMap = new EnumMap(hashColorMap); - fail("Expected NullPointerException");//$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } @@ -227,21 +227,21 @@ public class EnumMapTest extends TestCase { hashColorMap = new HashMap(); try { enumMap = new EnumMap(hashColorMap); - fail("Expected IllegalArgumentException"); //$NON-NLS-1$ + fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // Expected } hashColorMap.put(Color.Green, 2); enumMap = new EnumMap(hashColorMap); - assertEquals("Constructor fails", 2, enumMap.get(Color.Green)); //$NON-NLS-1$ - assertNull("Constructor fails", enumMap.get(Color.Red)); //$NON-NLS-1$ + assertEquals("Constructor fails", 2, enumMap.get(Color.Green)); + assertNull("Constructor fails", enumMap.get(Color.Red)); enumMap.put(Color.Red, 1); - assertEquals("Wrong value", 1, enumMap.get(Color.Red)); //$NON-NLS-1$ + assertEquals("Wrong value", 1, enumMap.get(Color.Red)); hashColorMap.put(Size.Big, 3); try { enumMap = new EnumMap(hashColorMap); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } @@ -250,7 +250,7 @@ public class EnumMapTest extends TestCase { hashColorMap.put(new Integer(1), 1); try { enumMap = new EnumMap(hashColorMap); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } @@ -270,7 +270,7 @@ public class EnumMapTest extends TestCase { EnumMap enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Small, 1); enumSizeMap.clear(); - assertNull("Failed to clear all elements", enumSizeMap.get(Size.Small)); //$NON-NLS-1$ + assertNull("Failed to clear all elements", enumSizeMap.get(Size.Small)); } /** @@ -285,21 +285,21 @@ public class EnumMapTest extends TestCase { @SuppressWarnings( { "unchecked", "boxing" }) public void test_containsKeyLjava_lang_Object() { EnumMap enumSizeMap = new EnumMap(Size.class); - assertFalse("Returned true for uncontained key", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for uncontained key", enumSizeMap .containsKey(Size.Small)); enumSizeMap.put(Size.Small, 1); - assertTrue("Returned false for contained key", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for contained key", enumSizeMap .containsKey(Size.Small)); enumSizeMap.put(Size.Big, null); - assertTrue("Returned false for contained key", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for contained key", enumSizeMap .containsKey(Size.Big)); - assertFalse("Returned true for uncontained key", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for uncontained key", enumSizeMap .containsKey(Color.Red)); - assertFalse("Returned true for uncontained key", enumSizeMap //$NON-NLS-1$ - .containsKey(new Integer("3"))); //$NON-NLS-1$ - assertFalse("Returned true for uncontained key", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for uncontained key", enumSizeMap + .containsKey(new Integer("3"))); + assertFalse("Returned true for uncontained key", enumSizeMap .containsKey(null)); } @@ -315,19 +315,19 @@ public class EnumMapTest extends TestCase { @SuppressWarnings( { "unchecked", "boxing" }) public void test_clone() { EnumMap enumSizeMap = new EnumMap(Size.class); - Integer integer = new Integer("3"); //$NON-NLS-1$ + Integer integer = new Integer("3"); enumSizeMap.put(Size.Small, integer); EnumMap enumSizeMapClone = enumSizeMap.clone(); - assertNotSame("Should not be same", enumSizeMap, enumSizeMapClone); //$NON-NLS-1$ - assertEquals("Clone answered unequal EnumMap", enumSizeMap, //$NON-NLS-1$ + assertNotSame("Should not be same", enumSizeMap, enumSizeMapClone); + assertEquals("Clone answered unequal EnumMap", enumSizeMap, enumSizeMapClone); - assertSame("Should be same", enumSizeMap.get(Size.Small), //$NON-NLS-1$ + assertSame("Should be same", enumSizeMap.get(Size.Small), enumSizeMapClone.get(Size.Small)); - assertSame("Clone is not shallow clone", integer, enumSizeMapClone //$NON-NLS-1$ + assertSame("Clone is not shallow clone", integer, enumSizeMapClone .get(Size.Small)); enumSizeMap.remove(Size.Small); - assertSame("Clone is not shallow clone", integer, enumSizeMapClone //$NON-NLS-1$ + assertSame("Clone is not shallow clone", integer, enumSizeMapClone .get(Size.Small)); } @@ -346,23 +346,23 @@ public class EnumMapTest extends TestCase { Double double1 = new Double(3); Double double2 = new Double(3); - assertFalse("Returned true for uncontained value", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for uncontained value", enumSizeMap .containsValue(double1)); enumSizeMap.put(Size.Middle, 2); enumSizeMap.put(Size.Small, double1); - assertTrue("Returned false for contained value", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for contained value", enumSizeMap .containsValue(double1)); - assertTrue("Returned false for contained value", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for contained value", enumSizeMap .containsValue(double2)); - assertTrue("Returned false for contained value", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for contained value", enumSizeMap .containsValue(2)); - assertFalse("Returned true for uncontained value", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for uncontained value", enumSizeMap .containsValue(1)); - assertFalse("Returned true for uncontained value", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for uncontained value", enumSizeMap .containsValue(null)); enumSizeMap.put(Size.Big, null); - assertTrue("Returned false for contained value", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for contained value", enumSizeMap .containsValue(null)); } @@ -385,55 +385,55 @@ public class EnumMapTest extends TestCase { Set set = enumSizeMap.entrySet(); Set set1 = enumSizeMap.entrySet(); - assertSame("Should be same", set1, set); //$NON-NLS-1$ + assertSame("Should be same", set1, set); try { set.add(mockEntry); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // Expected } - assertTrue("Returned false for contained object", set//$NON-NLS-1$ + assertTrue("Returned false for contained object", set .contains(mockEntry)); mockEntry = new MockEntry(Size.Middle, null); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(mockEntry)); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(Size.Small)); mockEntry = new MockEntry(new Integer(1), 1); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(mockEntry)); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(new Integer(1))); mockEntry = new MockEntry(Size.Big, null); - assertTrue("Returned false for contained object", set//$NON-NLS-1$ + assertTrue("Returned false for contained object", set .contains(mockEntry)); - assertTrue("Returned false when the object can be removed", set //$NON-NLS-1$ + assertTrue("Returned false when the object can be removed", set .remove(mockEntry)); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(mockEntry)); - assertFalse("Returned true when the object can not be removed", set //$NON-NLS-1$ + assertFalse("Returned true when the object can not be removed", set .remove(mockEntry)); mockEntry = new MockEntry(new Integer(1), 1); - assertFalse("Returned true when the object can not be removed", set //$NON-NLS-1$ + assertFalse("Returned true when the object can not be removed", set .remove(mockEntry)); - assertFalse("Returned true when the object can not be removed", set //$NON-NLS-1$ + assertFalse("Returned true when the object can not be removed", set .remove(new Integer(1))); // The set is backed by the map so changes to one are reflected by the // other. enumSizeMap.put(Size.Big, 3); mockEntry = new MockEntry(Size.Big, 3); - assertTrue("Returned false for contained object", set//$NON-NLS-1$ + assertTrue("Returned false for contained object", set .contains(mockEntry)); enumSizeMap.remove(Size.Big); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(mockEntry)); - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, set.size()); set.clear(); - assertEquals("Wrong size", 0, set.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, set.size()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -441,14 +441,14 @@ public class EnumMapTest extends TestCase { set = enumSizeMap.entrySet(); Collection c = new ArrayList(); c.add(new MockEntry(Size.Middle, 1)); - assertTrue("Return wrong value", set.containsAll(c)); //$NON-NLS-1$ - assertTrue("Remove does not success", set.removeAll(c)); //$NON-NLS-1$ + assertTrue("Return wrong value", set.containsAll(c)); + assertTrue("Remove does not success", set.removeAll(c)); enumSizeMap.put(Size.Middle, 1); c.add(new MockEntry(Size.Big, 3)); - assertTrue("Remove does not success", set.removeAll(c)); //$NON-NLS-1$ - assertFalse("Should return false", set.removeAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ + assertTrue("Remove does not success", set.removeAll(c)); + assertFalse("Should return false", set.removeAll(c)); + assertEquals("Wrong size", 1, set.size()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -458,9 +458,9 @@ public class EnumMapTest extends TestCase { c.add(new MockEntry(Size.Middle, 1)); c.add(new MockEntry(Size.Big, 3)); - assertTrue("Retain does not success", set.retainAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ - assertFalse("Should return false", set.retainAll(c)); //$NON-NLS-1$ + assertTrue("Retain does not success", set.retainAll(c)); + assertEquals("Wrong size", 1, set.size()); + assertFalse("Should return false", set.retainAll(c)); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -468,30 +468,30 @@ public class EnumMapTest extends TestCase { set = enumSizeMap.entrySet(); Object[] array = set.toArray(); - assertEquals("Wrong length", 2, array.length); //$NON-NLS-1$ + assertEquals("Wrong length", 2, array.length); Map.Entry entry = (Map.Entry) array[0]; - assertEquals("Wrong key", Size.Middle, entry.getKey()); //$NON-NLS-1$ - assertEquals("Wrong value", 1, entry.getValue()); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Middle, entry.getKey()); + assertEquals("Wrong value", 1, entry.getValue()); Object[] array1 = new Object[10]; array1 = set.toArray(); - assertEquals("Wrong length", 2, array1.length); //$NON-NLS-1$ + assertEquals("Wrong length", 2, array1.length); entry = (Map.Entry) array[0]; - assertEquals("Wrong key", Size.Middle, entry.getKey()); //$NON-NLS-1$ - assertEquals("Wrong value", 1, entry.getValue()); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Middle, entry.getKey()); + assertEquals("Wrong value", 1, entry.getValue()); array1 = new Object[10]; array1 = set.toArray(array1); - assertEquals("Wrong length", 10, array1.length); //$NON-NLS-1$ + assertEquals("Wrong length", 10, array1.length); entry = (Map.Entry) array[1]; - assertEquals("Wrong key", Size.Big, entry.getKey()); //$NON-NLS-1$ - assertNull("Should be null", array1[2]); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Big, entry.getKey()); + assertNull("Should be null", array1[2]); set = enumSizeMap.entrySet(); - Integer integer = new Integer("1"); //$NON-NLS-1$ - assertFalse("Returned true when the object can not be removed", set //$NON-NLS-1$ + Integer integer = new Integer("1"); + assertFalse("Returned true when the object can not be removed", set .remove(integer)); - assertTrue("Returned false when the object can be removed", set //$NON-NLS-1$ + assertTrue("Returned false when the object can be removed", set .remove(entry)); enumSizeMap = new EnumMap(Size.class); @@ -500,42 +500,42 @@ public class EnumMapTest extends TestCase { set = enumSizeMap.entrySet(); Iterator iter = set.iterator(); entry = (Map.Entry) iter.next(); - assertTrue("Returned false for contained object", set.contains(entry)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(entry)); mockEntry = new MockEntry(Size.Middle, 2); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(mockEntry)); mockEntry = new MockEntry(new Integer(2), 2); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(mockEntry)); entry = (Map.Entry) iter.next(); - assertTrue("Returned false for contained object", set.contains(entry)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(entry)); enumSizeMap.put(Size.Middle, 1); enumSizeMap.remove(Size.Big); mockEntry = new MockEntry(Size.Big, null); - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ - assertFalse("Returned true for uncontained object", set.contains(mockEntry)); //$NON-NLS-1$ + assertEquals("Wrong size", 1, set.size()); + assertFalse("Returned true for uncontained object", set.contains(mockEntry)); enumSizeMap.put(Size.Big, 2); mockEntry = new MockEntry(Size.Big, 2); - assertTrue("Returned false for contained object", set //$NON-NLS-1$ + assertTrue("Returned false for contained object", set .contains(mockEntry)); iter.remove(); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } try { entry.setValue(2); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } try { set.contains(entry); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } @@ -546,20 +546,20 @@ public class EnumMapTest extends TestCase { set = enumSizeMap.entrySet(); iter = set.iterator(); entry = (Map.Entry) iter.next(); - assertEquals("Wrong key", Size.Middle, entry.getKey()); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Middle, entry.getKey()); - assertTrue("Returned false for contained object", set.contains(entry)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(entry)); enumSizeMap.put(Size.Middle, 3); - assertTrue("Returned false for contained object", set.contains(entry)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(entry)); entry.setValue(2); - assertTrue("Returned false for contained object", set.contains(entry)); //$NON-NLS-1$ - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(entry)); + assertFalse("Returned true for uncontained object", set .remove(new Integer(1))); iter.next(); - assertEquals("Wrong key", Size.Middle, entry.getKey()); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Middle, entry.getKey()); set.clear(); - assertEquals("Wrong size", 0, set.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, set.size()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -568,35 +568,35 @@ public class EnumMapTest extends TestCase { iter = set.iterator(); mockEntry = new MockEntry(Size.Middle, 1); - assertFalse("Wrong result", entry.equals(mockEntry)); //$NON-NLS-1$ + assertFalse("Wrong result", entry.equals(mockEntry)); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } entry = (Map.Entry) iter.next(); - assertEquals("Wrong key", Size.Middle, entry.getKey()); //$NON-NLS-1$ - assertTrue("Should return true", entry.equals(mockEntry)); //$NON-NLS-1$ - assertEquals("Should be equal", mockEntry.hashCode(), entry.hashCode()); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Middle, entry.getKey()); + assertTrue("Should return true", entry.equals(mockEntry)); + assertEquals("Should be equal", mockEntry.hashCode(), entry.hashCode()); mockEntry = new MockEntry(Size.Big, 1); - assertFalse("Wrong result", entry.equals(mockEntry)); //$NON-NLS-1$ + assertFalse("Wrong result", entry.equals(mockEntry)); entry = (Map.Entry) iter.next(); - assertFalse("Wrong result", entry.equals(mockEntry)); //$NON-NLS-1$ - assertEquals("Wrong key", Size.Big, entry.getKey()); //$NON-NLS-1$ + assertFalse("Wrong result", entry.equals(mockEntry)); + assertEquals("Wrong key", Size.Big, entry.getKey()); iter.remove(); - assertFalse("Wrong result", entry.equals(mockEntry)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ + assertFalse("Wrong result", entry.equals(mockEntry)); + assertEquals("Wrong size", 1, set.size()); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } try { iter.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // Expected } @@ -617,34 +617,34 @@ public class EnumMapTest extends TestCase { enumMap.put(Size.Small, 1); EnumMap enumSizeMap = new EnumMap(Size.class); - assertFalse("Returned true for unequal EnumMap", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for unequal EnumMap", enumSizeMap .equals(enumMap)); enumSizeMap.put(Size.Small, 1); - assertTrue("Returned false for equal EnumMap", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for equal EnumMap", enumSizeMap .equals(enumMap)); enumSizeMap.put(Size.Big, null); - assertFalse("Returned true for unequal EnumMap", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for unequal EnumMap", enumSizeMap .equals(enumMap)); enumMap.put(Size.Middle, null); - assertFalse("Returned true for unequal EnumMap", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for unequal EnumMap", enumSizeMap .equals(enumMap)); enumMap.remove(Size.Middle); enumMap.put(Size.Big, 3); - assertFalse("Returned true for unequal EnumMap", enumSizeMap //$NON-NLS-1$ + assertFalse("Returned true for unequal EnumMap", enumSizeMap .equals(enumMap)); enumMap.put(Size.Big, null); - assertTrue("Returned false for equal EnumMap", enumSizeMap //$NON-NLS-1$ + assertTrue("Returned false for equal EnumMap", enumSizeMap .equals(enumMap)); HashMap hashMap = new HashMap(); hashMap.put(Size.Small, 1); - assertFalse("Returned true for unequal EnumMap", hashMap //$NON-NLS-1$ + assertFalse("Returned true for unequal EnumMap", hashMap .equals(enumMap)); hashMap.put(Size.Big, null); - assertTrue("Returned false for equal EnumMap", enumMap.equals(hashMap)); //$NON-NLS-1$ + assertTrue("Returned false for equal EnumMap", enumMap.equals(hashMap)); - assertFalse("Should return false", enumSizeMap //$NON-NLS-1$ + assertFalse("Should return false", enumSizeMap .equals(new Integer(1))); } @@ -665,43 +665,43 @@ public class EnumMapTest extends TestCase { Set set = enumSizeMap.keySet(); Set set1 = enumSizeMap.keySet(); - assertSame("Should be same", set1, set); //$NON-NLS-1$ + assertSame("Should be same", set1, set); try { set.add(Size.Big); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // Expected } - assertTrue("Returned false for contained object", set//$NON-NLS-1$ + assertTrue("Returned false for contained object", set .contains(Size.Middle)); - assertTrue("Returned false for contained object", set//$NON-NLS-1$ + assertTrue("Returned false for contained object", set .contains(Size.Big)); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(Size.Small)); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(new Integer(1))); - assertTrue("Returned false when the object can be removed", set //$NON-NLS-1$ + assertTrue("Returned false when the object can be removed", set .remove(Size.Big)); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(Size.Big)); - assertFalse("Returned true when the object can not be removed", set //$NON-NLS-1$ + assertFalse("Returned true when the object can not be removed", set .remove(Size.Big)); - assertFalse("Returned true when the object can not be removed", set //$NON-NLS-1$ + assertFalse("Returned true when the object can not be removed", set .remove(new Integer(1))); // The set is backed by the map so changes to one are reflected by the // other. enumSizeMap.put(Size.Big, 3); - assertTrue("Returned false for contained object", set//$NON-NLS-1$ + assertTrue("Returned false for contained object", set .contains(Size.Big)); enumSizeMap.remove(Size.Big); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(Size.Big)); - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, set.size()); set.clear(); - assertEquals("Wrong size", 0, set.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, set.size()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -709,29 +709,29 @@ public class EnumMapTest extends TestCase { set = enumSizeMap.keySet(); Collection c = new ArrayList(); c.add(Size.Big); - assertTrue("Should return true", set.containsAll(c)); //$NON-NLS-1$ + assertTrue("Should return true", set.containsAll(c)); c.add(Size.Small); - assertFalse("Should return false", set.containsAll(c)); //$NON-NLS-1$ - assertTrue("Should return true", set.removeAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ - assertFalse("Should return false", set.removeAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ + assertFalse("Should return false", set.containsAll(c)); + assertTrue("Should return true", set.removeAll(c)); + assertEquals("Wrong size", 1, set.size()); + assertFalse("Should return false", set.removeAll(c)); + assertEquals("Wrong size", 1, set.size()); try { set.addAll(c); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // Expected } enumSizeMap.put(Size.Big, null); - assertEquals("Wrong size", 2, set.size()); //$NON-NLS-1$ - assertTrue("Should return true", set.retainAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ - assertFalse("Should return false", set.retainAll(c)); //$NON-NLS-1$ + assertEquals("Wrong size", 2, set.size()); + assertTrue("Should return true", set.retainAll(c)); + assertEquals("Wrong size", 1, set.size()); + assertFalse("Should return false", set.retainAll(c)); assertEquals(1, set.size()); Object[] array = set.toArray(); - assertEquals("Wrong length", 1, array.length); //$NON-NLS-1$ - assertEquals("Wrong key", Size.Big, array[0]); //$NON-NLS-1$ + assertEquals("Wrong length", 1, array.length); + assertEquals("Wrong key", Size.Big, array[0]); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -739,10 +739,10 @@ public class EnumMapTest extends TestCase { set = enumSizeMap.keySet(); c = new ArrayList(); c.add(Color.Blue); - assertFalse("Should return false", set.remove(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 2, set.size()); //$NON-NLS-1$ - assertTrue("Should return true", set.retainAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 0, set.size()); //$NON-NLS-1$ + assertFalse("Should return false", set.remove(c)); + assertEquals("Wrong size", 2, set.size()); + assertTrue("Should return true", set.retainAll(c)); + assertEquals("Wrong size", 0, set.size()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -751,28 +751,28 @@ public class EnumMapTest extends TestCase { Iterator iter = set.iterator(); Enum enumKey = (Enum) iter.next(); - assertTrue("Returned false for contained object", set.contains(enumKey)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(enumKey)); enumKey = (Enum) iter.next(); - assertTrue("Returned false for contained object", set.contains(enumKey)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(enumKey)); enumSizeMap.remove(Size.Big); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(enumKey)); iter.remove(); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(enumKey)); iter = set.iterator(); enumKey = (Enum) iter.next(); - assertTrue("Returned false for contained object", set.contains(enumKey)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(enumKey)); enumSizeMap.put(Size.Middle, 3); - assertTrue("Returned false for contained object", set.contains(enumKey)); //$NON-NLS-1$ + assertTrue("Returned false for contained object", set.contains(enumKey)); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); @@ -781,31 +781,31 @@ public class EnumMapTest extends TestCase { iter = set.iterator(); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } enumKey = (Enum) iter.next(); - assertEquals("Wrong key", Size.Middle, enumKey); //$NON-NLS-1$ - assertSame("Wrong key", Size.Middle, enumKey); //$NON-NLS-1$ - assertFalse("Returned true for unequal object", iter.equals(enumKey)); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Middle, enumKey); + assertSame("Wrong key", Size.Middle, enumKey); + assertFalse("Returned true for unequal object", iter.equals(enumKey)); iter.remove(); - assertFalse("Returned true for uncontained object", set //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", set .contains(enumKey)); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } - assertEquals("Wrong size", 1, set.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, set.size()); enumKey = (Enum) iter.next(); - assertEquals("Wrong key", Size.Big, enumKey); //$NON-NLS-1$ + assertEquals("Wrong key", Size.Big, enumKey); iter.remove(); try { iter.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // Expected } @@ -823,41 +823,41 @@ public class EnumMapTest extends TestCase { @SuppressWarnings({ "unchecked", "boxing" }) public void test_getLjava_lang_Object() { EnumMap enumSizeMap = new EnumMap(Size.class); - assertNull("Get returned non-null for non mapped key", enumSizeMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumSizeMap .get(Size.Big)); enumSizeMap.put(Size.Big, 1); - assertEquals("Get returned incorrect value for given key", 1, //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", 1, enumSizeMap.get(Size.Big)); - assertNull("Get returned non-null for non mapped key", enumSizeMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumSizeMap .get(Size.Small)); - assertNull("Get returned non-null for non existent key", enumSizeMap //$NON-NLS-1$ + assertNull("Get returned non-null for non existent key", enumSizeMap .get(Color.Red)); - assertNull("Get returned non-null for non existent key", enumSizeMap //$NON-NLS-1$ + assertNull("Get returned non-null for non existent key", enumSizeMap .get(new Integer(1))); - assertNull("Get returned non-null for non existent key", enumSizeMap //$NON-NLS-1$ + assertNull("Get returned non-null for non existent key", enumSizeMap .get(null)); EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); - assertNull("Get returned non-null for non mapped key", enumColorMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumColorMap .get(Color.Green)); enumColorMap.put(Color.Green, 2); - assertEquals("Get returned incorrect value for given key", 2, //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", 2, enumColorMap.get(Color.Green)); - assertNull("Get returned non-null for non mapped key", enumColorMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumColorMap .get(Color.Blue)); enumColorMap.put(Color.Green, new Double(4)); - assertEquals("Get returned incorrect value for given key", //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", new Double(4), enumColorMap.get(Color.Green)); - enumColorMap.put(Color.Green, new Integer("3"));//$NON-NLS-1$ - assertEquals("Get returned incorrect value for given key", new Integer( //$NON-NLS-1$ - "3"), enumColorMap.get(Color.Green));//$NON-NLS-1$ + enumColorMap.put(Color.Green, new Integer("3")); + assertEquals("Get returned incorrect value for given key", new Integer( + "3"), enumColorMap.get(Color.Green)); enumColorMap.put(Color.Green, null); - assertNull("Can not handle null value", enumColorMap.get(Color.Green)); //$NON-NLS-1$ - Float f = new Float("3.4");//$NON-NLS-1$ + assertNull("Can not handle null value", enumColorMap.get(Color.Green)); + Float f = new Float("3.4"); enumColorMap.put(Color.Green, f); - assertSame("Get returned incorrect value for given key", f, //$NON-NLS-1$ + assertSame("Get returned incorrect value for given key", f, enumColorMap.get(Color.Green)); } @@ -874,40 +874,40 @@ public class EnumMapTest extends TestCase { EnumMap enumSizeMap = new EnumMap(Size.class); try { enumSizeMap.put(Color.Red, 2); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } - assertNull("Return non-null for non mapped key", enumSizeMap.put( //$NON-NLS-1$ + assertNull("Return non-null for non mapped key", enumSizeMap.put( Size.Small, 1)); EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); try { enumColorMap.put(Size.Big, 2); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } try { enumColorMap.put(null, 2); - fail("Expected NullPointerException"); //$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } - assertNull("Return non-null for non mapped key", enumColorMap.put( //$NON-NLS-1$ + assertNull("Return non-null for non mapped key", enumColorMap.put( Color.Green, 2)); - assertEquals("Return wrong value", 2, enumColorMap.put(Color.Green, //$NON-NLS-1$ + assertEquals("Return wrong value", 2, enumColorMap.put(Color.Green, new Double(4))); - assertEquals("Return wrong value", new Double(4), enumColorMap.put( //$NON-NLS-1$ - Color.Green, new Integer("3")));//$NON-NLS-1$ - assertEquals("Return wrong value", new Integer("3"), enumColorMap.put( //$NON-NLS-1$//$NON-NLS-2$ + assertEquals("Return wrong value", new Double(4), enumColorMap.put( + Color.Green, new Integer("3"))); + assertEquals("Return wrong value", new Integer("3"), enumColorMap.put( Color.Green, null)); - Float f = new Float("3.4");//$NON-NLS-1$ - assertNull("Return non-null for non mapped key", enumColorMap.put( //$NON-NLS-1$ + Float f = new Float("3.4"); + assertNull("Return non-null for non mapped key", enumColorMap.put( Color.Green, f)); - assertNull("Return non-null for non mapped key", enumColorMap.put( //$NON-NLS-1$ + assertNull("Return non-null for non mapped key", enumColorMap.put( Color.Blue, 2)); - assertEquals("Return wrong value", 2, enumColorMap.put(Color.Blue, //$NON-NLS-1$ + assertEquals("Return wrong value", 2, enumColorMap.put(Color.Blue, new Double(4))); } @@ -931,7 +931,7 @@ public class EnumMapTest extends TestCase { enumSizeMap.put(Size.Big, 1); try { enumColorMap.putAll(enumSizeMap); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } @@ -939,16 +939,16 @@ public class EnumMapTest extends TestCase { EnumMap enumColorMap1 = new EnumMap<Color, Double>(Color.class); enumColorMap1.put(Color.Blue, 3); enumColorMap.putAll(enumColorMap1); - assertEquals("Get returned incorrect value for given key", 3, //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", 3, enumColorMap.get(Color.Blue)); - assertEquals("Wrong Size", 2, enumColorMap.size()); //$NON-NLS-1$ + assertEquals("Wrong Size", 2, enumColorMap.size()); enumColorMap = new EnumMap<Color, Double>(Color.class); HashMap hashColorMap = null; try { enumColorMap.putAll(hashColorMap); - fail("Expected NullPointerException"); //$NON-NLS-1$ + fail("Expected NullPointerException"); } catch (NullPointerException e) { // Expected } @@ -958,18 +958,18 @@ public class EnumMapTest extends TestCase { hashColorMap.put(Color.Green, 2); enumColorMap.putAll(hashColorMap); - assertEquals("Get returned incorrect value for given key", 2, //$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", 2, enumColorMap.get(Color.Green)); - assertNull("Get returned non-null for non mapped key", enumColorMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumColorMap .get(Color.Red)); hashColorMap.put(Color.Red, new Integer(1)); enumColorMap.putAll(hashColorMap); - assertEquals("Get returned incorrect value for given key", new Integer(//$NON-NLS-1$ + assertEquals("Get returned incorrect value for given key", new Integer( 2), enumColorMap.get(Color.Green)); hashColorMap.put(Size.Big, 3); try { enumColorMap.putAll(hashColorMap); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } @@ -978,7 +978,7 @@ public class EnumMapTest extends TestCase { hashColorMap.put(new Integer(1), 1); try { enumColorMap.putAll(hashColorMap); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } @@ -996,38 +996,38 @@ public class EnumMapTest extends TestCase { @SuppressWarnings({ "unchecked", "boxing" }) public void test_removeLjava_lang_Object() { EnumMap enumSizeMap = new EnumMap(Size.class); - assertNull("Remove of non-mapped key returned non-null", enumSizeMap //$NON-NLS-1$ + assertNull("Remove of non-mapped key returned non-null", enumSizeMap .remove(Size.Big)); enumSizeMap.put(Size.Big, 3); enumSizeMap.put(Size.Middle, 2); - assertNull("Get returned non-null for non mapped key", enumSizeMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumSizeMap .get(Size.Small)); - assertEquals("Remove returned incorrect value", 3, enumSizeMap //$NON-NLS-1$ + assertEquals("Remove returned incorrect value", 3, enumSizeMap .remove(Size.Big)); - assertNull("Get returned non-null for non mapped key", enumSizeMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumSizeMap .get(Size.Big)); - assertNull("Remove of non-mapped key returned non-null", enumSizeMap //$NON-NLS-1$ + assertNull("Remove of non-mapped key returned non-null", enumSizeMap .remove(Size.Big)); - assertNull("Remove of non-existent key returned non-null", enumSizeMap //$NON-NLS-1$ + assertNull("Remove of non-existent key returned non-null", enumSizeMap .remove(Color.Red)); - assertNull("Remove of non-existent key returned non-null", enumSizeMap //$NON-NLS-1$ + assertNull("Remove of non-existent key returned non-null", enumSizeMap .remove(new Double(4))); - assertNull("Remove of non-existent key returned non-null", enumSizeMap //$NON-NLS-1$ + assertNull("Remove of non-existent key returned non-null", enumSizeMap .remove(null)); EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); - assertNull("Get returned non-null for non mapped key", enumColorMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumColorMap .get(Color.Green)); enumColorMap.put(Color.Green, new Double(4)); - assertEquals("Remove returned incorrect value", new Double(4), //$NON-NLS-1$ + assertEquals("Remove returned incorrect value", new Double(4), enumColorMap.remove(Color.Green)); - assertNull("Get returned non-null for non mapped key", enumColorMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumColorMap .get(Color.Green)); enumColorMap.put(Color.Green, null); - assertNull("Can not handle null value", enumColorMap //$NON-NLS-1$ + assertNull("Can not handle null value", enumColorMap .remove(Color.Green)); - assertNull("Get returned non-null for non mapped key", enumColorMap //$NON-NLS-1$ + assertNull("Get returned non-null for non mapped key", enumColorMap .get(Color.Green)); } @@ -1043,36 +1043,36 @@ public class EnumMapTest extends TestCase { @SuppressWarnings({ "unchecked", "boxing" }) public void test_size() { EnumMap enumSizeMap = new EnumMap(Size.class); - assertEquals("Wrong size", 0, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, enumSizeMap.size()); enumSizeMap.put(Size.Small, 1); - assertEquals("Wrong size", 1, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, enumSizeMap.size()); enumSizeMap.put(Size.Small, 0); - assertEquals("Wrong size", 1, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, enumSizeMap.size()); try { enumSizeMap.put(Color.Red, 2); - fail("Expected ClassCastException"); //$NON-NLS-1$ + fail("Expected ClassCastException"); } catch (ClassCastException e) { // Expected } - assertEquals("Wrong size", 1, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, enumSizeMap.size()); enumSizeMap.put(Size.Middle, null); - assertEquals("Wrong size", 2, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 2, enumSizeMap.size()); enumSizeMap.remove(Size.Big); - assertEquals("Wrong size", 2, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 2, enumSizeMap.size()); enumSizeMap.remove(Size.Middle); - assertEquals("Wrong size", 1, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, enumSizeMap.size()); enumSizeMap.remove(Color.Green); - assertEquals("Wrong size", 1, enumSizeMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, enumSizeMap.size()); EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); enumColorMap.put(Color.Green, 2); - assertEquals("Wrong size", 1, enumColorMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, enumColorMap.size()); enumColorMap.remove(Color.Green); - assertEquals("Wrong size", 0, enumColorMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, enumColorMap.size()); EnumMap enumEmptyMap = new EnumMap<Empty, Double>(Empty.class); - assertEquals("Wrong size", 0, enumEmptyMap.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, enumEmptyMap.size()); } /** @@ -1092,40 +1092,40 @@ public class EnumMapTest extends TestCase { Collection collection = enumColorMap.values(); Collection collection1 = enumColorMap.values(); - assertSame("Should be same", collection1, collection); //$NON-NLS-1$ + assertSame("Should be same", collection1, collection); try { collection.add(new Integer(1)); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // Expected } - assertTrue("Returned false for contained object", collection//$NON-NLS-1$ + assertTrue("Returned false for contained object", collection .contains(1)); - assertTrue("Returned false for contained object", collection//$NON-NLS-1$ + assertTrue("Returned false for contained object", collection .contains(null)); - assertFalse("Returned true for uncontained object", collection //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", collection .contains(2)); - assertTrue("Returned false when the object can be removed", collection //$NON-NLS-1$ + assertTrue("Returned false when the object can be removed", collection .remove(null)); - assertFalse("Returned true for uncontained object", collection //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", collection .contains(null)); - assertFalse("Returned true when the object can not be removed", //$NON-NLS-1$ + assertFalse("Returned true when the object can not be removed", collection.remove(null)); // The set is backed by the map so changes to one are reflected by the // other. enumColorMap.put(Color.Blue, 3); - assertTrue("Returned false for contained object", collection//$NON-NLS-1$ + assertTrue("Returned false for contained object", collection .contains(3)); enumColorMap.remove(Color.Blue); - assertFalse("Returned true for uncontained object", collection//$NON-NLS-1$ + assertFalse("Returned true for uncontained object", collection .contains(3)); - assertEquals("Wrong size", 1, collection.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, collection.size()); collection.clear(); - assertEquals("Wrong size", 0, collection.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, collection.size()); enumColorMap = new EnumMap<Color, Double>(Color.class); enumColorMap.put(Color.Red, 1); @@ -1133,73 +1133,73 @@ public class EnumMapTest extends TestCase { collection = enumColorMap.values(); Collection c = new ArrayList(); c.add(new Integer(1)); - assertTrue("Should return true", collection.containsAll(c)); //$NON-NLS-1$ + assertTrue("Should return true", collection.containsAll(c)); c.add(new Double(3.4)); - assertFalse("Should return false", collection.containsAll(c)); //$NON-NLS-1$ - assertTrue("Should return true", collection.removeAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, collection.size()); //$NON-NLS-1$ - assertFalse("Should return false", collection.removeAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, collection.size()); //$NON-NLS-1$ + assertFalse("Should return false", collection.containsAll(c)); + assertTrue("Should return true", collection.removeAll(c)); + assertEquals("Wrong size", 1, collection.size()); + assertFalse("Should return false", collection.removeAll(c)); + assertEquals("Wrong size", 1, collection.size()); try { collection.addAll(c); - fail("Should throw UnsupportedOperationException"); //$NON-NLS-1$ + fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // Expected } enumColorMap.put(Color.Red, 1); - assertEquals("Wrong size", 2, collection.size()); //$NON-NLS-1$ - assertTrue("Should return true", collection.retainAll(c)); //$NON-NLS-1$ - assertEquals("Wrong size", 1, collection.size()); //$NON-NLS-1$ - assertFalse("Should return false", collection.retainAll(c)); //$NON-NLS-1$ + assertEquals("Wrong size", 2, collection.size()); + assertTrue("Should return true", collection.retainAll(c)); + assertEquals("Wrong size", 1, collection.size()); + assertFalse("Should return false", collection.retainAll(c)); assertEquals(1, collection.size()); Object[] array = collection.toArray(); - assertEquals("Wrong length", 1, array.length); //$NON-NLS-1$ - assertEquals("Wrong key", 1, array[0]); //$NON-NLS-1$ + assertEquals("Wrong length", 1, array.length); + assertEquals("Wrong key", 1, array[0]); enumColorMap = new EnumMap<Color, Double>(Color.class); enumColorMap.put(Color.Red, 1); enumColorMap.put(Color.Blue, null); collection = enumColorMap.values(); - assertEquals("Wrong size", 2, collection.size()); //$NON-NLS-1$ - assertFalse("Returned true when the object can not be removed", //$NON-NLS-1$ - collection.remove(new Integer("10"))); //$NON-NLS-1$ + assertEquals("Wrong size", 2, collection.size()); + assertFalse("Returned true when the object can not be removed", + collection.remove(new Integer("10"))); Iterator iter = enumColorMap.values().iterator(); Object value = iter.next(); - assertTrue("Returned false for contained object", collection //$NON-NLS-1$ + assertTrue("Returned false for contained object", collection .contains(value)); value = iter.next(); - assertTrue("Returned false for contained object", collection //$NON-NLS-1$ + assertTrue("Returned false for contained object", collection .contains(value)); enumColorMap.put(Color.Green, 1); enumColorMap.remove(Color.Blue); - assertFalse("Returned true for uncontained object", collection //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", collection .contains(value)); iter.remove(); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } - assertFalse("Returned true for uncontained object", collection //$NON-NLS-1$ + assertFalse("Returned true for uncontained object", collection .contains(value)); iter = enumColorMap.values().iterator(); value = iter.next(); - assertTrue("Returned false for contained object", collection //$NON-NLS-1$ + assertTrue("Returned false for contained object", collection .contains(value)); enumColorMap.put(Color.Green, 3); - assertTrue("Returned false for contained object", collection //$NON-NLS-1$ + assertTrue("Returned false for contained object", collection .contains(value)); - assertTrue("Returned false for contained object", collection //$NON-NLS-1$ - .remove(new Integer("1"))); //$NON-NLS-1$ - assertEquals("Wrong size", 1, collection.size()); //$NON-NLS-1$ + assertTrue("Returned false for contained object", collection + .remove(new Integer("1"))); + assertEquals("Wrong size", 1, collection.size()); collection.clear(); - assertEquals("Wrong size", 0, collection.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 0, collection.size()); enumColorMap = new EnumMap<Color, Double>(Color.class); Integer integer1 = new Integer(1); @@ -1209,29 +1209,29 @@ public class EnumMapTest extends TestCase { iter = enumColorMap.values().iterator(); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } value = iter.next(); - assertEquals("Wrong value", integer1, value); //$NON-NLS-1$ - assertSame("Wrong value", integer1, value); //$NON-NLS-1$ - assertFalse("Returned true for unequal object", iter.equals(value)); //$NON-NLS-1$ + assertEquals("Wrong value", integer1, value); + assertSame("Wrong value", integer1, value); + assertFalse("Returned true for unequal object", iter.equals(value)); iter.remove(); - assertFalse("Returned true for unequal object", iter.equals(value)); //$NON-NLS-1$ + assertFalse("Returned true for unequal object", iter.equals(value)); try { iter.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // Expected } - assertEquals("Wrong size", 1, collection.size()); //$NON-NLS-1$ + assertEquals("Wrong size", 1, collection.size()); value = iter.next(); - assertFalse("Returned true for unequal object", iter.equals(value)); //$NON-NLS-1$ + assertFalse("Returned true for unequal object", iter.equals(value)); iter.remove(); try { iter.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // Expected } diff --git a/luni/src/test/java/tests/api/java/util/EnumSetTest.java b/luni/src/test/java/tests/api/java/util/EnumSetTest.java index 846c939..133eadb 100644 --- a/luni/src/test/java/tests/api/java/util/EnumSetTest.java +++ b/luni/src/test/java/tests/api/java/util/EnumSetTest.java @@ -85,14 +85,14 @@ public class EnumSetTest extends TestCase { public void test_NoneOf_LClass() { try { EnumSet.noneOf((Class) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.noneOf(Enum.class); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException cce) { // expected } @@ -101,7 +101,7 @@ public class EnumSetTest extends TestCase { .getClass(); try { EnumSet.noneOf(c); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -115,7 +115,7 @@ public class EnumSetTest extends TestCase { .getClass(); try { EnumSet.noneOf(hc); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -181,34 +181,34 @@ public class EnumSetTest extends TestCase { public void test_AllOf_LClass() { try { EnumSet.allOf((Class) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.allOf(Enum.class); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException cce) { // expected } EnumSet<EnumFoo> enumSet = EnumSet.allOf(EnumFoo.class); - assertEquals("Size of enumSet should be 64", 64, enumSet.size()); //$NON-NLS-1$ + assertEquals("Size of enumSet should be 64", 64, enumSet.size()); assertFalse( - "enumSet should not contain null value", enumSet.contains(null)); //$NON-NLS-1$ + "enumSet should not contain null value", enumSet.contains(null)); assertTrue( - "enumSet should contain EnumFoo.a", enumSet.contains(EnumFoo.a)); //$NON-NLS-1$ + "enumSet should contain EnumFoo.a", enumSet.contains(EnumFoo.a)); assertTrue( - "enumSet should contain EnumFoo.b", enumSet.contains(EnumFoo.b)); //$NON-NLS-1$ + "enumSet should contain EnumFoo.b", enumSet.contains(EnumFoo.b)); enumSet.add(EnumFoo.a); - assertEquals("Should be equal", 64, enumSet.size()); //$NON-NLS-1$ + assertEquals("Should be equal", 64, enumSet.size()); EnumSet<EnumFoo> anotherSet = EnumSet.allOf(EnumFoo.class); - assertEquals("Should be equal", enumSet, anotherSet); //$NON-NLS-1$ - assertNotSame("Should not be identical", enumSet, anotherSet); //$NON-NLS-1$ + assertEquals("Should be equal", enumSet, anotherSet); + assertNotSame("Should not be identical", enumSet, anotherSet); // test enum with more than 64 elements EnumSet<HugeEnum> hugeEnumSet = EnumSet.allOf(HugeEnum.class); @@ -244,7 +244,7 @@ public class EnumSetTest extends TestCase { try { set.add(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -253,7 +253,7 @@ public class EnumSetTest extends TestCase { Set rawSet = set; try { rawSet.add(HugeEnumWithInnerClass.b); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -261,40 +261,40 @@ public class EnumSetTest extends TestCase { set.clear(); try { set.add(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } boolean result = set.add(EnumFoo.a); - assertEquals("Size should be 1:", 1, set.size()); //$NON-NLS-1$ - assertTrue("Return value should be true", result); //$NON-NLS-1$ + assertEquals("Size should be 1:", 1, set.size()); + assertTrue("Return value should be true", result); result = set.add(EnumFoo.a); - assertEquals("Size should be 1:", 1, set.size()); //$NON-NLS-1$ - assertFalse("Return value should be false", result); //$NON-NLS-1$ + assertEquals("Size should be 1:", 1, set.size()); + assertFalse("Return value should be false", result); set.add(EnumFoo.b); - assertEquals("Size should be 2:", 2, set.size()); //$NON-NLS-1$ + assertEquals("Size should be 2:", 2, set.size()); rawSet = set; try { rawSet.add(EnumWithAllInnerClass.a); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch(ClassCastException e) { // expected } try { rawSet.add(EnumWithInnerClass.a); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch(ClassCastException e) { // expected } try { rawSet.add(new Object()); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch(ClassCastException e) { // expected } @@ -309,7 +309,7 @@ public class EnumSetTest extends TestCase { try { hugeSet.add(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -317,14 +317,14 @@ public class EnumSetTest extends TestCase { rawSet = hugeSet; try { rawSet.add(HugeEnumWithInnerClass.b); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } try { rawSet.add(new Object()); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -350,11 +350,11 @@ public class EnumSetTest extends TestCase { public void test_addAll_LCollection() { Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class); - assertEquals("Size should be 0:", 0, set.size()); //$NON-NLS-1$ + assertEquals("Size should be 0:", 0, set.size()); try { set.addAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -371,8 +371,8 @@ public class EnumSetTest extends TestCase { collection.add(EnumFoo.a); collection.add(EnumFoo.b); result = set.addAll(collection); - assertTrue("addAll should be successful", result); //$NON-NLS-1$ - assertEquals("Size should be 2:", 2, set.size()); //$NON-NLS-1$ + assertTrue("addAll should be successful", result); + assertEquals("Size should be 2:", 2, set.size()); set = EnumSet.noneOf(EnumFoo.class); @@ -382,7 +382,7 @@ public class EnumSetTest extends TestCase { rawCollection.add(1); try { set.addAll(rawCollection); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -391,12 +391,12 @@ public class EnumSetTest extends TestCase { fullSet.add(EnumFoo.a); fullSet.add(EnumFoo.b); result = set.addAll(fullSet); - assertTrue("addAll should be successful", result); //$NON-NLS-1$ - assertEquals("Size of set should be 2", 2, set.size()); //$NON-NLS-1$ + assertTrue("addAll should be successful", result); + assertEquals("Size of set should be 2", 2, set.size()); try { fullSet.addAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -408,13 +408,13 @@ public class EnumSetTest extends TestCase { } try { set.addAll(fullSetWithSubclass); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } Set<EnumWithInnerClass> setWithSubclass = fullSetWithSubclass; result = setWithSubclass.addAll(setWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set<EnumWithInnerClass> anotherSetWithSubclass = EnumSet .noneOf(EnumWithInnerClass.class); @@ -423,11 +423,11 @@ public class EnumSetTest extends TestCase { anotherSetWithSubclass.add((EnumWithInnerClass) elements[i]); } result = setWithSubclass.addAll(anotherSetWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); anotherSetWithSubclass.remove(EnumWithInnerClass.a); result = setWithSubclass.addAll(anotherSetWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.noneOf(HugeEnum.class); @@ -435,7 +435,7 @@ public class EnumSetTest extends TestCase { try { hugeSet.addAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -460,7 +460,7 @@ public class EnumSetTest extends TestCase { rawCollection.add(1); try { hugeSet.addAll(rawCollection); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -474,7 +474,7 @@ public class EnumSetTest extends TestCase { try { aHugeSet.addAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -482,7 +482,7 @@ public class EnumSetTest extends TestCase { Set hugeSetWithSubclass = EnumSet.allOf(HugeEnumWithInnerClass.class); try { hugeSet.addAll(hugeSetWithSubclass); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -518,37 +518,37 @@ public class EnumSetTest extends TestCase { } boolean result = set.remove(null); - assertFalse("'set' does not contain null", result); //$NON-NLS-1$ + assertFalse("'set' does not contain null", result); result = set.remove(EnumFoo.a); - assertTrue("Should return true", result); //$NON-NLS-1$ + assertTrue("Should return true", result); result = set.remove(EnumFoo.a); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); - assertEquals("Size of set should be 63:", 63, set.size()); //$NON-NLS-1$ + assertEquals("Size of set should be 63:", 63, set.size()); result = set.remove(EnumWithInnerClass.a); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); result = set.remove(EnumWithInnerClass.f); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); // test enum with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.allOf(HugeEnum.class); result = hugeSet.remove(null); - assertFalse("'set' does not contain null", result); //$NON-NLS-1$ + assertFalse("'set' does not contain null", result); result = hugeSet.remove(HugeEnum.a); - assertTrue("Should return true", result); //$NON-NLS-1$ + assertTrue("Should return true", result); result = hugeSet.remove(HugeEnum.a); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); - assertEquals("Size of set should be 64:", 64, hugeSet.size()); //$NON-NLS-1$ + assertEquals("Size of set should be 64:", 64, hugeSet.size()); result = hugeSet.remove(HugeEnumWithInnerClass.a); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); result = hugeSet.remove(HugeEnumWithInnerClass.f); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); } /** @@ -567,20 +567,20 @@ public class EnumSetTest extends TestCase { set.add((EnumFoo) elements[i]); } - assertFalse("Should return false", set.equals(null)); //$NON-NLS-1$ + assertFalse("Should return false", set.equals(null)); assertFalse( - "Should return false", set.equals(new Object())); //$NON-NLS-1$ + "Should return false", set.equals(new Object())); Set<EnumFoo> anotherSet = EnumSet.noneOf(EnumFoo.class); elements = EnumFoo.class.getEnumConstants(); for(int i = 0; i < elements.length; i++) { anotherSet.add((EnumFoo) elements[i]); } - assertTrue("Should return true", set.equals(anotherSet)); //$NON-NLS-1$ + assertTrue("Should return true", set.equals(anotherSet)); anotherSet.remove(EnumFoo.a); assertFalse( - "Should return false", set.equals(anotherSet)); //$NON-NLS-1$ + "Should return false", set.equals(anotherSet)); Set<EnumWithInnerClass> setWithInnerClass = EnumSet .noneOf(EnumWithInnerClass.class); @@ -590,11 +590,11 @@ public class EnumSetTest extends TestCase { } assertFalse( - "Should return false", set.equals(setWithInnerClass)); //$NON-NLS-1$ + "Should return false", set.equals(setWithInnerClass)); setWithInnerClass.clear(); set.clear(); - assertTrue("Should be equal", set.equals(setWithInnerClass)); //$NON-NLS-1$ + assertTrue("Should be equal", set.equals(setWithInnerClass)); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.noneOf(HugeEnum.class); @@ -629,11 +629,11 @@ public class EnumSetTest extends TestCase { Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class); set.add(EnumFoo.a); set.add(EnumFoo.b); - assertEquals("Size should be 2", 2, set.size()); //$NON-NLS-1$ + assertEquals("Size should be 2", 2, set.size()); set.clear(); - assertEquals("Size should be 0", 0, set.size()); //$NON-NLS-1$ + assertEquals("Size should be 0", 0, set.size()); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.allOf(HugeEnum.class); @@ -661,13 +661,13 @@ public class EnumSetTest extends TestCase { Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class); set.add(EnumFoo.a); set.add(EnumFoo.b); - assertEquals("Size should be 2", 2, set.size()); //$NON-NLS-1$ + assertEquals("Size should be 2", 2, set.size()); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.noneOf(HugeEnum.class); hugeSet.add(HugeEnum.a); hugeSet.add(HugeEnum.bb); - assertEquals("Size should be 2", 2, hugeSet.size()); //$NON-NLS-1$ + assertEquals("Size should be 2", 2, hugeSet.size()); } /** @@ -683,7 +683,7 @@ public class EnumSetTest extends TestCase { try { EnumSet.complementOf((EnumSet<EnumFoo>) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -694,17 +694,17 @@ public class EnumSetTest extends TestCase { set.add(EnumWithInnerClass.e); set.add(EnumWithInnerClass.f); - assertEquals("Size should be 3:", 3, set.size()); //$NON-NLS-1$ + assertEquals("Size should be 3:", 3, set.size()); EnumSet<EnumWithInnerClass> complementOfE = EnumSet.complementOf(set); assertTrue(set.contains(EnumWithInnerClass.d)); assertEquals( - "complementOfE should have size 3", 3, complementOfE.size()); //$NON-NLS-1$ - assertTrue("complementOfE should contain EnumWithSubclass.a:", //$NON-NLS-1$ + "complementOfE should have size 3", 3, complementOfE.size()); + assertTrue("complementOfE should contain EnumWithSubclass.a:", complementOfE.contains(EnumWithInnerClass.a)); - assertTrue("complementOfE should contain EnumWithSubclass.b:", //$NON-NLS-1$ + assertTrue("complementOfE should contain EnumWithSubclass.b:", complementOfE.contains(EnumWithInnerClass.b)); - assertTrue("complementOfE should contain EnumWithSubclass.c:", //$NON-NLS-1$ + assertTrue("complementOfE should contain EnumWithSubclass.c:", complementOfE.contains(EnumWithInnerClass.c)); // test enum type with more than 64 elements @@ -720,7 +720,7 @@ public class EnumSetTest extends TestCase { try { EnumSet.complementOf((EnumSet<HugeEnum>) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -742,29 +742,29 @@ public class EnumSetTest extends TestCase { set.add((EnumFoo)elements[i]); } boolean result = set.contains(null); - assertFalse("Should not contain null:", result); //$NON-NLS-1$ + assertFalse("Should not contain null:", result); result = set.contains(EnumFoo.a); - assertTrue("Should contain EnumFoo.a", result); //$NON-NLS-1$ + assertTrue("Should contain EnumFoo.a", result); result = set.contains(EnumFoo.ll); - assertTrue("Should contain EnumFoo.ll", result); //$NON-NLS-1$ + assertTrue("Should contain EnumFoo.ll", result); result = set.contains(EnumFoo.b); - assertTrue("Should contain EnumFoo.b", result); //$NON-NLS-1$ + assertTrue("Should contain EnumFoo.b", result); result = set.contains(new Object()); - assertFalse("Should not contain Object instance", result); //$NON-NLS-1$ + assertFalse("Should not contain Object instance", result); result = set.contains(EnumWithInnerClass.a); - assertFalse("Should not contain EnumWithSubclass.a", result); //$NON-NLS-1$ + assertFalse("Should not contain EnumWithSubclass.a", result); set = EnumSet.noneOf(EnumFoo.class); set.add(EnumFoo.aa); set.add(EnumFoo.bb); set.add(EnumFoo.cc); - assertEquals("Size of set should be 3", 3, set.size()); //$NON-NLS-1$ - assertTrue("set should contain EnumFoo.aa", set.contains(EnumFoo.aa)); //$NON-NLS-1$ + assertEquals("Size of set should be 3", 3, set.size()); + assertTrue("set should contain EnumFoo.aa", set.contains(EnumFoo.aa)); Set<EnumWithInnerClass> setWithSubclass = EnumSet .noneOf(EnumWithInnerClass.class); @@ -775,7 +775,7 @@ public class EnumSetTest extends TestCase { setWithSubclass.add(EnumWithInnerClass.e); setWithSubclass.add(EnumWithInnerClass.f); result = setWithSubclass.contains(EnumWithInnerClass.f); - assertTrue("Should contain EnumWithSubclass.f", result); //$NON-NLS-1$ + assertTrue("Should contain EnumWithSubclass.f", result); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.allOf(HugeEnum.class); @@ -821,7 +821,7 @@ public class EnumSetTest extends TestCase { } try { set.containsAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -832,42 +832,42 @@ public class EnumSetTest extends TestCase { emptySet.add((EmptyEnum)elements[i]); } boolean result = set.containsAll(emptySet); - assertTrue("Should return true", result); //$NON-NLS-1$ + assertTrue("Should return true", result); Collection rawCollection = new ArrayList(); result = set.containsAll(rawCollection); - assertTrue("Should contain empty collection:", result); //$NON-NLS-1$ + assertTrue("Should contain empty collection:", result); rawCollection.add(1); result = set.containsAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); rawCollection.add(EnumWithInnerClass.a); result = set.containsAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); EnumSet rawSet = EnumSet.noneOf(EnumFoo.class); result = set.containsAll(rawSet); - assertTrue("Should contain empty set", result); //$NON-NLS-1$ + assertTrue("Should contain empty set", result); emptySet = EnumSet.noneOf(EmptyEnum.class); result = set.containsAll(emptySet); - assertTrue("No class cast should be performed on empty set", result); //$NON-NLS-1$ + assertTrue("No class cast should be performed on empty set", result); Collection<EnumFoo> collection = new ArrayList<EnumFoo>(); collection.add(EnumFoo.a); result = set.containsAll(collection); - assertTrue("Should contain all elements in collection", result); //$NON-NLS-1$ + assertTrue("Should contain all elements in collection", result); EnumSet<EnumFoo> fooSet = EnumSet.noneOf(EnumFoo.class); fooSet.add(EnumFoo.a); result = set.containsAll(fooSet); - assertTrue("Should return true", result); //$NON-NLS-1$ + assertTrue("Should return true", result); set.clear(); try { set.containsAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -875,13 +875,13 @@ public class EnumSetTest extends TestCase { Collection<EnumWithInnerClass> collectionWithSubclass = new ArrayList<EnumWithInnerClass>(); collectionWithSubclass.add(EnumWithInnerClass.a); result = set.containsAll(collectionWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); EnumSet<EnumWithInnerClass> setWithSubclass = EnumSet .noneOf(EnumWithInnerClass.class); setWithSubclass.add(EnumWithInnerClass.a); result = set.containsAll(setWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.noneOf(HugeEnum.class); @@ -900,7 +900,7 @@ public class EnumSetTest extends TestCase { try { hugeSet.containsAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch(NullPointerException e) { // expected } @@ -916,34 +916,34 @@ public class EnumSetTest extends TestCase { rawCollection = new ArrayList(); result = hugeSet.containsAll(rawCollection); - assertTrue("Should contain empty collection:", result); //$NON-NLS-1$ + assertTrue("Should contain empty collection:", result); rawCollection.add(1); result = hugeSet.containsAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); rawCollection.add(EnumWithInnerClass.a); result = set.containsAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); rawSet = EnumSet.noneOf(HugeEnum.class); result = hugeSet.containsAll(rawSet); - assertTrue("Should contain empty set", result); //$NON-NLS-1$ + assertTrue("Should contain empty set", result); EnumSet<HugeEnumWithInnerClass> emptyHugeSet = EnumSet.noneOf(HugeEnumWithInnerClass.class); result = hugeSet.containsAll(emptyHugeSet); - assertTrue("No class cast should be performed on empty set", result); //$NON-NLS-1$ + assertTrue("No class cast should be performed on empty set", result); Collection<HugeEnum> hugeCollection = new ArrayList<HugeEnum>(); hugeCollection.add(HugeEnum.a); result = hugeSet.containsAll(hugeCollection); - assertTrue("Should contain all elements in collection", result); //$NON-NLS-1$ + assertTrue("Should contain all elements in collection", result); hugeSet.clear(); try { hugeSet.containsAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -951,13 +951,13 @@ public class EnumSetTest extends TestCase { Collection<HugeEnumWithInnerClass> hugeCollectionWithSubclass = new ArrayList<HugeEnumWithInnerClass>(); hugeCollectionWithSubclass.add(HugeEnumWithInnerClass.a); result = hugeSet.containsAll(hugeCollectionWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); EnumSet<HugeEnumWithInnerClass> hugeSetWithSubclass = EnumSet .noneOf(HugeEnumWithInnerClass.class); hugeSetWithSubclass.add(HugeEnumWithInnerClass.a); result = hugeSet.containsAll(hugeSetWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); } /** @@ -973,7 +973,7 @@ public class EnumSetTest extends TestCase { public void test_CopyOf_LCollection() { try { EnumSet.copyOf((Collection) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -981,7 +981,7 @@ public class EnumSetTest extends TestCase { Collection collection = new ArrayList(); try { EnumSet.copyOf(collection); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } @@ -989,7 +989,7 @@ public class EnumSetTest extends TestCase { collection.add(new Object()); try { EnumSet.copyOf(collection); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch (ClassCastException e) { // expected } @@ -998,18 +998,18 @@ public class EnumSetTest extends TestCase { enumCollection.add(EnumFoo.b); EnumSet<EnumFoo> copyOfEnumCollection = EnumSet.copyOf(enumCollection); - assertEquals("Size of copyOfEnumCollection should be 1:", //$NON-NLS-1$ + assertEquals("Size of copyOfEnumCollection should be 1:", 1, copyOfEnumCollection.size()); - assertTrue("copyOfEnumCollection should contain EnumFoo.b:", //$NON-NLS-1$ + assertTrue("copyOfEnumCollection should contain EnumFoo.b:", copyOfEnumCollection.contains(EnumFoo.b)); enumCollection.add(null); - assertEquals("Size of enumCollection should be 2:", //$NON-NLS-1$ + assertEquals("Size of enumCollection should be 2:", 2, enumCollection.size()); try { copyOfEnumCollection = EnumSet.copyOf(enumCollection); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1019,7 +1019,7 @@ public class EnumSetTest extends TestCase { rawEnumCollection.add(EnumWithInnerClass.a); try { EnumSet.copyOf(rawEnumCollection); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch(ClassCastException e) { // expected } @@ -1037,7 +1037,7 @@ public class EnumSetTest extends TestCase { try { copyOfHugeEnumCollection = EnumSet.copyOf(hugeEnumCollection); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1047,7 +1047,7 @@ public class EnumSetTest extends TestCase { rawEnumCollection.add(HugeEnumWithInnerClass.a); try { EnumSet.copyOf(rawEnumCollection); - fail("Should throw ClassCastException"); //$NON-NLS-1$ + fail("Should throw ClassCastException"); } catch(ClassCastException e) { // expected } @@ -1069,23 +1069,23 @@ public class EnumSetTest extends TestCase { enumSet.add(EnumWithInnerClass.a); enumSet.add(EnumWithInnerClass.f); EnumSet<EnumWithInnerClass> copyOfE = EnumSet.copyOf(enumSet); - assertEquals("Size of enumSet and copyOfE should be equal", //$NON-NLS-1$ + assertEquals("Size of enumSet and copyOfE should be equal", enumSet.size(), copyOfE.size()); - assertTrue("EnumWithSubclass.a should be contained in copyOfE", //$NON-NLS-1$ + assertTrue("EnumWithSubclass.a should be contained in copyOfE", copyOfE.contains(EnumWithInnerClass.a)); - assertTrue("EnumWithSubclass.f should be contained in copyOfE", //$NON-NLS-1$ + assertTrue("EnumWithSubclass.f should be contained in copyOfE", copyOfE.contains(EnumWithInnerClass.f)); Object[] enumValue = copyOfE.toArray(); - assertSame("enumValue[0] should be identical with EnumWithSubclass.a", //$NON-NLS-1$ + assertSame("enumValue[0] should be identical with EnumWithSubclass.a", enumValue[0], EnumWithInnerClass.a); - assertSame("enumValue[1] should be identical with EnumWithSubclass.f", //$NON-NLS-1$ + assertSame("enumValue[1] should be identical with EnumWithSubclass.f", enumValue[1], EnumWithInnerClass.f); try { EnumSet.copyOf((EnumSet) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1120,17 +1120,17 @@ public class EnumSetTest extends TestCase { Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class); try { set.removeAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } set = EnumSet.allOf(EnumFoo.class); - assertEquals("Size of set should be 64:", 64, set.size()); //$NON-NLS-1$ + assertEquals("Size of set should be 64:", 64, set.size()); try { set.removeAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -1139,41 +1139,41 @@ public class EnumSetTest extends TestCase { collection.add(EnumFoo.a); boolean result = set.removeAll(collection); - assertTrue("Should return true", result); //$NON-NLS-1$ - assertEquals("Size of set should be 63", 63, set.size()); //$NON-NLS-1$ + assertTrue("Should return true", result); + assertEquals("Size of set should be 63", 63, set.size()); collection = new ArrayList(); result = set.removeAll(collection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set<EmptyEnum> emptySet = EnumSet.noneOf(EmptyEnum.class); result = set.removeAll(emptySet); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); EnumSet<EnumFoo> emptyFooSet = EnumSet.noneOf(EnumFoo.class); result = set.removeAll(emptyFooSet); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); emptyFooSet.add(EnumFoo.a); result = set.removeAll(emptyFooSet); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set<EnumWithInnerClass> setWithSubclass = EnumSet .noneOf(EnumWithInnerClass.class); result = set.removeAll(setWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); setWithSubclass.add(EnumWithInnerClass.a); result = set.removeAll(setWithSubclass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set<EnumFoo> anotherSet = EnumSet.noneOf(EnumFoo.class); anotherSet.add(EnumFoo.a); set = EnumSet.allOf(EnumFoo.class); result = set.removeAll(anotherSet); - assertTrue("Should return true", result); //$NON-NLS-1$ - assertEquals("Size of set should be 63:", 63, set.size()); //$NON-NLS-1$ + assertTrue("Should return true", result); + assertEquals("Size of set should be 63:", 63, set.size()); Set<EnumWithInnerClass> setWithInnerClass = EnumSet .noneOf(EnumWithInnerClass.class); @@ -1185,33 +1185,33 @@ public class EnumSetTest extends TestCase { anotherSetWithInnerClass.add(EnumWithInnerClass.c); anotherSetWithInnerClass.add(EnumWithInnerClass.d); result = anotherSetWithInnerClass.removeAll(setWithInnerClass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); anotherSetWithInnerClass.add(EnumWithInnerClass.a); result = anotherSetWithInnerClass.removeAll(setWithInnerClass); - assertTrue("Should return true", result); //$NON-NLS-1$ - assertEquals("Size of anotherSetWithInnerClass should remain 2", //$NON-NLS-1$ + assertTrue("Should return true", result); + assertEquals("Size of anotherSetWithInnerClass should remain 2", 2, anotherSetWithInnerClass.size()); anotherSetWithInnerClass.remove(EnumWithInnerClass.c); anotherSetWithInnerClass.remove(EnumWithInnerClass.d); result = anotherSetWithInnerClass.remove(setWithInnerClass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set rawSet = EnumSet.allOf(EnumWithAllInnerClass.class); result = rawSet.removeAll(EnumSet.allOf(EnumFoo.class)); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); setWithInnerClass = EnumSet.allOf(EnumWithInnerClass.class); anotherSetWithInnerClass = EnumSet.allOf(EnumWithInnerClass.class); setWithInnerClass.remove(EnumWithInnerClass.a); anotherSetWithInnerClass.remove(EnumWithInnerClass.f); result = setWithInnerClass.removeAll(anotherSetWithInnerClass); - assertTrue("Should return true", result); //$NON-NLS-1$ - assertEquals("Size of setWithInnerClass should be 1", 1, setWithInnerClass.size()); //$NON-NLS-1$ + assertTrue("Should return true", result); + assertEquals("Size of setWithInnerClass should be 1", 1, setWithInnerClass.size()); result = setWithInnerClass.contains(EnumWithInnerClass.f); - assertTrue("Should return true", result); //$NON-NLS-1$ + assertTrue("Should return true", result); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.allOf(HugeEnum.class); @@ -1258,7 +1258,7 @@ public class EnumSetTest extends TestCase { anotherHugeSetWithInnerClass.add(HugeEnumWithInnerClass.c); anotherHugeSetWithInnerClass.add(HugeEnumWithInnerClass.d); result = anotherHugeSetWithInnerClass.removeAll(setWithInnerClass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); anotherHugeSetWithInnerClass.add(HugeEnumWithInnerClass.a); result = anotherHugeSetWithInnerClass.removeAll(hugeSetWithInnerClass); @@ -1301,60 +1301,60 @@ public class EnumSetTest extends TestCase { try { set.retainAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } set.clear(); boolean result = set.retainAll(null); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Collection rawCollection = new ArrayList(); result = set.retainAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); rawCollection.add(EnumFoo.a); result = set.retainAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); rawCollection.add(EnumWithInnerClass.a); result = set.retainAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ - assertEquals("Size of set should be 0:", 0, set.size()); //$NON-NLS-1$ + assertFalse("Should return false", result); + assertEquals("Size of set should be 0:", 0, set.size()); rawCollection.remove(EnumFoo.a); result = set.retainAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set<EnumFoo> anotherSet = EnumSet.allOf(EnumFoo.class); result = set.retainAll(anotherSet); - assertFalse("Should return false", result); //$NON-NLS-1$ - assertEquals("Size of set should be 0", 0, set.size()); //$NON-NLS-1$ + assertFalse("Should return false", result); + assertEquals("Size of set should be 0", 0, set.size()); Set<EnumWithInnerClass> setWithInnerClass = EnumSet .allOf(EnumWithInnerClass.class); result = set.retainAll(setWithInnerClass); - assertFalse("Should return false", result); //$NON-NLS-1$ - assertEquals("Size of set should be 0", 0, set.size()); //$NON-NLS-1$ + assertFalse("Should return false", result); + assertEquals("Size of set should be 0", 0, set.size()); setWithInnerClass = EnumSet.noneOf(EnumWithInnerClass.class); result = set.retainAll(setWithInnerClass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set<EmptyEnum> emptySet = EnumSet.allOf(EmptyEnum.class); result = set.retainAll(emptySet); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); Set<EnumWithAllInnerClass> setWithAllInnerClass = EnumSet .allOf(EnumWithAllInnerClass.class); result = set.retainAll(setWithAllInnerClass); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); set.add(EnumFoo.a); result = set.retainAll(setWithInnerClass); - assertTrue("Should return true", result); //$NON-NLS-1$ - assertEquals("Size of set should be 0", 0, set.size()); //$NON-NLS-1$ + assertTrue("Should return true", result); + assertEquals("Size of set should be 0", 0, set.size()); setWithInnerClass = EnumSet.allOf(EnumWithInnerClass.class); setWithInnerClass.remove(EnumWithInnerClass.f); @@ -1364,38 +1364,38 @@ public class EnumSetTest extends TestCase { anotherSetWithInnerClass.add(EnumWithInnerClass.f); result = setWithInnerClass.retainAll(anotherSetWithInnerClass); - assertTrue("Should return true", result); //$NON-NLS-1$ + assertTrue("Should return true", result); result = setWithInnerClass.contains(EnumWithInnerClass.e); - assertTrue("Should contain EnumWithInnerClass.e", result); //$NON-NLS-1$ + assertTrue("Should contain EnumWithInnerClass.e", result); result = setWithInnerClass.contains(EnumWithInnerClass.b); - assertFalse("Should not contain EnumWithInnerClass.b", result); //$NON-NLS-1$ - assertEquals("Size of set should be 1:", 1, setWithInnerClass.size()); //$NON-NLS-1$ + assertFalse("Should not contain EnumWithInnerClass.b", result); + assertEquals("Size of set should be 1:", 1, setWithInnerClass.size()); anotherSetWithInnerClass = EnumSet.allOf(EnumWithInnerClass.class); result = setWithInnerClass.retainAll(anotherSetWithInnerClass); - assertFalse("Return value should be false", result); //$NON-NLS-1$ + assertFalse("Return value should be false", result); rawCollection = new ArrayList(); rawCollection.add(EnumWithInnerClass.e); rawCollection.add(EnumWithInnerClass.f); result = setWithInnerClass.retainAll(rawCollection); - assertFalse("Should return false", result); //$NON-NLS-1$ + assertFalse("Should return false", result); set = EnumSet.allOf(EnumFoo.class); set.remove(EnumFoo.a); anotherSet = EnumSet.noneOf(EnumFoo.class); anotherSet.add(EnumFoo.a); result = set.retainAll(anotherSet); - assertTrue("Should return true", result); //$NON-NLS-1$ - assertEquals("size should be 0", 0, set.size()); //$NON-NLS-1$ + assertTrue("Should return true", result); + assertEquals("size should be 0", 0, set.size()); // test enum type with more than 64 elements Set<HugeEnum> hugeSet = EnumSet.allOf(HugeEnum.class); try { hugeSet.retainAll(null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } @@ -1456,15 +1456,15 @@ public class EnumSetTest extends TestCase { result = hugeSetWithInnerClass.retainAll(anotherHugeSetWithInnerClass); assertTrue(result); result = hugeSetWithInnerClass.contains(HugeEnumWithInnerClass.e); - assertTrue("Should contain HugeEnumWithInnerClass.e", result); //$NON-NLS-1$ + assertTrue("Should contain HugeEnumWithInnerClass.e", result); result = hugeSetWithInnerClass.contains(HugeEnumWithInnerClass.b); - assertFalse("Should not contain HugeEnumWithInnerClass.b", result); //$NON-NLS-1$ - assertEquals("Size of hugeSet should be 1:", 1, hugeSetWithInnerClass.size()); //$NON-NLS-1$ + assertFalse("Should not contain HugeEnumWithInnerClass.b", result); + assertEquals("Size of hugeSet should be 1:", 1, hugeSetWithInnerClass.size()); anotherHugeSetWithInnerClass = EnumSet.allOf(HugeEnumWithInnerClass.class); result = hugeSetWithInnerClass.retainAll(anotherHugeSetWithInnerClass); - assertFalse("Return value should be false", result); //$NON-NLS-1$ + assertFalse("Return value should be false", result); rawCollection = new ArrayList(); rawCollection.add(HugeEnumWithInnerClass.e); @@ -1497,38 +1497,38 @@ public class EnumSetTest extends TestCase { Iterator<EnumFoo> iterator = set.iterator(); Iterator<EnumFoo> anotherIterator = set.iterator(); - assertNotSame("Should not be same", iterator, anotherIterator); //$NON-NLS-1$ + assertNotSame("Should not be same", iterator, anotherIterator); try { iterator.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // expectedd } - assertTrue("Should has next element:", iterator.hasNext()); //$NON-NLS-1$ - assertSame("Should be identical", EnumFoo.a, iterator.next()); //$NON-NLS-1$ + assertTrue("Should has next element:", iterator.hasNext()); + assertSame("Should be identical", EnumFoo.a, iterator.next()); iterator.remove(); - assertTrue("Should has next element:", iterator.hasNext()); //$NON-NLS-1$ - assertSame("Should be identical", EnumFoo.b, iterator.next()); //$NON-NLS-1$ - assertFalse("Should not has next element:", iterator.hasNext()); //$NON-NLS-1$ - assertFalse("Should not has next element:", iterator.hasNext()); //$NON-NLS-1$ + assertTrue("Should has next element:", iterator.hasNext()); + assertSame("Should be identical", EnumFoo.b, iterator.next()); + assertFalse("Should not has next element:", iterator.hasNext()); + assertFalse("Should not has next element:", iterator.hasNext()); - assertEquals("Size should be 1:", 1, set.size()); //$NON-NLS-1$ + assertEquals("Size should be 1:", 1, set.size()); try { iterator.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // expected } set = EnumSet.noneOf(EnumFoo.class); set.add(EnumFoo.a); iterator = set.iterator(); - assertEquals("Should be equal", EnumFoo.a, iterator.next()); //$NON-NLS-1$ + assertEquals("Should be equal", EnumFoo.a, iterator.next()); iterator.remove(); try { iterator.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch(IllegalStateException e) { // expected } @@ -1537,7 +1537,7 @@ public class EnumSetTest extends TestCase { Iterator<EmptyEnum> emptyIterator = emptySet.iterator(); try { emptyIterator.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // expected } @@ -1547,69 +1547,69 @@ public class EnumSetTest extends TestCase { setWithSubclass.remove(EnumWithInnerClass.e); Iterator<EnumWithInnerClass> iteratorWithSubclass = setWithSubclass .iterator(); - assertSame("Should be same", EnumWithInnerClass.a, iteratorWithSubclass.next()); //$NON-NLS-1$ + assertSame("Should be same", EnumWithInnerClass.a, iteratorWithSubclass.next()); - assertTrue("Should return true", iteratorWithSubclass.hasNext()); //$NON-NLS-1$ - assertSame("Should be same", EnumWithInnerClass.b, iteratorWithSubclass.next()); //$NON-NLS-1$ + assertTrue("Should return true", iteratorWithSubclass.hasNext()); + assertSame("Should be same", EnumWithInnerClass.b, iteratorWithSubclass.next()); setWithSubclass.remove(EnumWithInnerClass.c); - assertTrue("Should return true", iteratorWithSubclass.hasNext()); //$NON-NLS-1$ - assertSame("Should be same", EnumWithInnerClass.c, iteratorWithSubclass.next()); //$NON-NLS-1$ + assertTrue("Should return true", iteratorWithSubclass.hasNext()); + assertSame("Should be same", EnumWithInnerClass.c, iteratorWithSubclass.next()); - assertTrue("Should return true", iteratorWithSubclass.hasNext()); //$NON-NLS-1$ - assertSame("Should be same", EnumWithInnerClass.d, iteratorWithSubclass.next()); //$NON-NLS-1$ + assertTrue("Should return true", iteratorWithSubclass.hasNext()); + assertSame("Should be same", EnumWithInnerClass.d, iteratorWithSubclass.next()); setWithSubclass.add(EnumWithInnerClass.e); - assertTrue("Should return true", iteratorWithSubclass.hasNext()); //$NON-NLS-1$ - assertSame("Should be same", EnumWithInnerClass.f, iteratorWithSubclass.next()); //$NON-NLS-1$ + assertTrue("Should return true", iteratorWithSubclass.hasNext()); + assertSame("Should be same", EnumWithInnerClass.f, iteratorWithSubclass.next()); set = EnumSet.noneOf(EnumFoo.class); iterator = set.iterator(); try { iterator.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // expected } set.add(EnumFoo.a); iterator = set.iterator(); - assertEquals("Should return EnumFoo.a", EnumFoo.a, iterator.next()); //$NON-NLS-1$ - assertEquals("Size of set should be 1", 1, set.size()); //$NON-NLS-1$ + assertEquals("Should return EnumFoo.a", EnumFoo.a, iterator.next()); + assertEquals("Size of set should be 1", 1, set.size()); iterator.remove(); - assertEquals("Size of set should be 0", 0, set.size()); //$NON-NLS-1$ - assertFalse("Should return false", set.contains(EnumFoo.a)); //$NON-NLS-1$ + assertEquals("Size of set should be 0", 0, set.size()); + assertFalse("Should return false", set.contains(EnumFoo.a)); set.add(EnumFoo.a); set.add(EnumFoo.b); iterator = set.iterator(); - assertEquals("Should be equals", EnumFoo.a, iterator.next()); //$NON-NLS-1$ + assertEquals("Should be equals", EnumFoo.a, iterator.next()); iterator.remove(); try { iterator.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch(IllegalStateException e) { // expected } - assertTrue("Should have next element", iterator.hasNext()); //$NON-NLS-1$ + assertTrue("Should have next element", iterator.hasNext()); try { iterator.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // expected } - assertEquals("Size of set should be 1", 1, set.size()); //$NON-NLS-1$ - assertTrue("Should have next element", iterator.hasNext()); //$NON-NLS-1$ - assertEquals("Should return EnumFoo.b", EnumFoo.b, iterator.next()); //$NON-NLS-1$ + assertEquals("Size of set should be 1", 1, set.size()); + assertTrue("Should have next element", iterator.hasNext()); + assertEquals("Should return EnumFoo.b", EnumFoo.b, iterator.next()); set.remove(EnumFoo.b); - assertEquals("Size of set should be 0", 0, set.size()); //$NON-NLS-1$ + assertEquals("Size of set should be 0", 0, set.size()); iterator.remove(); - assertFalse("Should return false", set.contains(EnumFoo.a)); //$NON-NLS-1$ + assertFalse("Should return false", set.contains(EnumFoo.a)); // RI's bug, EnumFoo.b should not exist at the moment. if (!disableRIBugs) { - assertFalse("Should return false", set.contains(EnumFoo.b)); //$NON-NLS-1$ + assertFalse("Should return false", set.contains(EnumFoo.b)); } // test enum type with more than 64 elements @@ -1622,7 +1622,7 @@ public class EnumSetTest extends TestCase { assertNotSame(hIterator, anotherHugeIterator); try { hIterator.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // expectedd } @@ -1639,7 +1639,7 @@ public class EnumSetTest extends TestCase { try { hIterator.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // expected } @@ -1669,7 +1669,7 @@ public class EnumSetTest extends TestCase { hIterator = hugeSet.iterator(); try { hIterator.next(); - fail("Should throw NoSuchElementException"); //$NON-NLS-1$ + fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) { // expected } @@ -1691,7 +1691,7 @@ public class EnumSetTest extends TestCase { assertTrue(hIterator.hasNext()); try { hIterator.remove(); - fail("Should throw IllegalStateException"); //$NON-NLS-1$ + fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { // expected } @@ -1704,7 +1704,7 @@ public class EnumSetTest extends TestCase { assertFalse(hugeSet.contains(HugeEnum.a)); // RI's bug, EnumFoo.b should not exist at the moment. if(!disableRIBugs) { - assertFalse("Should return false", set.contains(EnumFoo.b)); //$NON-NLS-1$ + assertFalse("Should return false", set.contains(EnumFoo.b)); } } @@ -1719,14 +1719,14 @@ public class EnumSetTest extends TestCase { ) public void test_Of_E() { EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a); - assertEquals("enumSet should have length 1:", 1, enumSet.size()); //$NON-NLS-1$ + assertEquals("enumSet should have length 1:", 1, enumSet.size()); - assertTrue("enumSet should contain EnumWithSubclass.a:", //$NON-NLS-1$ + assertTrue("enumSet should contain EnumWithSubclass.a:", enumSet.contains(EnumWithInnerClass.a)); try { EnumSet.of((EnumWithInnerClass) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1750,36 +1750,36 @@ public class EnumSetTest extends TestCase { public void test_Of_EE() { EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a, EnumWithInnerClass.b); - assertEquals("enumSet should have length 2:", 2, enumSet.size()); //$NON-NLS-1$ + assertEquals("enumSet should have length 2:", 2, enumSet.size()); - assertTrue("enumSet should contain EnumWithSubclass.a:", //$NON-NLS-1$ + assertTrue("enumSet should contain EnumWithSubclass.a:", enumSet.contains(EnumWithInnerClass.a)); - assertTrue("enumSet should contain EnumWithSubclass.b:", //$NON-NLS-1$ + assertTrue("enumSet should contain EnumWithSubclass.b:", enumSet.contains(EnumWithInnerClass.b)); try { EnumSet.of((EnumWithInnerClass) null, EnumWithInnerClass.a); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } try { EnumSet.of( EnumWithInnerClass.a, (EnumWithInnerClass) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } try { EnumSet.of( (EnumWithInnerClass) null, (EnumWithInnerClass) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } enumSet = EnumSet.of(EnumWithInnerClass.a, EnumWithInnerClass.a); - assertEquals("Size of enumSet should be 1", //$NON-NLS-1$ + assertEquals("Size of enumSet should be 1", 1, enumSet.size()); // test enum type with more than 64 elements @@ -1792,21 +1792,21 @@ public class EnumSetTest extends TestCase { try { EnumSet.of((HugeEnumWithInnerClass) null, HugeEnumWithInnerClass.a); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } try { EnumSet.of( HugeEnumWithInnerClass.a, (HugeEnumWithInnerClass) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } try { EnumSet.of( (HugeEnumWithInnerClass) null, (HugeEnumWithInnerClass) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1827,22 +1827,22 @@ public class EnumSetTest extends TestCase { public void test_Of_EEE() { EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a, EnumWithInnerClass.b, EnumWithInnerClass.c); - assertEquals("Size of enumSet should be 3:", 3, enumSet.size()); //$NON-NLS-1$ + assertEquals("Size of enumSet should be 3:", 3, enumSet.size()); assertTrue( - "enumSet should contain EnumWithSubclass.a:", enumSet.contains(EnumWithInnerClass.a)); //$NON-NLS-1$ - assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.c)); //$NON-NLS-1$ + "enumSet should contain EnumWithSubclass.a:", enumSet.contains(EnumWithInnerClass.a)); + assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.c)); try { EnumSet.of((EnumWithInnerClass) null, null, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } enumSet = EnumSet.of(EnumWithInnerClass.a, EnumWithInnerClass.b, EnumWithInnerClass.b); - assertEquals("enumSet should contain 2 elements:", 2, enumSet.size()); //$NON-NLS-1$ + assertEquals("enumSet should contain 2 elements:", 2, enumSet.size()); // test enum type with more than 64 elements EnumSet<HugeEnumWithInnerClass> hugeEnumSet = EnumSet.of(HugeEnumWithInnerClass.a, @@ -1854,7 +1854,7 @@ public class EnumSetTest extends TestCase { try { EnumSet.of((HugeEnumWithInnerClass) null, null, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1877,16 +1877,16 @@ public class EnumSetTest extends TestCase { EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a, EnumWithInnerClass.b, EnumWithInnerClass.c, EnumWithInnerClass.d); - assertEquals("Size of enumSet should be 4", 4, enumSet.size()); //$NON-NLS-1$ + assertEquals("Size of enumSet should be 4", 4, enumSet.size()); assertTrue( - "enumSet should contain EnumWithSubclass.a:", enumSet.contains(EnumWithInnerClass.a)); //$NON-NLS-1$ - assertTrue("enumSet should contain EnumWithSubclass.d:", enumSet //$NON-NLS-1$ + "enumSet should contain EnumWithSubclass.a:", enumSet.contains(EnumWithInnerClass.a)); + assertTrue("enumSet should contain EnumWithSubclass.d:", enumSet .contains(EnumWithInnerClass.d)); try { EnumSet.of((EnumWithInnerClass) null, null, null, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1902,7 +1902,7 @@ public class EnumSetTest extends TestCase { try { EnumSet.of((HugeEnumWithInnerClass) null, null, null, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1921,14 +1921,14 @@ public class EnumSetTest extends TestCase { EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a, EnumWithInnerClass.b, EnumWithInnerClass.c, EnumWithInnerClass.d, EnumWithInnerClass.e); - assertEquals("Size of enumSet should be 5:", 5, enumSet.size()); //$NON-NLS-1$ + assertEquals("Size of enumSet should be 5:", 5, enumSet.size()); - assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.a)); //$NON-NLS-1$ - assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.e)); //$NON-NLS-1$ + assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.a)); + assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.e)); try { EnumSet.of((EnumWithInnerClass) null, null, null, null, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1944,7 +1944,7 @@ public class EnumSetTest extends TestCase { try { EnumSet.of((HugeEnumWithInnerClass) null, null, null, null, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -1964,24 +1964,24 @@ public class EnumSetTest extends TestCase { EnumWithInnerClass.b, EnumWithInnerClass.c }; EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a, enumArray); - assertEquals("Should be equal", 3, enumSet.size()); //$NON-NLS-1$ + assertEquals("Should be equal", 3, enumSet.size()); - assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.a)); //$NON-NLS-1$ - assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.c)); //$NON-NLS-1$ + assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.a)); + assertTrue("Should return true", enumSet.contains(EnumWithInnerClass.c)); try { EnumSet.of(EnumWithInnerClass.a, (EnumWithInnerClass[])null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } EnumFoo[] foos = {EnumFoo.a, EnumFoo.c, EnumFoo.d}; EnumSet<EnumFoo> set = EnumSet.of(EnumFoo.c, foos); - assertEquals("size of set should be 1", 3, set.size()); //$NON-NLS-1$ - assertTrue("Should contain EnumFoo.a", set.contains(EnumFoo.a)); //$NON-NLS-1$ - assertTrue("Should contain EnumFoo.c", set.contains(EnumFoo.c)); //$NON-NLS-1$ - assertTrue("Should contain EnumFoo.d", set.contains(EnumFoo.d)); //$NON-NLS-1$ + assertEquals("size of set should be 1", 3, set.size()); + assertTrue("Should contain EnumFoo.a", set.contains(EnumFoo.a)); + assertTrue("Should contain EnumFoo.c", set.contains(EnumFoo.c)); + assertTrue("Should contain EnumFoo.d", set.contains(EnumFoo.d)); // test enum type with more than 64 elements HugeEnumWithInnerClass[] hugeEnumArray = new HugeEnumWithInnerClass[] { @@ -1995,7 +1995,7 @@ public class EnumSetTest extends TestCase { try { EnumSet.of(HugeEnumWithInnerClass.a, (HugeEnumWithInnerClass[])null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException npe) { // expected } @@ -2020,65 +2020,65 @@ public class EnumSetTest extends TestCase { public void test_Range_EE() { try { EnumSet.range(EnumWithInnerClass.c, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.range(null, EnumWithInnerClass.c); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.range(null, (EnumWithInnerClass) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.range(EnumWithInnerClass.b, EnumWithInnerClass.a); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } EnumSet<EnumWithInnerClass> enumSet = EnumSet.range( EnumWithInnerClass.a, EnumWithInnerClass.a); - assertEquals("Size of enumSet should be 1", 1, enumSet.size()); //$NON-NLS-1$ + assertEquals("Size of enumSet should be 1", 1, enumSet.size()); enumSet = EnumSet.range( EnumWithInnerClass.a, EnumWithInnerClass.c); - assertEquals("Size of enumSet should be 3", 3, enumSet.size()); //$NON-NLS-1$ + assertEquals("Size of enumSet should be 3", 3, enumSet.size()); // test enum with more than 64 elements try { EnumSet.range(HugeEnumWithInnerClass.c, null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.range(null, HugeEnumWithInnerClass.c); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.range(null, (HugeEnumWithInnerClass) null); - fail("Should throw NullPointerException"); //$NON-NLS-1$ + fail("Should throw NullPointerException"); } catch (NullPointerException e) { // expected } try { EnumSet.range(HugeEnumWithInnerClass.b, HugeEnumWithInnerClass.a); - fail("Should throw IllegalArgumentException"); //$NON-NLS-1$ + fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } diff --git a/luni/src/test/java/tests/api/java/util/FormatterTest.java b/luni/src/test/java/tests/api/java/util/FormatterTest.java index ea53e8c..adc50ba 100644 --- a/luni/src/test/java/tests/api/java/util/FormatterTest.java +++ b/luni/src/test/java/tests/api/java/util/FormatterTest.java @@ -2102,290 +2102,290 @@ public class FormatterTest extends TestCase { china.set(Calendar.MILLISECOND, 609); final Object[][] lowerCaseGermanTriple = { - {0L, 'a', "Do."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'a', "So."}, //$NON-NLS-2$ - {-1000L, 'a', "Do."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'a', "Do."}, //$NON-NLS-2$ - {paris, 'a', "Mo."}, //$NON-NLS-2$ - {china, 'a', "Mo."}, //$NON-NLS-2$ - {0L, 'b', "Jan"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'b', "Aug"}, //$NON-NLS-2$ - {-1000L, 'b', "Jan"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'b', "Mai"}, //$NON-NLS-2$ - {paris, 'b', "Mai"}, //$NON-NLS-2$ - {china, 'b', "Mai"}, //$NON-NLS-2$ - {0L, 'c', "Do. Jan 01 08:00:00 GMT+08:00 1970"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'c', "So. Aug 17 15:12:55 GMT+08:00 292278994"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'c', "So. Aug 17 15:18:47 GMT+08:00 292278994"}, //$NON-NLS-2$ - {-1000L, 'c', "Do. Jan 01 07:59:59 GMT+08:00 1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'c', "Do. Mai 11 13:59:07 GMT+08:00 2006"}, //$NON-NLS-2$ - {paris, 'c', "Mo. Mai 08 12:00:00 MESZ 2006"}, //$NON-NLS-2$ - {china, 'c', "Mo. Mai 08 12:00:00 GMT-08:00 2006"}, //$NON-NLS-2$ - {0L, 'd', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'd', "17"}, //$NON-NLS-2$ - {-1000L, 'd', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'd', "11"}, //$NON-NLS-2$ - {paris, 'd', "08"}, //$NON-NLS-2$ - {china, 'd', "08"}, //$NON-NLS-2$ - {0L, 'e', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'e', "17"}, //$NON-NLS-2$ - {-1000L, 'e', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'e', "11"}, //$NON-NLS-2$ - {paris, 'e', "8"}, //$NON-NLS-2$ - {china, 'e', "8"}, //$NON-NLS-2$ - {0L, 'h', "Jan"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'h', "Aug"}, //$NON-NLS-2$ - {-1000L, 'h', "Jan"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'h', "Mai"}, //$NON-NLS-2$ - {paris, 'h', "Mai"}, //$NON-NLS-2$ - {china, 'h', "Mai"}, //$NON-NLS-2$ - {0L, 'j', "001"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'j', "229"}, //$NON-NLS-2$ - {-1000L, 'j', "001"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'j', "131"}, //$NON-NLS-2$ - {paris, 'j', "128"}, //$NON-NLS-2$ - {china, 'j', "128"}, //$NON-NLS-2$ - {0L, 'k', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'k', "15"}, //$NON-NLS-2$ - {-1000L, 'k', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'k', "13"}, //$NON-NLS-2$ - {paris, 'k', "12"}, //$NON-NLS-2$ - {china, 'k', "12"}, //$NON-NLS-2$ - {0L, 'l', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'l', "3"}, //$NON-NLS-2$ - {-1000L, 'l', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'l', "1"}, //$NON-NLS-2$ - {paris, 'l', "12"}, //$NON-NLS-2$ - {china, 'l', "12"}, //$NON-NLS-2$ - {0L, 'm', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'm', "08"}, //$NON-NLS-2$ - {-1000L, 'm', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'm', "05"}, //$NON-NLS-2$ - {paris, 'm', "05"}, //$NON-NLS-2$ - {china, 'm', "05"}, //$NON-NLS-2$ - {0L, 'p', "vorm."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'p', "nachm."}, //$NON-NLS-2$ - {-1000L, 'p', "vorm."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'p', "nachm."}, //$NON-NLS-2$ - {paris, 'p', "nachm."}, //$NON-NLS-2$ - {china, 'p', "nachm."}, //$NON-NLS-2$ - {0L, 'r', "08:00:00 vorm."}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'r', "03:12:55 PM"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'r', "03:18:47 nachm."}, //$NON-NLS-2$ - {-1000L, 'r', "07:59:59 vorm."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'r', "01:59:07 nachm."}, //$NON-NLS-2$ - {paris, 'r', "12:00:00 nachm."}, //$NON-NLS-2$ - {china, 'r', "12:00:00 nachm."}, //$NON-NLS-2$ - {0L, 's', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 's', "9223372036854775"}, //$NON-NLS-2$ - {-1000L, 's', "-1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 's', "1147327147"}, //$NON-NLS-2$ - {paris, 's', "1147082400"}, //$NON-NLS-2$ - {china, 's', "1147118400"}, //$NON-NLS-2$ - {0L, 'y', "70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'y', "94"}, //$NON-NLS-2$ - {-1000L, 'y', "70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'y', "06"}, //$NON-NLS-2$ - {paris, 'y', "06"}, //$NON-NLS-2$ - {china, 'y', "06"}, //$NON-NLS-2$ - {0L, 'z', "+0800"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'z', "+0800"}, //$NON-NLS-2$ - {-1000L, 'z', "+0800"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'z', "+0800"}, //$NON-NLS-2$ - {paris, 'z', "+0100"}, //$NON-NLS-2$ - {china, 'z', "-0800"}, //$NON-NLS-2$ + {0L, 'a', "Do."}, + {Long.MAX_VALUE, 'a', "So."}, + {-1000L, 'a', "Do."}, + {new Date(1147327147578L), 'a', "Do."}, + {paris, 'a', "Mo."}, + {china, 'a', "Mo."}, + {0L, 'b', "Jan"}, + {Long.MAX_VALUE, 'b', "Aug"}, + {-1000L, 'b', "Jan"}, + {new Date(1147327147578L), 'b', "Mai"}, + {paris, 'b', "Mai"}, + {china, 'b', "Mai"}, + {0L, 'c', "Do. Jan 01 08:00:00 GMT+08:00 1970"}, + // {Long.MAX_VALUE, 'c', "So. Aug 17 15:12:55 GMT+08:00 292278994"}, + {Long.MAX_VALUE, 'c', "So. Aug 17 15:18:47 GMT+08:00 292278994"}, + {-1000L, 'c', "Do. Jan 01 07:59:59 GMT+08:00 1970"}, + {new Date(1147327147578L), 'c', "Do. Mai 11 13:59:07 GMT+08:00 2006"}, + {paris, 'c', "Mo. Mai 08 12:00:00 MESZ 2006"}, + {china, 'c', "Mo. Mai 08 12:00:00 GMT-08:00 2006"}, + {0L, 'd', "01"}, + {Long.MAX_VALUE, 'd', "17"}, + {-1000L, 'd', "01"}, + {new Date(1147327147578L), 'd', "11"}, + {paris, 'd', "08"}, + {china, 'd', "08"}, + {0L, 'e', "1"}, + {Long.MAX_VALUE, 'e', "17"}, + {-1000L, 'e', "1"}, + {new Date(1147327147578L), 'e', "11"}, + {paris, 'e', "8"}, + {china, 'e', "8"}, + {0L, 'h', "Jan"}, + {Long.MAX_VALUE, 'h', "Aug"}, + {-1000L, 'h', "Jan"}, + {new Date(1147327147578L), 'h', "Mai"}, + {paris, 'h', "Mai"}, + {china, 'h', "Mai"}, + {0L, 'j', "001"}, + {Long.MAX_VALUE, 'j', "229"}, + {-1000L, 'j', "001"}, + {new Date(1147327147578L), 'j', "131"}, + {paris, 'j', "128"}, + {china, 'j', "128"}, + {0L, 'k', "8"}, + {Long.MAX_VALUE, 'k', "15"}, + {-1000L, 'k', "7"}, + {new Date(1147327147578L), 'k', "13"}, + {paris, 'k', "12"}, + {china, 'k', "12"}, + {0L, 'l', "8"}, + {Long.MAX_VALUE, 'l', "3"}, + {-1000L, 'l', "7"}, + {new Date(1147327147578L), 'l', "1"}, + {paris, 'l', "12"}, + {china, 'l', "12"}, + {0L, 'm', "01"}, + {Long.MAX_VALUE, 'm', "08"}, + {-1000L, 'm', "01"}, + {new Date(1147327147578L), 'm', "05"}, + {paris, 'm', "05"}, + {china, 'm', "05"}, + {0L, 'p', "vorm."}, + {Long.MAX_VALUE, 'p', "nachm."}, + {-1000L, 'p', "vorm."}, + {new Date(1147327147578L), 'p', "nachm."}, + {paris, 'p', "nachm."}, + {china, 'p', "nachm."}, + {0L, 'r', "08:00:00 vorm."}, + // {Long.MAX_VALUE, 'r', "03:12:55 PM"}, + {Long.MAX_VALUE, 'r', "03:18:47 nachm."}, + {-1000L, 'r', "07:59:59 vorm."}, + {new Date(1147327147578L), 'r', "01:59:07 nachm."}, + {paris, 'r', "12:00:00 nachm."}, + {china, 'r', "12:00:00 nachm."}, + {0L, 's', "0"}, + {Long.MAX_VALUE, 's', "9223372036854775"}, + {-1000L, 's', "-1"}, + {new Date(1147327147578L), 's', "1147327147"}, + {paris, 's', "1147082400"}, + {china, 's', "1147118400"}, + {0L, 'y', "70"}, + {Long.MAX_VALUE, 'y', "94"}, + {-1000L, 'y', "70"}, + {new Date(1147327147578L), 'y', "06"}, + {paris, 'y', "06"}, + {china, 'y', "06"}, + {0L, 'z', "+0800"}, + {Long.MAX_VALUE, 'z', "+0800"}, + {-1000L, 'z', "+0800"}, + {new Date(1147327147578L), 'z', "+0800"}, + {paris, 'z', "+0100"}, + {china, 'z', "-0800"}, }; final Object[][] lowerCaseFranceTriple = { - {0L, 'a', "jeu."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'a', "dim."}, //$NON-NLS-2$ - {-1000L, 'a', "jeu."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'a', "jeu."}, //$NON-NLS-2$ - {paris, 'a', "lun."}, //$NON-NLS-2$ - {china, 'a', "lun."}, //$NON-NLS-2$ - {0L, 'b', "janv."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'b', "ao\u00fbt"}, //$NON-NLS-2$ - {-1000L, 'b', "janv."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'b', "mai"}, //$NON-NLS-2$ - {paris, 'b', "mai"}, //$NON-NLS-2$ - {china, 'b', "mai"}, //$NON-NLS-2$ - {0L, 'c', "jeu. janv. 01 08:00:00 UTC+08:00 1970"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'c', "dim. ao\u00fbt 17 15:12:55 UTC+08:00 292278994"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'c', "dim. ao\u00fbt 17 15:18:47 UTC+08:00 292278994"}, //$NON-NLS-2$ - {-1000L, 'c', "jeu. janv. 01 07:59:59 UTC+08:00 1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'c', "jeu. mai 11 13:59:07 UTC+08:00 2006"}, //$NON-NLS-2$ - {paris, 'c', "lun. mai 08 12:00:00 HAEC 2006"}, //$NON-NLS-2$ - {china, 'c', "lun. mai 08 12:00:00 UTC-08:00 2006"}, //$NON-NLS-2$ - {0L, 'd', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'd', "17"}, //$NON-NLS-2$ - {-1000L, 'd', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'd', "11"}, //$NON-NLS-2$ - {paris, 'd', "08"}, //$NON-NLS-2$ - {china, 'd', "08"}, //$NON-NLS-2$ - {0L, 'e', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'e', "17"}, //$NON-NLS-2$ - {-1000L, 'e', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'e', "11"}, //$NON-NLS-2$ - {paris, 'e', "8"}, //$NON-NLS-2$ - {china, 'e', "8"}, //$NON-NLS-2$ - {0L, 'h', "janv."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'h', "ao\u00fbt"}, //$NON-NLS-2$ - {-1000L, 'h', "janv."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'h', "mai"}, //$NON-NLS-2$ - {paris, 'h', "mai"}, //$NON-NLS-2$ - {china, 'h', "mai"}, //$NON-NLS-2$ - {0L, 'j', "001"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'j', "229"}, //$NON-NLS-2$ - {-1000L, 'j', "001"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'j', "131"}, //$NON-NLS-2$ - {paris, 'j', "128"}, //$NON-NLS-2$ - {china, 'j', "128"}, //$NON-NLS-2$ - {0L, 'k', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'k', "15"}, //$NON-NLS-2$ - {-1000L, 'k', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'k', "13"}, //$NON-NLS-2$ - {paris, 'k', "12"}, //$NON-NLS-2$ - {china, 'k', "12"}, //$NON-NLS-2$ - {0L, 'l', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'l', "3"}, //$NON-NLS-2$ - {-1000L, 'l', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'l', "1"}, //$NON-NLS-2$ - {paris, 'l', "12"}, //$NON-NLS-2$ - {china, 'l', "12"}, //$NON-NLS-2$ - {0L, 'm', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'm', "08"}, //$NON-NLS-2$ - {-1000L, 'm', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'm', "05"}, //$NON-NLS-2$ - {paris, 'm', "05"}, //$NON-NLS-2$ - {china, 'm', "05"}, //$NON-NLS-2$ - {0L, 'p', "am"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'p', "pm"}, //$NON-NLS-2$ - {-1000L, 'p', "am"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'p', "pm"}, //$NON-NLS-2$ - {paris, 'p', "pm"}, //$NON-NLS-2$ - {china, 'p', "pm"}, //$NON-NLS-2$ - {0L, 'r', "08:00:00 AM"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'r', "03:12:55 PM"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'r', "03:18:47 PM"}, //$NON-NLS-2$ - {-1000L, 'r', "07:59:59 AM"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'r', "01:59:07 PM"}, //$NON-NLS-2$ - {paris, 'r', "12:00:00 PM"}, //$NON-NLS-2$ - {china, 'r', "12:00:00 PM"}, //$NON-NLS-2$ - {0L, 's', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 's', "9223372036854775"}, //$NON-NLS-2$ - {-1000L, 's', "-1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 's', "1147327147"}, //$NON-NLS-2$ - {paris, 's', "1147082400"}, //$NON-NLS-2$ - {china, 's', "1147118400"}, //$NON-NLS-2$ - {0L, 'y', "70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'y', "94"}, //$NON-NLS-2$ - {-1000L, 'y', "70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'y', "06"}, //$NON-NLS-2$ - {paris, 'y', "06"}, //$NON-NLS-2$ - {china, 'y', "06"}, //$NON-NLS-2$ - {0L, 'z', "+0800"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'z', "+0800"}, //$NON-NLS-2$ - {-1000L, 'z', "+0800"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'z', "+0800"}, //$NON-NLS-2$ - {paris, 'z', "+0100"}, //$NON-NLS-2$ - {china, 'z', "-0800"}, //$NON-NLS-2$ + {0L, 'a', "jeu."}, + {Long.MAX_VALUE, 'a', "dim."}, + {-1000L, 'a', "jeu."}, + {new Date(1147327147578L), 'a', "jeu."}, + {paris, 'a', "lun."}, + {china, 'a', "lun."}, + {0L, 'b', "janv."}, + {Long.MAX_VALUE, 'b', "ao\u00fbt"}, + {-1000L, 'b', "janv."}, + {new Date(1147327147578L), 'b', "mai"}, + {paris, 'b', "mai"}, + {china, 'b', "mai"}, + {0L, 'c', "jeu. janv. 01 08:00:00 UTC+08:00 1970"}, + // {Long.MAX_VALUE, 'c', "dim. ao\u00fbt 17 15:12:55 UTC+08:00 292278994"}, + {Long.MAX_VALUE, 'c', "dim. ao\u00fbt 17 15:18:47 UTC+08:00 292278994"}, + {-1000L, 'c', "jeu. janv. 01 07:59:59 UTC+08:00 1970"}, + {new Date(1147327147578L), 'c', "jeu. mai 11 13:59:07 UTC+08:00 2006"}, + {paris, 'c', "lun. mai 08 12:00:00 HAEC 2006"}, + {china, 'c', "lun. mai 08 12:00:00 UTC-08:00 2006"}, + {0L, 'd', "01"}, + {Long.MAX_VALUE, 'd', "17"}, + {-1000L, 'd', "01"}, + {new Date(1147327147578L), 'd', "11"}, + {paris, 'd', "08"}, + {china, 'd', "08"}, + {0L, 'e', "1"}, + {Long.MAX_VALUE, 'e', "17"}, + {-1000L, 'e', "1"}, + {new Date(1147327147578L), 'e', "11"}, + {paris, 'e', "8"}, + {china, 'e', "8"}, + {0L, 'h', "janv."}, + {Long.MAX_VALUE, 'h', "ao\u00fbt"}, + {-1000L, 'h', "janv."}, + {new Date(1147327147578L), 'h', "mai"}, + {paris, 'h', "mai"}, + {china, 'h', "mai"}, + {0L, 'j', "001"}, + {Long.MAX_VALUE, 'j', "229"}, + {-1000L, 'j', "001"}, + {new Date(1147327147578L), 'j', "131"}, + {paris, 'j', "128"}, + {china, 'j', "128"}, + {0L, 'k', "8"}, + {Long.MAX_VALUE, 'k', "15"}, + {-1000L, 'k', "7"}, + {new Date(1147327147578L), 'k', "13"}, + {paris, 'k', "12"}, + {china, 'k', "12"}, + {0L, 'l', "8"}, + {Long.MAX_VALUE, 'l', "3"}, + {-1000L, 'l', "7"}, + {new Date(1147327147578L), 'l', "1"}, + {paris, 'l', "12"}, + {china, 'l', "12"}, + {0L, 'm', "01"}, + {Long.MAX_VALUE, 'm', "08"}, + {-1000L, 'm', "01"}, + {new Date(1147327147578L), 'm', "05"}, + {paris, 'm', "05"}, + {china, 'm', "05"}, + {0L, 'p', "am"}, + {Long.MAX_VALUE, 'p', "pm"}, + {-1000L, 'p', "am"}, + {new Date(1147327147578L), 'p', "pm"}, + {paris, 'p', "pm"}, + {china, 'p', "pm"}, + {0L, 'r', "08:00:00 AM"}, + // {Long.MAX_VALUE, 'r', "03:12:55 PM"}, + {Long.MAX_VALUE, 'r', "03:18:47 PM"}, + {-1000L, 'r', "07:59:59 AM"}, + {new Date(1147327147578L), 'r', "01:59:07 PM"}, + {paris, 'r', "12:00:00 PM"}, + {china, 'r', "12:00:00 PM"}, + {0L, 's', "0"}, + {Long.MAX_VALUE, 's', "9223372036854775"}, + {-1000L, 's', "-1"}, + {new Date(1147327147578L), 's', "1147327147"}, + {paris, 's', "1147082400"}, + {china, 's', "1147118400"}, + {0L, 'y', "70"}, + {Long.MAX_VALUE, 'y', "94"}, + {-1000L, 'y', "70"}, + {new Date(1147327147578L), 'y', "06"}, + {paris, 'y', "06"}, + {china, 'y', "06"}, + {0L, 'z', "+0800"}, + {Long.MAX_VALUE, 'z', "+0800"}, + {-1000L, 'z', "+0800"}, + {new Date(1147327147578L), 'z', "+0800"}, + {paris, 'z', "+0100"}, + {china, 'z', "-0800"}, }; final Object[][] lowerCaseCzechTriple = { - {0L, 'a', "\u010dt"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'a', "ne"}, //$NON-NLS-2$ - {-1000L, 'a', "\u010dt"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'a', "\u010dt"}, //$NON-NLS-2$ - {paris, 'a', "po"}, //$NON-NLS-2$ - {china, 'a', "po"}, //$NON-NLS-2$ - {0L, 'b', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'b', "8"}, //$NON-NLS-2$ - {-1000L, 'b', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'b', "5"}, //$NON-NLS-2$ - {paris, 'b', "5"}, //$NON-NLS-2$ - {china, 'b', "5"}, //$NON-NLS-2$ - {0L, 'c', "\u010dt 1 01 08:00:00 GMT+08:00 1970"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'c', "ne 8 17 15:12:55 GMT+08:00 292278994"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'c', "ne 8 17 15:18:47 GMT+08:00 292278994"}, //$NON-NLS-2$ - {-1000L, 'c', "\u010dt 1 01 07:59:59 GMT+08:00 1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'c', "\u010dt 5 11 13:59:07 GMT+08:00 2006"}, //$NON-NLS-2$ - {paris, 'c', "po 5 08 12:00:00 GMT+02:00 2006"}, //$NON-NLS-2$ - {china, 'c', "po 5 08 12:00:00 GMT-08:00 2006"}, //$NON-NLS-2$ - {0L, 'd', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'd', "17"}, //$NON-NLS-2$ - {-1000L, 'd', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'd', "11"}, //$NON-NLS-2$ - {paris, 'd', "08"}, //$NON-NLS-2$ - {china, 'd', "08"}, //$NON-NLS-2$ - {0L, 'e', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'e', "17"}, //$NON-NLS-2$ - {-1000L, 'e', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'e', "11"}, //$NON-NLS-2$ - {paris, 'e', "8"}, //$NON-NLS-2$ - {china, 'e', "8"}, //$NON-NLS-2$ - {0L, 'h', "1"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'h', "8"}, //$NON-NLS-2$ - {-1000L, 'h', "1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'h', "5"}, //$NON-NLS-2$ - {paris, 'h', "5"}, //$NON-NLS-2$ - {china, 'h', "5"}, //$NON-NLS-2$ - {0L, 'j', "001"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'j', "229"}, //$NON-NLS-2$ - {-1000L, 'j', "001"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'j', "131"}, //$NON-NLS-2$ - {paris, 'j', "128"}, //$NON-NLS-2$ - {china, 'j', "128"}, //$NON-NLS-2$ - {0L, 'k', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'k', "15"}, //$NON-NLS-2$ - {-1000L, 'k', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'k', "13"}, //$NON-NLS-2$ - {paris, 'k', "12"}, //$NON-NLS-2$ - {china, 'k', "12"}, //$NON-NLS-2$ - {0L, 'l', "8"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'l', "3"}, //$NON-NLS-2$ - {-1000L, 'l', "7"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'l', "1"}, //$NON-NLS-2$ - {paris, 'l', "12"}, //$NON-NLS-2$ - {china, 'l', "12"}, //$NON-NLS-2$ - {0L, 'm', "01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'm', "08"}, //$NON-NLS-2$ - {-1000L, 'm', "01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'm', "05"}, //$NON-NLS-2$ - {paris, 'm', "05"}, //$NON-NLS-2$ - {china, 'm', "05"}, //$NON-NLS-2$ - {0L, 'p', "dop."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'p', "odp."}, //$NON-NLS-2$ - {-1000L, 'p', "dop."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'p', "odp."}, //$NON-NLS-2$ - {paris, 'p', "odp."}, //$NON-NLS-2$ - {china, 'p', "odp."}, //$NON-NLS-2$ - {0L, 'r', "08:00:00 dop."}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'r', "03:12:55 ODP."}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'r', "03:18:47 odp."}, //$NON-NLS-2$ - {-1000L, 'r', "07:59:59 dop."}, //$NON-NLS-2$ - {new Date(1147327147578L), 'r', "01:59:07 odp."}, //$NON-NLS-2$ - {paris, 'r', "12:00:00 odp."}, //$NON-NLS-2$ - {china, 'r', "12:00:00 odp."}, //$NON-NLS-2$ - {0L, 's', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 's', "9223372036854775"}, //$NON-NLS-2$ - {-1000L, 's', "-1"}, //$NON-NLS-2$ - {new Date(1147327147578L), 's', "1147327147"}, //$NON-NLS-2$ - {paris, 's', "1147082400"}, //$NON-NLS-2$ - {china, 's', "1147118400"}, //$NON-NLS-2$ - {0L, 'y', "70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'y', "94"}, //$NON-NLS-2$ - {-1000L, 'y', "70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'y', "06"}, //$NON-NLS-2$ - {paris, 'y', "06"}, //$NON-NLS-2$ - {china, 'y', "06"}, //$NON-NLS-2$ - {0L, 'z', "+0800"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'z', "+0800"}, //$NON-NLS-2$ - {-1000L, 'z', "+0800"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'z', "+0800"}, //$NON-NLS-2$ - {paris, 'z', "+0100"}, //$NON-NLS-2$ - {china, 'z', "-0800"}, //$NON-NLS-2$ + {0L, 'a', "\u010dt"}, + {Long.MAX_VALUE, 'a', "ne"}, + {-1000L, 'a', "\u010dt"}, + {new Date(1147327147578L), 'a', "\u010dt"}, + {paris, 'a', "po"}, + {china, 'a', "po"}, + {0L, 'b', "1"}, + {Long.MAX_VALUE, 'b', "8"}, + {-1000L, 'b', "1"}, + {new Date(1147327147578L), 'b', "5"}, + {paris, 'b', "5"}, + {china, 'b', "5"}, + {0L, 'c', "\u010dt 1 01 08:00:00 GMT+08:00 1970"}, + // {Long.MAX_VALUE, 'c', "ne 8 17 15:12:55 GMT+08:00 292278994"}, + {Long.MAX_VALUE, 'c', "ne 8 17 15:18:47 GMT+08:00 292278994"}, + {-1000L, 'c', "\u010dt 1 01 07:59:59 GMT+08:00 1970"}, + {new Date(1147327147578L), 'c', "\u010dt 5 11 13:59:07 GMT+08:00 2006"}, + {paris, 'c', "po 5 08 12:00:00 GMT+02:00 2006"}, + {china, 'c', "po 5 08 12:00:00 GMT-08:00 2006"}, + {0L, 'd', "01"}, + {Long.MAX_VALUE, 'd', "17"}, + {-1000L, 'd', "01"}, + {new Date(1147327147578L), 'd', "11"}, + {paris, 'd', "08"}, + {china, 'd', "08"}, + {0L, 'e', "1"}, + {Long.MAX_VALUE, 'e', "17"}, + {-1000L, 'e', "1"}, + {new Date(1147327147578L), 'e', "11"}, + {paris, 'e', "8"}, + {china, 'e', "8"}, + {0L, 'h', "1"}, + {Long.MAX_VALUE, 'h', "8"}, + {-1000L, 'h', "1"}, + {new Date(1147327147578L), 'h', "5"}, + {paris, 'h', "5"}, + {china, 'h', "5"}, + {0L, 'j', "001"}, + {Long.MAX_VALUE, 'j', "229"}, + {-1000L, 'j', "001"}, + {new Date(1147327147578L), 'j', "131"}, + {paris, 'j', "128"}, + {china, 'j', "128"}, + {0L, 'k', "8"}, + {Long.MAX_VALUE, 'k', "15"}, + {-1000L, 'k', "7"}, + {new Date(1147327147578L), 'k', "13"}, + {paris, 'k', "12"}, + {china, 'k', "12"}, + {0L, 'l', "8"}, + {Long.MAX_VALUE, 'l', "3"}, + {-1000L, 'l', "7"}, + {new Date(1147327147578L), 'l', "1"}, + {paris, 'l', "12"}, + {china, 'l', "12"}, + {0L, 'm', "01"}, + {Long.MAX_VALUE, 'm', "08"}, + {-1000L, 'm', "01"}, + {new Date(1147327147578L), 'm', "05"}, + {paris, 'm', "05"}, + {china, 'm', "05"}, + {0L, 'p', "dop."}, + {Long.MAX_VALUE, 'p', "odp."}, + {-1000L, 'p', "dop."}, + {new Date(1147327147578L), 'p', "odp."}, + {paris, 'p', "odp."}, + {china, 'p', "odp."}, + {0L, 'r', "08:00:00 dop."}, + // {Long.MAX_VALUE, 'r', "03:12:55 ODP."}, + {Long.MAX_VALUE, 'r', "03:18:47 odp."}, + {-1000L, 'r', "07:59:59 dop."}, + {new Date(1147327147578L), 'r', "01:59:07 odp."}, + {paris, 'r', "12:00:00 odp."}, + {china, 'r', "12:00:00 odp."}, + {0L, 's', "0"}, + {Long.MAX_VALUE, 's', "9223372036854775"}, + {-1000L, 's', "-1"}, + {new Date(1147327147578L), 's', "1147327147"}, + {paris, 's', "1147082400"}, + {china, 's', "1147118400"}, + {0L, 'y', "70"}, + {Long.MAX_VALUE, 'y', "94"}, + {-1000L, 'y', "70"}, + {new Date(1147327147578L), 'y', "06"}, + {paris, 'y', "06"}, + {china, 'y', "06"}, + {0L, 'z', "+0800"}, + {Long.MAX_VALUE, 'z', "+0800"}, + {-1000L, 'z', "+0800"}, + {new Date(1147327147578L), 'z', "+0800"}, + {paris, 'z', "+0100"}, + {china, 'z', "-0800"}, }; assertEquals(lowerCaseGermanTriple.length, lowerCaseFranceTriple.length); @@ -2396,367 +2396,367 @@ public class FormatterTest extends TestCase { final int output = 2; for (int i = 0; i < lowerCaseGermanTriple.length; i++) { // go through legal conversion - String formatSpecifier = "%t" + lowerCaseGermanTriple[i][pattern]; //$NON-NLS-2$ - String formatSpecifierUpper = "%T" + lowerCaseGermanTriple[i][pattern]; //$NON-NLS-2$ + String formatSpecifier = "%t" + lowerCaseGermanTriple[i][pattern]; + String formatSpecifierUpper = "%T" + lowerCaseGermanTriple[i][pattern]; // test '%t' f = new Formatter(Locale.GERMAN); f.format(formatSpecifier, lowerCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + lowerCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + lowerCaseGermanTriple[i][input], lowerCaseGermanTriple[i][output], f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.FRANCE, formatSpecifier, lowerCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + lowerCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + lowerCaseFranceTriple[i][input], lowerCaseFranceTriple[i][output], f.toString()); f = new Formatter(Locale.GERMAN); f.format(new Locale("cs", "CZ"), formatSpecifier, lowerCaseCzechTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + lowerCaseCzechTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + lowerCaseCzechTriple[i][input], lowerCaseCzechTriple[i][output], f.toString()); // test '%T' f = new Formatter(Locale.GERMAN); f.format(formatSpecifierUpper, lowerCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + lowerCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + lowerCaseGermanTriple[i][input], ((String)lowerCaseGermanTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.FRANCE, formatSpecifierUpper, lowerCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + lowerCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + lowerCaseFranceTriple[i][input], ((String)lowerCaseFranceTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(new Locale("cs", "CZ"), formatSpecifierUpper, lowerCaseCzechTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + lowerCaseCzechTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + lowerCaseCzechTriple[i][input], ((String)lowerCaseCzechTriple[i][output]) .toUpperCase(Locale.US), f.toString()); } final Object[][] upperCaseGermanTriple = { - {0L, 'A', "Donnerstag"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'A', "Sonntag"}, //$NON-NLS-2$ - {-1000L, 'A', "Donnerstag"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'A', "Donnerstag"}, //$NON-NLS-2$ - {paris, 'A', "Montag"}, //$NON-NLS-2$ - {china, 'A', "Montag"}, //$NON-NLS-2$ - {0L, 'B', "Januar"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'B', "August"}, //$NON-NLS-2$ - {-1000L, 'B', "Januar"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'B', "Mai"}, //$NON-NLS-2$ - {paris, 'B', "Mai"}, //$NON-NLS-2$ - {china, 'B', "Mai"}, //$NON-NLS-2$ - {0L, 'C', "19"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'C', "2922789"}, //$NON-NLS-2$ - {-1000L, 'C', "19"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'C', "20"}, //$NON-NLS-2$ - {paris, 'C', "20"}, //$NON-NLS-2$ - {china, 'C', "20"}, //$NON-NLS-2$ - {0L, 'D', "01/01/70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'D', "08/17/94"}, //$NON-NLS-2$ - {-1000L, 'D', "01/01/70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'D', "05/11/06"}, //$NON-NLS-2$ - {paris, 'D', "05/08/06"}, //$NON-NLS-2$ - {china, 'D', "05/08/06"}, //$NON-NLS-2$ - {0L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'F', "292278994-08-17"}, //$NON-NLS-2$ - {-1000L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'F', "2006-05-11"}, //$NON-NLS-2$ - {paris, 'F', "2006-05-08"}, //$NON-NLS-2$ - {china, 'F', "2006-05-08"}, //$NON-NLS-2$ - {0L, 'H', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'H', "15"}, //$NON-NLS-2$ - {-1000L, 'H', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'H', "13"}, //$NON-NLS-2$ - {paris, 'H', "12"}, //$NON-NLS-2$ - {china, 'H', "12"}, //$NON-NLS-2$ - {0L, 'I', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'I', "03"}, //$NON-NLS-2$ - {-1000L, 'I', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'I', "01"}, //$NON-NLS-2$ - {paris, 'I', "12"}, //$NON-NLS-2$ - {china, 'I', "12"}, //$NON-NLS-2$ - {0L, 'L', "000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'L', "807"}, //$NON-NLS-2$ - {-1000L, 'L', "000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'L', "578"}, //$NON-NLS-2$ - {paris, 'L', "453"}, //$NON-NLS-2$ - {china, 'L', "609"}, //$NON-NLS-2$ - {0L, 'M', "00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'M', "12"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'M', "18"}, //$NON-NLS-2$ - {-1000L, 'M', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'M', "59"}, //$NON-NLS-2$ - {paris, 'M', "00"}, //$NON-NLS-2$ - {china, 'M', "00"}, //$NON-NLS-2$ - {0L, 'N', "000000000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'N', "807000000"}, //$NON-NLS-2$ - {-1000L, 'N', "000000000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'N', "578000000"}, //$NON-NLS-2$ - {paris, 'N', "609000000"}, //$NON-NLS-2$ - {china, 'N', "609000000"}, //$NON-NLS-2$ - {0L, 'Q', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Q', "9223372036854775807"}, //$NON-NLS-2$ - {-1000L, 'Q', "-1000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Q', "1147327147578"}, //$NON-NLS-2$ - {paris, 'Q', "1147082400453"}, //$NON-NLS-2$ - {china, 'Q', "1147118400609"}, //$NON-NLS-2$ - {0L, 'R', "08:00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'R', "15:12"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'R', "15:18"}, //$NON-NLS-2$ - {-1000L, 'R', "07:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'R', "13:59"}, //$NON-NLS-2$ - {paris, 'R', "12:00"}, //$NON-NLS-2$ - {china, 'R', "12:00"}, //$NON-NLS-2$ - {0L, 'S', "00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'S', "55"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'S', "47"}, //$NON-NLS-2$ - {-1000L, 'S', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'S', "07"}, //$NON-NLS-2$ - {paris, 'S', "00"}, //$NON-NLS-2$ - {china, 'S', "00"}, //$NON-NLS-2$ - {0L, 'T', "08:00:00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'T', "15:12:55"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'T', "15:18:47"}, //$NON-NLS-2$ - {-1000L, 'T', "07:59:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'T', "13:59:07"}, //$NON-NLS-2$ - {paris, 'T', "12:00:00"}, //$NON-NLS-2$ - {china, 'T', "12:00:00"}, //$NON-NLS-2$ - {0L, 'Y', "1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Y', "292278994"}, //$NON-NLS-2$ - {-1000L, 'Y', "1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Y', "2006"}, //$NON-NLS-2$ - {paris, 'Y', "2006"}, //$NON-NLS-2$ - {china, 'Y', "2006"}, //$NON-NLS-2$ - {0L, 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {-1000L, 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {paris, 'Z', "MESZ"}, //$NON-NLS-2$ - {china, 'Z', "GMT-08:00"}, //$NON-NLS-2$ + {0L, 'A', "Donnerstag"}, + {Long.MAX_VALUE, 'A', "Sonntag"}, + {-1000L, 'A', "Donnerstag"}, + {new Date(1147327147578L), 'A', "Donnerstag"}, + {paris, 'A', "Montag"}, + {china, 'A', "Montag"}, + {0L, 'B', "Januar"}, + {Long.MAX_VALUE, 'B', "August"}, + {-1000L, 'B', "Januar"}, + {new Date(1147327147578L), 'B', "Mai"}, + {paris, 'B', "Mai"}, + {china, 'B', "Mai"}, + {0L, 'C', "19"}, + {Long.MAX_VALUE, 'C', "2922789"}, + {-1000L, 'C', "19"}, + {new Date(1147327147578L), 'C', "20"}, + {paris, 'C', "20"}, + {china, 'C', "20"}, + {0L, 'D', "01/01/70"}, + {Long.MAX_VALUE, 'D', "08/17/94"}, + {-1000L, 'D', "01/01/70"}, + {new Date(1147327147578L), 'D', "05/11/06"}, + {paris, 'D', "05/08/06"}, + {china, 'D', "05/08/06"}, + {0L, 'F', "1970-01-01"}, + {Long.MAX_VALUE, 'F', "292278994-08-17"}, + {-1000L, 'F', "1970-01-01"}, + {new Date(1147327147578L), 'F', "2006-05-11"}, + {paris, 'F', "2006-05-08"}, + {china, 'F', "2006-05-08"}, + {0L, 'H', "08"}, + {Long.MAX_VALUE, 'H', "15"}, + {-1000L, 'H', "07"}, + {new Date(1147327147578L), 'H', "13"}, + {paris, 'H', "12"}, + {china, 'H', "12"}, + {0L, 'I', "08"}, + {Long.MAX_VALUE, 'I', "03"}, + {-1000L, 'I', "07"}, + {new Date(1147327147578L), 'I', "01"}, + {paris, 'I', "12"}, + {china, 'I', "12"}, + {0L, 'L', "000"}, + {Long.MAX_VALUE, 'L', "807"}, + {-1000L, 'L', "000"}, + {new Date(1147327147578L), 'L', "578"}, + {paris, 'L', "453"}, + {china, 'L', "609"}, + {0L, 'M', "00"}, + // {Long.MAX_VALUE, 'M', "12"}, + {Long.MAX_VALUE, 'M', "18"}, + {-1000L, 'M', "59"}, + {new Date(1147327147578L), 'M', "59"}, + {paris, 'M', "00"}, + {china, 'M', "00"}, + {0L, 'N', "000000000"}, + {Long.MAX_VALUE, 'N', "807000000"}, + {-1000L, 'N', "000000000"}, + {new Date(1147327147578L), 'N', "578000000"}, + {paris, 'N', "609000000"}, + {china, 'N', "609000000"}, + {0L, 'Q', "0"}, + {Long.MAX_VALUE, 'Q', "9223372036854775807"}, + {-1000L, 'Q', "-1000"}, + {new Date(1147327147578L), 'Q', "1147327147578"}, + {paris, 'Q', "1147082400453"}, + {china, 'Q', "1147118400609"}, + {0L, 'R', "08:00"}, + // {Long.MAX_VALUE, 'R', "15:12"}, + {Long.MAX_VALUE, 'R', "15:18"}, + {-1000L, 'R', "07:59"}, + {new Date(1147327147578L), 'R', "13:59"}, + {paris, 'R', "12:00"}, + {china, 'R', "12:00"}, + {0L, 'S', "00"}, + // {Long.MAX_VALUE, 'S', "55"}, + {Long.MAX_VALUE, 'S', "47"}, + {-1000L, 'S', "59"}, + {new Date(1147327147578L), 'S', "07"}, + {paris, 'S', "00"}, + {china, 'S', "00"}, + {0L, 'T', "08:00:00"}, + // {Long.MAX_VALUE, 'T', "15:12:55"}, + {Long.MAX_VALUE, 'T', "15:18:47"}, + {-1000L, 'T', "07:59:59"}, + {new Date(1147327147578L), 'T', "13:59:07"}, + {paris, 'T', "12:00:00"}, + {china, 'T', "12:00:00"}, + {0L, 'Y', "1970"}, + {Long.MAX_VALUE, 'Y', "292278994"}, + {-1000L, 'Y', "1970"}, + {new Date(1147327147578L), 'Y', "2006"}, + {paris, 'Y', "2006"}, + {china, 'Y', "2006"}, + {0L, 'Z', "GMT+08:00"}, + {Long.MAX_VALUE, 'Z', "GMT+08:00"}, + {-1000L, 'Z', "GMT+08:00"}, + {new Date(1147327147578L), 'Z', "GMT+08:00"}, + {paris, 'Z', "MESZ"}, + {china, 'Z', "GMT-08:00"}, }; final Object[][] upperCaseFranceTriple = { - {0L, 'A', "jeudi"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'A', "dimanche"}, //$NON-NLS-2$ - {-1000L, 'A', "jeudi"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'A', "jeudi"}, //$NON-NLS-2$ - {paris, 'A', "lundi"}, //$NON-NLS-2$ - {china, 'A', "lundi"}, //$NON-NLS-2$ - {0L, 'B', "janvier"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'B', "ao\u00fbt"}, //$NON-NLS-2$ - {-1000L, 'B', "janvier"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'B', "mai"}, //$NON-NLS-2$ - {paris, 'B', "mai"}, //$NON-NLS-2$ - {china, 'B', "mai"}, //$NON-NLS-2$ - {0L, 'C', "19"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'C', "2922789"}, //$NON-NLS-2$ - {-1000L, 'C', "19"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'C', "20"}, //$NON-NLS-2$ - {paris, 'C', "20"}, //$NON-NLS-2$ - {china, 'C', "20"}, //$NON-NLS-2$ - {0L, 'D', "01/01/70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'D', "08/17/94"}, //$NON-NLS-2$ - {-1000L, 'D', "01/01/70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'D', "05/11/06"}, //$NON-NLS-2$ - {paris, 'D', "05/08/06"}, //$NON-NLS-2$ - {china, 'D', "05/08/06"}, //$NON-NLS-2$ - {0L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'F', "292278994-08-17"}, //$NON-NLS-2$ - {-1000L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'F', "2006-05-11"}, //$NON-NLS-2$ - {paris, 'F', "2006-05-08"}, //$NON-NLS-2$ - {china, 'F', "2006-05-08"}, //$NON-NLS-2$ - {0L, 'H', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'H', "15"}, //$NON-NLS-2$ - {-1000L, 'H', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'H', "13"}, //$NON-NLS-2$ - {paris, 'H', "12"}, //$NON-NLS-2$ - {china, 'H', "12"}, //$NON-NLS-2$ - {0L, 'I', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'I', "03"}, //$NON-NLS-2$ - {-1000L, 'I', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'I', "01"}, //$NON-NLS-2$ - {paris, 'I', "12"}, //$NON-NLS-2$ - {china, 'I', "12"}, //$NON-NLS-2$ - {0L, 'L', "000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'L', "807"}, //$NON-NLS-2$ - {-1000L, 'L', "000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'L', "578"}, //$NON-NLS-2$ - {paris, 'L', "453"}, //$NON-NLS-2$ - {china, 'L', "609"}, //$NON-NLS-2$ - {0L, 'M', "00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'M', "12"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'M', "18"}, //$NON-NLS-2$ - {-1000L, 'M', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'M', "59"}, //$NON-NLS-2$ - {paris, 'M', "00"}, //$NON-NLS-2$ - {china, 'M', "00"}, //$NON-NLS-2$ - {0L, 'N', "000000000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'N', "807000000"}, //$NON-NLS-2$ - {-1000L, 'N', "000000000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'N', "578000000"}, //$NON-NLS-2$ - {paris, 'N', "453000000"}, //$NON-NLS-2$ - {china, 'N', "468000000"}, //$NON-NLS-2$ - {0L, 'Q', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Q', "9223372036854775807"}, //$NON-NLS-2$ - {-1000L, 'Q', "-1000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Q', "1147327147578"}, //$NON-NLS-2$ - {paris, 'Q', "1147082400453"}, //$NON-NLS-2$ - {china, 'Q', "1147118400609"}, //$NON-NLS-2$ - {0L, 'R', "08:00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'R', "15:12"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'R', "15:18"}, //$NON-NLS-2$ - {-1000L, 'R', "07:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'R', "13:59"}, //$NON-NLS-2$ - {paris, 'R', "12:00"}, //$NON-NLS-2$ - {china, 'R', "12:00"}, //$NON-NLS-2$ - {0L, 'S', "00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'S', "55"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'S', "47"}, //$NON-NLS-2$ - {-1000L, 'S', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'S', "07"}, //$NON-NLS-2$ - {paris, 'S', "00"}, //$NON-NLS-2$ - {china, 'S', "00"}, //$NON-NLS-2$ - {0L, 'T', "08:00:00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'T', "15:12:55"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'T', "15:18:47"}, //$NON-NLS-2$ - {-1000L, 'T', "07:59:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'T', "13:59:07"}, //$NON-NLS-2$ - {paris, 'T', "12:00:00"}, //$NON-NLS-2$ - {china, 'T', "12:00:00"}, //$NON-NLS-2$ - {0L, 'Y', "1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Y', "292278994"}, //$NON-NLS-2$ - {-1000L, 'Y', "1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Y', "2006"}, //$NON-NLS-2$ - {paris, 'Y', "2006"}, //$NON-NLS-2$ - {china, 'Y', "2006"}, //$NON-NLS-2$ - {0L, 'Z', "UTC+08:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Z', "UTC+08:00"}, //$NON-NLS-2$ - {-1000L, 'Z', "UTC+08:00"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Z', "UTC+08:00"}, //$NON-NLS-2$ - {paris, 'Z', "HAEC"}, //$NON-NLS-2$ - {china, 'Z', "UTC-08:00"}, //$NON-NLS-2$ + {0L, 'A', "jeudi"}, + {Long.MAX_VALUE, 'A', "dimanche"}, + {-1000L, 'A', "jeudi"}, + {new Date(1147327147578L), 'A', "jeudi"}, + {paris, 'A', "lundi"}, + {china, 'A', "lundi"}, + {0L, 'B', "janvier"}, + {Long.MAX_VALUE, 'B', "ao\u00fbt"}, + {-1000L, 'B', "janvier"}, + {new Date(1147327147578L), 'B', "mai"}, + {paris, 'B', "mai"}, + {china, 'B', "mai"}, + {0L, 'C', "19"}, + {Long.MAX_VALUE, 'C', "2922789"}, + {-1000L, 'C', "19"}, + {new Date(1147327147578L), 'C', "20"}, + {paris, 'C', "20"}, + {china, 'C', "20"}, + {0L, 'D', "01/01/70"}, + {Long.MAX_VALUE, 'D', "08/17/94"}, + {-1000L, 'D', "01/01/70"}, + {new Date(1147327147578L), 'D', "05/11/06"}, + {paris, 'D', "05/08/06"}, + {china, 'D', "05/08/06"}, + {0L, 'F', "1970-01-01"}, + {Long.MAX_VALUE, 'F', "292278994-08-17"}, + {-1000L, 'F', "1970-01-01"}, + {new Date(1147327147578L), 'F', "2006-05-11"}, + {paris, 'F', "2006-05-08"}, + {china, 'F', "2006-05-08"}, + {0L, 'H', "08"}, + {Long.MAX_VALUE, 'H', "15"}, + {-1000L, 'H', "07"}, + {new Date(1147327147578L), 'H', "13"}, + {paris, 'H', "12"}, + {china, 'H', "12"}, + {0L, 'I', "08"}, + {Long.MAX_VALUE, 'I', "03"}, + {-1000L, 'I', "07"}, + {new Date(1147327147578L), 'I', "01"}, + {paris, 'I', "12"}, + {china, 'I', "12"}, + {0L, 'L', "000"}, + {Long.MAX_VALUE, 'L', "807"}, + {-1000L, 'L', "000"}, + {new Date(1147327147578L), 'L', "578"}, + {paris, 'L', "453"}, + {china, 'L', "609"}, + {0L, 'M', "00"}, + // {Long.MAX_VALUE, 'M', "12"}, + {Long.MAX_VALUE, 'M', "18"}, + {-1000L, 'M', "59"}, + {new Date(1147327147578L), 'M', "59"}, + {paris, 'M', "00"}, + {china, 'M', "00"}, + {0L, 'N', "000000000"}, + {Long.MAX_VALUE, 'N', "807000000"}, + {-1000L, 'N', "000000000"}, + {new Date(1147327147578L), 'N', "578000000"}, + {paris, 'N', "453000000"}, + {china, 'N', "468000000"}, + {0L, 'Q', "0"}, + {Long.MAX_VALUE, 'Q', "9223372036854775807"}, + {-1000L, 'Q', "-1000"}, + {new Date(1147327147578L), 'Q', "1147327147578"}, + {paris, 'Q', "1147082400453"}, + {china, 'Q', "1147118400609"}, + {0L, 'R', "08:00"}, + // {Long.MAX_VALUE, 'R', "15:12"}, + {Long.MAX_VALUE, 'R', "15:18"}, + {-1000L, 'R', "07:59"}, + {new Date(1147327147578L), 'R', "13:59"}, + {paris, 'R', "12:00"}, + {china, 'R', "12:00"}, + {0L, 'S', "00"}, + // {Long.MAX_VALUE, 'S', "55"}, + {Long.MAX_VALUE, 'S', "47"}, + {-1000L, 'S', "59"}, + {new Date(1147327147578L), 'S', "07"}, + {paris, 'S', "00"}, + {china, 'S', "00"}, + {0L, 'T', "08:00:00"}, + // {Long.MAX_VALUE, 'T', "15:12:55"}, + {Long.MAX_VALUE, 'T', "15:18:47"}, + {-1000L, 'T', "07:59:59"}, + {new Date(1147327147578L), 'T', "13:59:07"}, + {paris, 'T', "12:00:00"}, + {china, 'T', "12:00:00"}, + {0L, 'Y', "1970"}, + {Long.MAX_VALUE, 'Y', "292278994"}, + {-1000L, 'Y', "1970"}, + {new Date(1147327147578L), 'Y', "2006"}, + {paris, 'Y', "2006"}, + {china, 'Y', "2006"}, + {0L, 'Z', "UTC+08:00"}, + {Long.MAX_VALUE, 'Z', "UTC+08:00"}, + {-1000L, 'Z', "UTC+08:00"}, + {new Date(1147327147578L), 'Z', "UTC+08:00"}, + {paris, 'Z', "HAEC"}, + {china, 'Z', "UTC-08:00"}, }; final Object[][] upperCaseCzechTriple = { - {0L, 'A', "\u010dtvrtek"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'A', "ned\u011ble"}, //$NON-NLS-2$ - {-1000L, 'A', "\u010dtvrtek"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'A', "\u010dtvrtek"}, //$NON-NLS-2$ - {paris, 'A', "pond\u011bl\u00ed"}, //$NON-NLS-2$ - {china, 'A', "pond\u011bl\u00ed"}, //$NON-NLS-2$ - {0L, 'B', "ledna"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'B', "srpna"}, //$NON-NLS-2$ - {-1000L, 'B', "ledna"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'B', "kv\u011btna"}, //$NON-NLS-2$ - {paris, 'B', "kv\u011btna"}, //$NON-NLS-2$ - {china, 'B', "kv\u011btna"}, //$NON-NLS-2$ - {0L, 'C', "19"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'C', "2922789"}, //$NON-NLS-2$ - {-1000L, 'C', "19"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'C', "20"}, //$NON-NLS-2$ - {paris, 'C', "20"}, //$NON-NLS-2$ - {china, 'C', "20"}, //$NON-NLS-2$ - {0L, 'D', "01/01/70"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'D', "08/17/94"}, //$NON-NLS-2$ - {-1000L, 'D', "01/01/70"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'D', "05/11/06"}, //$NON-NLS-2$ - {paris, 'D', "05/08/06"}, //$NON-NLS-2$ - {china, 'D', "05/08/06"}, //$NON-NLS-2$ - {0L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'F', "292278994-08-17"}, //$NON-NLS-2$ - {-1000L, 'F', "1970-01-01"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'F', "2006-05-11"}, //$NON-NLS-2$ - {paris, 'F', "2006-05-08"}, //$NON-NLS-2$ - {china, 'F', "2006-05-08"}, //$NON-NLS-2$ - {0L, 'H', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'H', "15"}, //$NON-NLS-2$ - {-1000L, 'H', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'H', "13"}, //$NON-NLS-2$ - {paris, 'H', "12"}, //$NON-NLS-2$ - {china, 'H', "12"}, //$NON-NLS-2$ - {0L, 'I', "08"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'I', "03"}, //$NON-NLS-2$ - {-1000L, 'I', "07"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'I', "01"}, //$NON-NLS-2$ - {paris, 'I', "12"}, //$NON-NLS-2$ - {china, 'I', "12"}, //$NON-NLS-2$ - {0L, 'L', "000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'L', "807"}, //$NON-NLS-2$ - {-1000L, 'L', "000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'L', "578"}, //$NON-NLS-2$ - {paris, 'L', "453"}, //$NON-NLS-2$ - {china, 'L', "609"}, //$NON-NLS-2$ - {0L, 'M', "00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'M', "12"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'M', "18"}, //$NON-NLS-2$ - {-1000L, 'M', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'M', "59"}, //$NON-NLS-2$ - {paris, 'M', "00"}, //$NON-NLS-2$ - {china, 'M', "00"}, //$NON-NLS-2$ - {0L, 'N', "000000000"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'N', "807000000"}, //$NON-NLS-2$ - {-1000L, 'N', "000000000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'N', "578000000"}, //$NON-NLS-2$ - {paris, 'N', "453000000"}, //$NON-NLS-2$ - {china, 'N', "468000000"}, //$NON-NLS-2$ - {0L, 'Q', "0"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Q', "9223372036854775807"}, //$NON-NLS-2$ - {-1000L, 'Q', "-1000"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Q', "1147327147578"}, //$NON-NLS-2$ - {paris, 'Q', "1147082400453"}, //$NON-NLS-2$ - {china, 'Q', "1147118400609"}, //$NON-NLS-2$ - {0L, 'R', "08:00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'R', "15:12"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'R', "15:18"}, //$NON-NLS-2$ - {-1000L, 'R', "07:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'R', "13:59"}, //$NON-NLS-2$ - {paris, 'R', "12:00"}, //$NON-NLS-2$ - {china, 'R', "12:00"}, //$NON-NLS-2$ - {0L, 'S', "00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'S', "55"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'S', "47"}, //$NON-NLS-2$ - {-1000L, 'S', "59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'S', "07"}, //$NON-NLS-2$ - {paris, 'S', "00"}, //$NON-NLS-2$ - {china, 'S', "00"}, //$NON-NLS-2$ - {0L, 'T', "08:00:00"}, //$NON-NLS-2$ - // {Long.MAX_VALUE, 'T', "15:12:55"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'T', "15:18:47"}, //$NON-NLS-2$ - {-1000L, 'T', "07:59:59"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'T', "13:59:07"}, //$NON-NLS-2$ - {paris, 'T', "12:00:00"}, //$NON-NLS-2$ - {china, 'T', "12:00:00"}, //$NON-NLS-2$ - {0L, 'Y', "1970"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Y', "292278994"}, //$NON-NLS-2$ - {-1000L, 'Y', "1970"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Y', "2006"}, //$NON-NLS-2$ - {paris, 'Y', "2006"}, //$NON-NLS-2$ - {china, 'Y', "2006"}, //$NON-NLS-2$ - {0L, 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {Long.MAX_VALUE, 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {-1000L, 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {new Date(1147327147578L), 'Z', "GMT+08:00"}, //$NON-NLS-2$ - {paris, 'Z', "GMT+02:00"}, //$NON-NLS-2$ - {china, 'Z', "GMT-08:00"}, //$NON-NLS-2$ + {0L, 'A', "\u010dtvrtek"}, + {Long.MAX_VALUE, 'A', "ned\u011ble"}, + {-1000L, 'A', "\u010dtvrtek"}, + {new Date(1147327147578L), 'A', "\u010dtvrtek"}, + {paris, 'A', "pond\u011bl\u00ed"}, + {china, 'A', "pond\u011bl\u00ed"}, + {0L, 'B', "ledna"}, + {Long.MAX_VALUE, 'B', "srpna"}, + {-1000L, 'B', "ledna"}, + {new Date(1147327147578L), 'B', "kv\u011btna"}, + {paris, 'B', "kv\u011btna"}, + {china, 'B', "kv\u011btna"}, + {0L, 'C', "19"}, + {Long.MAX_VALUE, 'C', "2922789"}, + {-1000L, 'C', "19"}, + {new Date(1147327147578L), 'C', "20"}, + {paris, 'C', "20"}, + {china, 'C', "20"}, + {0L, 'D', "01/01/70"}, + {Long.MAX_VALUE, 'D', "08/17/94"}, + {-1000L, 'D', "01/01/70"}, + {new Date(1147327147578L), 'D', "05/11/06"}, + {paris, 'D', "05/08/06"}, + {china, 'D', "05/08/06"}, + {0L, 'F', "1970-01-01"}, + {Long.MAX_VALUE, 'F', "292278994-08-17"}, + {-1000L, 'F', "1970-01-01"}, + {new Date(1147327147578L), 'F', "2006-05-11"}, + {paris, 'F', "2006-05-08"}, + {china, 'F', "2006-05-08"}, + {0L, 'H', "08"}, + {Long.MAX_VALUE, 'H', "15"}, + {-1000L, 'H', "07"}, + {new Date(1147327147578L), 'H', "13"}, + {paris, 'H', "12"}, + {china, 'H', "12"}, + {0L, 'I', "08"}, + {Long.MAX_VALUE, 'I', "03"}, + {-1000L, 'I', "07"}, + {new Date(1147327147578L), 'I', "01"}, + {paris, 'I', "12"}, + {china, 'I', "12"}, + {0L, 'L', "000"}, + {Long.MAX_VALUE, 'L', "807"}, + {-1000L, 'L', "000"}, + {new Date(1147327147578L), 'L', "578"}, + {paris, 'L', "453"}, + {china, 'L', "609"}, + {0L, 'M', "00"}, + // {Long.MAX_VALUE, 'M', "12"}, + {Long.MAX_VALUE, 'M', "18"}, + {-1000L, 'M', "59"}, + {new Date(1147327147578L), 'M', "59"}, + {paris, 'M', "00"}, + {china, 'M', "00"}, + {0L, 'N', "000000000"}, + {Long.MAX_VALUE, 'N', "807000000"}, + {-1000L, 'N', "000000000"}, + {new Date(1147327147578L), 'N', "578000000"}, + {paris, 'N', "453000000"}, + {china, 'N', "468000000"}, + {0L, 'Q', "0"}, + {Long.MAX_VALUE, 'Q', "9223372036854775807"}, + {-1000L, 'Q', "-1000"}, + {new Date(1147327147578L), 'Q', "1147327147578"}, + {paris, 'Q', "1147082400453"}, + {china, 'Q', "1147118400609"}, + {0L, 'R', "08:00"}, + // {Long.MAX_VALUE, 'R', "15:12"}, + {Long.MAX_VALUE, 'R', "15:18"}, + {-1000L, 'R', "07:59"}, + {new Date(1147327147578L), 'R', "13:59"}, + {paris, 'R', "12:00"}, + {china, 'R', "12:00"}, + {0L, 'S', "00"}, + // {Long.MAX_VALUE, 'S', "55"}, + {Long.MAX_VALUE, 'S', "47"}, + {-1000L, 'S', "59"}, + {new Date(1147327147578L), 'S', "07"}, + {paris, 'S', "00"}, + {china, 'S', "00"}, + {0L, 'T', "08:00:00"}, + // {Long.MAX_VALUE, 'T', "15:12:55"}, + {Long.MAX_VALUE, 'T', "15:18:47"}, + {-1000L, 'T', "07:59:59"}, + {new Date(1147327147578L), 'T', "13:59:07"}, + {paris, 'T', "12:00:00"}, + {china, 'T', "12:00:00"}, + {0L, 'Y', "1970"}, + {Long.MAX_VALUE, 'Y', "292278994"}, + {-1000L, 'Y', "1970"}, + {new Date(1147327147578L), 'Y', "2006"}, + {paris, 'Y', "2006"}, + {china, 'Y', "2006"}, + {0L, 'Z', "GMT+08:00"}, + {Long.MAX_VALUE, 'Z', "GMT+08:00"}, + {-1000L, 'Z', "GMT+08:00"}, + {new Date(1147327147578L), 'Z', "GMT+08:00"}, + {paris, 'Z', "GMT+02:00"}, + {china, 'Z', "GMT-08:00"}, }; assertEquals(upperCaseGermanTriple.length, upperCaseFranceTriple.length); assertEquals(upperCaseGermanTriple.length, upperCaseCzechTriple.length); for (int i = 0; i < upperCaseGermanTriple.length; i++) { - String formatSpecifier = "%t" + upperCaseGermanTriple[i][pattern]; //$NON-NLS-2$ - String formatSpecifierUpper = "%T" + upperCaseGermanTriple[i][pattern]; //$NON-NLS-2$ + String formatSpecifier = "%t" + upperCaseGermanTriple[i][pattern]; + String formatSpecifierUpper = "%T" + upperCaseGermanTriple[i][pattern]; if ((Character)upperCaseGermanTriple[i][pattern] == 'N') { // result can't be predicted on RI, so skip this test continue; @@ -2764,52 +2764,52 @@ public class FormatterTest extends TestCase { // test '%t' f = new Formatter(new Locale("cs", "CZ")); f.format(formatSpecifier, upperCaseCzechTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + upperCaseCzechTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + upperCaseCzechTriple[i][input], upperCaseCzechTriple[i][output], f.toString()); f = new Formatter(new Locale("cs", "CZ")); f.format(Locale.GERMAN, formatSpecifier, upperCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + upperCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + upperCaseGermanTriple[i][input], upperCaseGermanTriple[i][output], f.toString()); f = new Formatter(new Locale("cs", "CZ")); f.format(Locale.FRANCE, formatSpecifier, upperCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifier //$NON-NLS-2$ - + " Argument: " + upperCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifier + + " Argument: " + upperCaseFranceTriple[i][input], upperCaseFranceTriple[i][output], f.toString()); // test '%T' f = new Formatter(Locale.GERMAN); f.format(formatSpecifierUpper, upperCaseGermanTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + upperCaseGermanTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + upperCaseGermanTriple[i][input], ((String)upperCaseGermanTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(new Locale("cs", "CZ"), formatSpecifierUpper, upperCaseCzechTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + upperCaseCzechTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + upperCaseCzechTriple[i][input], ((String)upperCaseCzechTriple[i][output]) .toUpperCase(Locale.US), f.toString()); f = new Formatter(Locale.GERMAN); f.format(Locale.FRANCE, formatSpecifierUpper, upperCaseFranceTriple[i][input]); - assertEquals("Format pattern: " + formatSpecifierUpper //$NON-NLS-2$ - + " Argument: " + upperCaseFranceTriple[i][input], //$NON-NLS-2$ + assertEquals("Format pattern: " + formatSpecifierUpper + + " Argument: " + upperCaseFranceTriple[i][input], ((String)upperCaseFranceTriple[i][output]) .toUpperCase(Locale.US), f.toString()); } f = new Formatter(Locale.US); - f.format("%-10ta", now); //$NON-NLS-2$ - assertEquals("Thu ", f.toString()); //$NON-NLS-2$ + f.format("%-10ta", now); + assertEquals("Thu ", f.toString()); f = new Formatter(Locale.US); - f.format("%10000000000000000000000000000000001ta", now); //$NON-NLS-2$ - assertEquals("Thu", f.toString().trim()); //$NON-NLS-2$ + f.format("%10000000000000000000000000000000001ta", now); + assertEquals("Thu", f.toString().trim()); } /** @@ -2863,26 +2863,26 @@ public class FormatterTest extends TestCase { return; } final Object[][] tripleD = { - {new BigInteger("123456789012345678901234567890"), "%d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%10d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-1d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%+d", "+123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "% d", " 123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%,d", "123.456.789.012.345.678.901.234.567.890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%(d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%08d", "123456789012345678901234567890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-+,(11d", "+123.456.789.012.345.678.901.234.567.890"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%0 ,(11d", " 123.456.789.012.345.678.901.234.567.890"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%10d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-1d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%+d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "% d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%,d", "-9.876.543.210.987.654.321.098.765.432.100.000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%(d", "(9876543210987654321098765432100000)"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%08d", "-9876543210987654321098765432100000"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-+,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%0 ,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, //$NON-NLS-2$ + {new BigInteger("123456789012345678901234567890"), "%d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%10d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%-1d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%+d", "+123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "% d", " 123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%,d", "123.456.789.012.345.678.901.234.567.890"}, + {new BigInteger("123456789012345678901234567890"), "%(d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%08d", "123456789012345678901234567890"}, + {new BigInteger("123456789012345678901234567890"), "%-+,(11d", "+123.456.789.012.345.678.901.234.567.890"}, + {new BigInteger("123456789012345678901234567890"), "%0 ,(11d", " 123.456.789.012.345.678.901.234.567.890"}, + {new BigInteger("-9876543210987654321098765432100000"), "%d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%10d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-1d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%+d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "% d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%,d", "-9.876.543.210.987.654.321.098.765.432.100.000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%(d", "(9876543210987654321098765432100000)"}, + {new BigInteger("-9876543210987654321098765432100000"), "%08d", "-9876543210987654321098765432100000"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-+,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, + {new BigInteger("-9876543210987654321098765432100000"), "%0 ,(11d", "(9.876.543.210.987.654.321.098.765.432.100.000)"}, }; final int input = 0; @@ -2900,18 +2900,18 @@ public class FormatterTest extends TestCase { } final Object[][] tripleO = { - {new BigInteger("123456789012345678901234567890"), "%o", "143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-6o", "143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%08o", "143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%#o", "0143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%0#11o", "0143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-#9o", "0143564417755415637016711617605322"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%o", "-36336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-6o", "-36336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%08o", "-36336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%#o", "-036336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%0#11o", "-036336340043453651353467270113157312240"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-#9o", "-036336340043453651353467270113157312240"}, //$NON-NLS-2$ + {new BigInteger("123456789012345678901234567890"), "%o", "143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%-6o", "143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%08o", "143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%#o", "0143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%0#11o", "0143564417755415637016711617605322"}, + {new BigInteger("123456789012345678901234567890"), "%-#9o", "0143564417755415637016711617605322"}, + {new BigInteger("-9876543210987654321098765432100000"), "%o", "-36336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-6o", "-36336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%08o", "-36336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%#o", "-036336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%0#11o", "-036336340043453651353467270113157312240"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-#9o", "-036336340043453651353467270113157312240"}, }; for (int i = 0; i < tripleO.length; i++) { f = new Formatter(Locale.ITALY); @@ -2924,18 +2924,18 @@ public class FormatterTest extends TestCase { } final Object[][] tripleX = { - {new BigInteger("123456789012345678901234567890"), "%x", "18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-8x", "18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%06x", "18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%#x", "0x18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%0#12x", "0x18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("123456789012345678901234567890"), "%-#9x", "0x18ee90ff6c373e0ee4e3f0ad2"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%x", "-1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-8x", "-1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%06x", "-1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%#x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%0#12x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ - {new BigInteger("-9876543210987654321098765432100000"), "%-#9x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, //$NON-NLS-2$ + {new BigInteger("123456789012345678901234567890"), "%x", "18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%-8x", "18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%06x", "18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%#x", "0x18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%0#12x", "0x18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("123456789012345678901234567890"), "%-#9x", "0x18ee90ff6c373e0ee4e3f0ad2"}, + {new BigInteger("-9876543210987654321098765432100000"), "%x", "-1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-8x", "-1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%06x", "-1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%#x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%0#12x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, + {new BigInteger("-9876543210987654321098765432100000"), "%-#9x", "-0x1e6f380472bd4bae6eb8259bd94a0"}, }; for (int i = 0; i < tripleX.length; i++) { diff --git a/luni/src/test/java/tests/api/java/util/LocaleTest.java b/luni/src/test/java/tests/api/java/util/LocaleTest.java index fdd3d5e..49f518b 100644 --- a/luni/src/test/java/tests/api/java/util/LocaleTest.java +++ b/luni/src/test/java/tests/api/java/util/LocaleTest.java @@ -239,12 +239,12 @@ public class LocaleTest extends junit.framework.TestCase { .getDisplayCountry().equals("Canada")); // Regression for Harmony-1146 - Locale l_countryCD = new Locale("", "CD"); //$NON-NLS-1$ //$NON-NLS-2$ + Locale l_countryCD = new Locale("", "CD"); // BEGIN android-changed // ICU has different display name for countries -// assertEquals("The Democratic Republic Of Congo", //$NON-NLS-1$ +// assertEquals("The Democratic Republic Of Congo", // l_countryCD.getDisplayCountry()); - assertEquals("Congo - Kinshasa", //$NON-NLS-1$ + assertEquals("Congo - Kinshasa", l_countryCD.getDisplayCountry()); // END android-changed } @@ -287,8 +287,8 @@ public class LocaleTest extends junit.framework.TestCase { .getDisplayLanguage().equals("English")); // Regression for Harmony-1146 - Locale l_languageAE = new Locale("ae", ""); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("Avestan", l_languageAE.getDisplayLanguage()); //$NON-NLS-1$ + Locale l_languageAE = new Locale("ae", ""); + assertEquals("Avestan", l_languageAE.getDisplayLanguage()); } /** @@ -427,12 +427,12 @@ public class LocaleTest extends junit.framework.TestCase { assertEquals("ave", l.getISO3Language()); // Regression for Harmony-1146 - Locale l_CountryCS = new Locale("", "CS"); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("SCG", l_CountryCS.getISO3Country()); //$NON-NLS-1$ + Locale l_CountryCS = new Locale("", "CS"); + assertEquals("SCG", l_CountryCS.getISO3Country()); // Regression for Harmony-1129 - l = new Locale("ak", ""); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("aka", l.getISO3Language()); //$NON-NLS-1$ + l = new Locale("ak", ""); + assertEquals("aka", l.getISO3Language()); Locale x = new Locale("xx", "C"); try { diff --git a/luni/src/test/java/tests/api/java/util/PriorityQueueTest.java b/luni/src/test/java/tests/api/java/util/PriorityQueueTest.java index 3efb705..07bfa65 100644 --- a/luni/src/test/java/tests/api/java/util/PriorityQueueTest.java +++ b/luni/src/test/java/tests/api/java/util/PriorityQueueTest.java @@ -39,7 +39,7 @@ import junit.framework.TestCase; @TestTargetClass(PriorityQueue.class) public class PriorityQueueTest extends TestCase { - private static final String SERIALIZATION_FILE_NAME = "/serialization/tests/api/java/util/PriorityQueue.golden.ser"; //$NON-NLS-1$ + private static final String SERIALIZATION_FILE_NAME = "/serialization/tests/api/java/util/PriorityQueue.golden.ser"; /** * @tests java.util.PriorityQueue#iterator() diff --git a/luni/src/test/java/tests/api/java/util/TreeMapTest.java b/luni/src/test/java/tests/api/java/util/TreeMapTest.java index 0e7f6a1..0266a6c 100644 --- a/luni/src/test/java/tests/api/java/util/TreeMapTest.java +++ b/luni/src/test/java/tests/api/java/util/TreeMapTest.java @@ -688,20 +688,20 @@ public class TreeMapTest extends junit.framework.TestCase { // Regression for Harmony-1161 TreeMap<String, String> treeMapWithNull = new TreeMap<String, String>( new MockComparatorNullTolerable()); - treeMapWithNull.put("key1", "value1"); //$NON-NLS-1$ //$NON-NLS-2$ - treeMapWithNull.put(null, "value2"); //$NON-NLS-1$ + treeMapWithNull.put("key1", "value1"); + treeMapWithNull.put(null, "value2"); SortedMap<String, String> subMapWithNull = treeMapWithNull.subMap(null, - "key1"); //$NON-NLS-1$ - assertEquals("Size of subMap should be 1:", 1, subMapWithNull.size()); //$NON-NLS-1$ + "key1"); + assertEquals("Size of subMap should be 1:", 1, subMapWithNull.size()); // Regression test for typo in lastKey method SortedMap<String, String> map = new TreeMap<String, String>(); - map.put("1", "one"); //$NON-NLS-1$ //$NON-NLS-2$ - map.put("2", "two"); //$NON-NLS-1$ //$NON-NLS-2$ - map.put("3", "three"); //$NON-NLS-1$ //$NON-NLS-2$ + map.put("1", "one"); + map.put("2", "two"); + map.put("3", "three"); assertEquals("3", map.lastKey()); - SortedMap<String, String> sub = map.subMap("1", "3"); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("2", sub.lastKey()); //$NON-NLS-1$ + SortedMap<String, String> sub = map.subMap("1", "3"); + assertEquals("2", sub.lastKey()); try { tm.subMap(this, this); |