|
1 |
| package photospace.space; |
|
2 |
| |
|
3 |
| import org.apache.commons.logging.*; |
|
4 |
| import junit.framework.*; |
|
5 |
| |
|
6 |
| public class LocatorTest |
|
7 |
| extends TestCase |
|
8 |
| { |
|
9 |
| private static final Log log = LogFactory.getLog(LocatorTest.class); |
|
10 |
| |
|
11 |
1
| public LocatorTest(String s)
|
|
12 |
| { |
|
13 |
1
| super(s);
|
|
14 |
| } |
|
15 |
| |
|
16 |
1
| public void testLocate() throws Exception
|
|
17 |
| { |
|
18 |
1
| Locator locator = new Locator();
|
|
19 |
| |
|
20 |
1
| Position failed = locator.locate("foo");
|
|
21 |
1
| assertNull(failed);
|
|
22 |
| |
|
23 |
1
| Position position = locator.locate("Mission & Valencia Sts, San Francisco CA");
|
|
24 |
1
| assertNotNull(position);
|
|
25 |
1
| assertEquals(new Double(37.74533), position.getLatitude());
|
|
26 |
1
| assertEquals(new Double(-122.420082), position.getLongitude());
|
|
27 |
| } |
|
28 |
| |
|
29 |
| } |