@@ -0,0 +1,2608 @@
+/*%3Clicense%3E%0ACopyright 2004 - $Date: 2008-10-17 16:01:32 +0200 (Fri, 17 Oct 2008) $ by PeopleWare n.v..%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A%3C/license%3E*/%0A%0Apackage org.ppwcode.value_III.location;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.ppwcode.value_III.location.Country.NO_COUNTRY;%0Aimport static org.ppwcode.value_III.location.Country.VALUES;%0A%0Aimport java.beans.PropertyEditorManager;%0Aimport java.util.Locale;%0A%0Aimport org.junit.Test;%0A%0A%0Apublic class CountryTest %7B%0A%0A  @Test%0A  public void testCountry() %7B%0A    Country subject = new Country();%0A    assertEquals(%22BE%22, subject.getValue());%0A  %7D%0A%0A  @Test%0A  public void testVALUES() %7B%0A    assertNotNull(VALUES);%0A    assertFalse(VALUES.keySet().contains(null));%0A    assertFalse(VALUES.values().contains(null));%0A    for (String cc : VALUES.keySet()) %7B%0A      assertEquals(cc, VALUES.get(cc).getValue());%0A    %7D%0A    for (Country c : VALUES.values()) %7B%0A      assertTrue(%22not an ISO country code: %5C%22%22 + c + %22%5C%22%22, (! c.equals(NO_COUNTRY) ? contains(Locale.getISOCountries(), c.getValue()) : true));%0A    %7D%0A    for (String cc : Locale.getISOCountries()) %7B%0A      assertNotNull(VALUES.get(cc));%0A    %7D%0A  %7D%0A%0A  private %3C_T_%3E boolean contains(_T_%5B%5D countries, _T_ value) %7B%0A    for (_T_ _t_ : countries) %7B%0A      if (eqn(_t_, value)) %7B%0A        return true;%0A      %7D%0A    %7D%0A    return false;%0A  %7D%0A%0A  private %3C_T_%3E boolean eqn(_T_ one, _T_ other) %7B%0A    return (one == null) ? (other == null) : one.equals(other);%0A  %7D%0A%0A  @Test%0A  public void testNO_COUNTRY() %7B%0A    assertEquals(VALUES.get(%22 %22), NO_COUNTRY);%0A  %7D%0A%0A  @Test%0A  public void demo() %7B%0A    // there are no dutch translations in Java SE?!%0A    CountryEditor ce = (CountryEditor)PropertyEditorManager.findEditor(Country.class);%0A    ce.setDisplayLocale(new Locale(%22nl%22));%0A    System.out.println(%22nr of countries: %22 + VALUES.size());%0A    for (Country c : VALUES.values()) %7B%0A      System.out.print(c.toString() + %22: %22);%0A      ce.setValue(c);%0A      System.out.println(ce.getLabel());%0A    %7D%0A  %7D%0A%0A%7D%0A%0A

country test GREEN