1
|
/**
|
2
|
* Copyright (C) 2009 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.ext.geo;
|
10
|
|
11
|
import static org.junit.Assert.fail;
|
12
|
|
13
|
import javax.xml.stream.XMLStreamException;
|
14
|
|
15
|
import org.junit.Assert;
|
16
|
|
17
|
import org.apache.log4j.Logger;
|
18
|
import org.junit.Before;
|
19
|
import org.junit.BeforeClass;
|
20
|
import org.junit.Test;
|
21
|
|
22
|
/**
|
23
|
* @author a.mueller
|
24
|
* @since 12.08.2011
|
25
|
*
|
26
|
*/
|
27
|
public class GeoServiceAreaTest {
|
28
|
private static final Logger logger = Logger.getLogger(GeoServiceAreaTest.class);
|
29
|
|
30
|
/**
|
31
|
* @throws java.lang.Exception
|
32
|
*/
|
33
|
@BeforeClass
|
34
|
public static void setUpBeforeClass() throws Exception {
|
35
|
}
|
36
|
|
37
|
/**
|
38
|
* @throws java.lang.Exception
|
39
|
*/
|
40
|
@Before
|
41
|
public void setUp() throws Exception {
|
42
|
}
|
43
|
|
44
|
// ********************************** TESTS ****************************************
|
45
|
|
46
|
/**
|
47
|
* Test method for {@link eu.etaxonomy.cdm.ext.geo.GeoServiceArea#add(java.lang.String, java.lang.String, java.lang.String)}.
|
48
|
*/
|
49
|
@Test
|
50
|
public void testAdd() {
|
51
|
logger.warn("Not yet implemented");
|
52
|
}
|
53
|
|
54
|
/**
|
55
|
* Test method for {@link eu.etaxonomy.cdm.ext.geo.GeoServiceArea#getAreasMap()}.
|
56
|
*/
|
57
|
@Test
|
58
|
public void testGetAreas() {
|
59
|
logger.warn("Not yet implemented");
|
60
|
}
|
61
|
|
62
|
/**
|
63
|
* Test method for {@link eu.etaxonomy.cdm.ext.geo.GeoServiceArea#valueOf(java.lang.String)}.
|
64
|
*/
|
65
|
@Test
|
66
|
public void testValueOf() {
|
67
|
String input = "<?xml version=\"1.0\" ?><mapService xmlns=\"http://www.etaxonomy.eu/cdm\" type=\"editMapService\"><area><layer>vmap0_as_bnd_political_boundary_a</layer><field>nam</field><value>PULAU BANGKA#SUMATERA SELATAN</value></area></mapService>";
|
68
|
GeoServiceArea areas = GeoServiceArea.valueOf(input);
|
69
|
try {
|
70
|
Assert.assertNotNull("Result must not be null", areas);
|
71
|
Assert.assertEquals("Input string must be equal to output string", input, areas.toXml());
|
72
|
} catch (XMLStreamException e) {
|
73
|
fail();
|
74
|
}
|
75
|
}
|
76
|
|
77
|
/**
|
78
|
* Test method for {@link eu.etaxonomy.cdm.ext.geo.GeoServiceArea#toXml()}.
|
79
|
*/
|
80
|
@Test
|
81
|
public void testToXml() {
|
82
|
logger.warn("Not yet implemented");
|
83
|
}
|
84
|
|
85
|
}
|