@@ -0,0 +1,662 @@
+/**%0A * %0A */%0Apackage cn.strong.leke.core.ip;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.springframework.core.io.ClassPathResource;%0A%0A/**%0A * @author liulongbiao%0A *%0A */%0Apublic class IPv4LocatorTest %7B%0A%0A%09private IPv4Locator locator;%0A%09%0A%09@Before%0A%09public void init() throws Exception %7B%0A%09%09ClassPathResource datFile = new ClassPathResource(%22data/qqwry.dat%22);%0A%09%09IPv4LocatorFactoryBean fb = new IPv4LocatorFactoryBean();%0A%09%09fb.setDatFile(datFile);%0A%09%09fb.afterPropertiesSet();%0A%09%09this.locator = fb.getObject();%0A%09%7D%0A%09%0A%09@Test%0A%09public void testLocate() %7B%0A%09%09IPv4 ip = IPv4.parse(%2239.184.174.243%22);%0A%09%09IPv4Loc loc = locator.locate(ip);%0A%09%09System.out.println(loc);%0A%09%7D%0A%0A%7D%0A

Test for IPv4Locator