package jeoip;

import java.io.IOException;

import org.junit.*;

import static org.junit.Assert.*;

public class JeoIPTest {
	JeoIP target;

	@Before
	public void setUp() throws Exception {
		target = new JeoIP();
	}

	@Test
	public void testIP() throws Exception {
		String country = target.getCountryName("www.darwinsys.com");
		assertEquals("Canada", country);
		country = target.getCountryName("www.staffs.ac.uk");
		assertEquals("United Kingdom", country);
		country = target.getCountryName("72.5.124.61"); // sun.com
		assertEquals("United States of America", country);
	}

	@After
	public void tearDown() throws IOException {
		if (target != null) {
			target.close();
		}
	}
}

@@ -236,18 +236,22 @@
 oid test
-IP
+Darwin
 () throw
@@ -273,23 +273,22 @@
 %09String 
-country
+actual
  = targe
@@ -351,35 +351,88 @@
 anada%22, 
-country);%0A%09%09country
+actual);%0A%09%7D%0A%09public void testStaffs() throws Exception %7B%0A%09%09String actual
  = targe
@@ -457,17 +457,11 @@
 www.
-staffs.ac
+gov
 .uk%22
@@ -500,27 +500,80 @@
 m%22, 
-country);%0A%09%09country
+actual);%0A%09%7D%0A%09public void testOracle() throws Exception %7B%0A%09%09String actual
  = t
@@ -667,15 +667,14 @@
 a%22, 
-country
+actual
 );%0A%09

Break test into 3 methods; work around weirdness in data