Project

General

Profile

« Previous | Next » 

Revision 4dbcb616

Added by Andreas Müller over 3 years ago

cleanup and use TermTestBase for model tests

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/location/PointTest.java
8 8
*/
9 9
package eu.etaxonomy.cdm.model.location;
10 10

  
11

  
12 11
import java.text.ParseException;
13 12

  
14 13
import org.apache.log4j.Logger;
15 14
import org.junit.Assert;
16 15
import org.junit.Before;
17
import org.junit.BeforeClass;
18 16
import org.junit.Test;
19 17

  
20 18
import eu.etaxonomy.cdm.model.location.Point.Direction;
21 19
import eu.etaxonomy.cdm.model.location.Point.Sexagesimal;
22
import eu.etaxonomy.cdm.model.term.DefaultTermInitializer;
20
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
23 21

  
24 22
/**
25 23
 * @author a.mueller
26 24
 * @since 04.06.2010
27
 *
28 25
 */
29
public class PointTest {
26
public class PointTest extends EntityTestBase {
27

  
30 28
	@SuppressWarnings("unused")
31 29
	private static final Logger logger = Logger.getLogger(PointTest.class);
32 30

  
......
41 39

  
42 40
	private ReferenceSystem referenceSystem;
43 41

  
44

  
45
	/**
46
	 * @throws java.lang.Exception
47
	 */
48
	@BeforeClass
49
	public static void setUpBeforeClass() throws Exception {
50
		if (ReferenceSystem.WGS84() == null){
51
			new DefaultTermInitializer().initialize();
52
		}
53
	}
54

  
55
	/**
56
	 * @throws java.lang.Exception
57
	 */
58 42
	@Before
59 43
	public void setUp() throws Exception {
60 44
		longitude1 = 23.123556;
......
68 52

  
69 53
		point1 = Point.NewInstance(longitude1, latitude1, referenceSystem, errorRadius);
70 54
		point2 = Point.NewInstance();
71

  
72

  
73

  
74 55
	}
75 56

  
76 57
//********************** TESTS *****************************
......
140 121
		Sexagesimal sexagesimal1 = Sexagesimal.NewInstance(0, 0, 0, Direction.WEST);
141 122
		Sexagesimal sexagesimal2 = Sexagesimal.NewInstance(2, 2, 2, Direction.WEST);
142 123
		Assert.assertNotSame("", sexagesimal1, sexagesimal2);
143

  
144

  
145 124
	}
146 125

  
147 126
	@Test
......
187 166
		}
188 167

  
189 168

  
190

  
191

  
192

  
193

  
194

  
195

  
196 169
//		Assert.assertTrue("Southern must be negative", conversionResults.convertedCoord < 0);
197 170
//		Assert.assertFalse("Southern must be latitude", conversionResults.isLongitude);
198 171
//
......
285 258
			Assert.fail("No parsing error should occur");
286 259
		}
287 260
	}
288

  
289

  
290

  
291
}
261
}

Also available in: Unified diff