Project

General

Profile

« Previous | Next » 

Revision f273d0d5

Added by Andreas Müller almost 14 years ago

specimen facade uses coordinate parser

View differences:

cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/facade/SpecimenFacadeTest.java
10 10
package eu.etaxonomy.cdm.api.facade;
11 11

  
12 12
import java.lang.reflect.Field;
13
import java.text.ParseException;
13 14
import java.util.List;
14 15

  
15 16
import org.apache.log4j.Logger;
......
307 308
	 * Test method for {@link eu.etaxonomy.cdm.api.facade.SpecimenFacade#getExactLocation()}.
308 309
	 */
309 310
	@Test
310
	public void testGetExactLocation() {
311
	public void testGetSetExactLocation() {
311 312
		Assert.assertNotNull("Exact location must not be null", specimenFacade.getExactLocation());	
312 313
		Assert.assertEquals("Exact location must be same", exactLocation, specimenFacade.getExactLocation());	
313 314
		specimenFacade.setExactLocation(null);
314 315
		Assert.assertNull("Exact location must be null", specimenFacade.getExactLocation());	
315 316
	}
317
	
318
	@Test
319
	public void testSetExactLocationByParsing(){
320
		Point point1;
321
		try {
322
			specimenFacade.setExactLocationByParsing("112?34'20\"W", "34?30,34'N", null, null);
323
			point1 = specimenFacade.getExactLocation();
324
			Assert.assertNotNull("", point1.getLatitude());
325
			System.out.println(point1.getLatitude().toString());
326
			Assert.assertTrue("", point1.getLatitude().toString().startsWith("34.505"));
327
			System.out.println(point1.getLongitude().toString());
328
			Assert.assertTrue("", point1.getLongitude().toString().startsWith("-112.5722"));
329
			
330
		} catch (ParseException e) {
331
			Assert.fail("No parsing error should occur");
332
		}
333
	}
316 334

  
317 335

  
318 336
	/**

Also available in: Unified diff