jdk/test/java/util/Locale/LocaleTest.java
changeset 12135 078775fa4b30
parent 10293 cdcbdd4c20b8
child 22627 93f110be9439
equal deleted inserted replaced
12132:65fbeb4ec7c3 12135:078775fa4b30
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    23 /**
    23 /**
    24  * @test
    24  * @test
    25  * @bug 4052404 4052440 4084688 4092475 4101316 4105828 4107014 4107953 4110613
    25  * @bug 4052404 4052440 4084688 4092475 4101316 4105828 4107014 4107953 4110613
    26  * 4118587 4118595 4122371 4126371 4126880 4135316 4135752 4139504 4139940 4143951
    26  * 4118587 4118595 4122371 4126371 4126880 4135316 4135752 4139504 4139940 4143951
    27  * 4147315 4147317 4147552 4335196 4778440 4940539 5010672 6475525 6544471 6627549
    27  * 4147315 4147317 4147552 4335196 4778440 4940539 5010672 6475525 6544471 6627549
    28  * 6786276 7066203
    28  * 6786276 7066203 7085757
    29  * @summary test Locales
    29  * @summary test Locales
    30  */
    30  */
    31 /*
    31 /*
    32  *
    32  *
    33  *
    33  *
   398         if (!gotException)
   398         if (!gotException)
   399             errln("getISO3Country() on xx_YY returned " + result + " instead of throwing an exception");
   399             errln("getISO3Country() on xx_YY returned " + result + " instead of throwing an exception");
   400     }
   400     }
   401 
   401 
   402     /**
   402     /**
   403      * @bug 4106155 4118587 7066203
   403      * @bug 4106155 4118587 7066203 7085757
   404      */
   404      */
   405     public void TestGetLangsAndCountries() {
   405     public void TestGetLangsAndCountries() {
   406         // It didn't seem right to just do an exhaustive test of everything here, so I check
   406         // It didn't seem right to just do an exhaustive test of everything here, so I check
   407         // for the following things:
   407         // for the following things:
   408         // 1) Does each list have the right total number of entries?
   408         // 1) Does each list have the right total number of entries?
   438 
   438 
   439         test = Locale.getISOCountries();
   439         test = Locale.getISOCountries();
   440         String[] spotCheck2 = { "US", "CA", "GB", "FR", "DE", "IT", "JP", "KR", "CN", "TW", "TH" };
   440         String[] spotCheck2 = { "US", "CA", "GB", "FR", "DE", "IT", "JP", "KR", "CN", "TW", "TH" };
   441 
   441 
   442 
   442 
   443         if (test.length != 249)
   443         if (test.length != 250)
   444             errln("Expected getISOCountries to return 249 countries; it returned " + test.length);
   444             errln("Expected getISOCountries to return 250 countries; it returned " + test.length);
   445         else {
   445         else {
   446             for (int i = 0; i < spotCheck2.length; i++) {
   446             for (int i = 0; i < spotCheck2.length; i++) {
   447                 int j;
   447                 int j;
   448                 for (j = 0; j < test.length; j++)
   448                 for (j = 0; j < test.length; j++)
   449                     if (test[j].equals(spotCheck2[i]))
   449                     if (test[j].equals(spotCheck2[i]))