package com.maxmind.geoip;

/* CityLookupTest.java */

import static org.junit.Assert.assertEquals;

import java.io.IOException;

import org.junit.Test;

public class CityLookupIdxTest {
	private static final double DELTA = 1e-5;

	@Test
	public void testCityLookupIdx() throws IOException {

		LookupService cl = new LookupService(
				"/usr/share/GeoIP/GeoIPCity.dat",
				LookupService.GEOIP_INDEX_CACHE);

		Location l1 = cl.getLocation("131.130.1.11");

//		assertEquals("JP", l1.countryCode);
//		assertEquals("Japan", l1.countryName);
//		assertEquals("40", l1.region);
		assertEquals("Tokyo", l1.city);
		assertEquals(35.6850, l1.latitude, DELTA);
		assertEquals(139.7510, l1.longitude, DELTA);
		assertEquals(0, l1.metro_code);
		assertEquals(0, l1.area_code);
		cl.close();
	}

}

@@ -335,18 +335,26 @@
 %09%09%09%22
-/usr/share
+src/test/resources
 /Geo
@@ -447,27 +447,26 @@
 on(%22
-131.130.1.11
+222.230.137.0
 %22);%0A%0A
-//
 %09%09as
@@ -495,26 +495,24 @@
 untryCode);%0A
-//
 %09%09assertEqua
@@ -544,10 +544,8 @@
 e);%0A
-//
 %09%09as

Revert accidentally changes test case