@@ -0,0 +1,2274 @@
+package com.maxmind.geoip2;%0A%0Aimport java.lang.*;%0Aimport java.util.*;%0Aimport java.io.*;%0Aimport org.json.*;%0A%0Aimport junit.framework.Test;%0Aimport junit.framework.TestCase;%0Aimport junit.framework.TestSuite;%0A%0Apublic class CityTest %0A    extends TestCase%0A%7B%0A    public CityTest( String testName )%0A    %7B%0A        super( testName );%0A    %7D%0A    public static Test suite()%0A    %7B%0A        return new TestSuite( CityTest.class );%0A    %7D%0A    private JSONObject createJSONCity() %7B%0A      StringBuilder sb = new StringBuilder();%0A      sb.append(%22%7B%22);%0A      sb.append(%22%5C%22location%5C%22:%7B%22);%0A      sb.append(%22%5C%22postal_code%5C%22:%5C%2212345%5C%22,%22);%0A      sb.append(%22%5C%22postal_confidence%5C%22:50,%22);%0A      sb.append(%22%5C%22time_zone%5C%22:%5C%22EST%5C%22,%22);%0A      sb.append(%22%5C%22longitude%5C%22:42.0,%22);%0A      sb.append(%22%5C%22latitude%5C%22:46.0,%22);%0A      sb.append(%22%5C%22metro_code%5C%22:843,%22);%0A      sb.append(%22%5C%22accuracy_radius%5C%22:20%22);%0A      sb.append(%22%7D%22);%0A      sb.append(%22%5C%22represented_country%5C%22:%7B%22);%0A      sb.append(%22type:%5C%22C%3Cmilitary%3E%5C%22%22);%0A      sb.append(%22%7D%22);      %0A      sb.append(%22%7D%22);%0A      String str = sb.toString();%0A      try %7B%0A        return new JSONObject(str);%0A      %7D catch (JSONException e) %7B%0A        fail(e.getMessage());%0A        return null;%0A      %7D%0A    %7D%0A    public void testCity() %7B%0A      JSONObject jcity = createJSONCity();%0A      City city = new City(jcity);%0A      assertEquals(%0A        %22city.getLocation().getPostalCode() does not return 12345%22,%0A         city.getLocation().getPostalCode(),%0A         %2212345%22);%0A      assertEquals(%0A        %22city.getLocation().getPostalConfidence() does not return 50%22,%0A         city.getLocation().getPostalConfidence(),%0A         new Integer(50));%0A      assertEquals(%0A        %22city.getLocation().getTimeZone() does not return EST%22,%0A         city.getLocation().getTimeZone(),%0A         %22EST%22);%0A      double longitude = city.getLocation().getLongitude();%0A      assertEquals(%0A        %22city.getLocation().getLongitude() does not return 42.0%22,longitude,42.0,0.1);%0A      double latitude = city.getLocation().getLatitude();%0A      assertEquals(%0A        %22city.getLocation().getLatitude() does not return 46.0%22,latitude,46.0,0.1);%0A%0A      assertEquals(%0A        %22city.getRepresentedCountry().getType() does not return C%3Cmilitary%3E%22, %0A        city.getRepresentedCountry().getType(),%22C%3Cmilitary%3E%22);%0A    %7D%0A%7D%0A%0A

add CityTest