Project

General

Profile

Download (1.15 KB) Statistics
| Branch: | Tag: | Revision:
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.io.jaxb;
10

    
11
import static org.junit.Assert.assertNotNull;
12

    
13
import java.io.InputStreamReader;
14
import eu.etaxonomy.cdm.common.URI;
15

    
16
import org.junit.Test;
17

    
18
import eu.etaxonomy.cdm.model.location.NamedArea;
19

    
20
public class NamedAreaTest {
21
		
22
	    private String resource = "/eu/etaxonomy/cdm/io/jaxb/NamedAreaTest.xml";
23
	    
24
	    @Test
25
	    public void testUnmarshalNamedArea() throws Exception {
26
	        CdmDocumentBuilder cdmDocumentBuilder = new CdmDocumentBuilder();
27
	        URI uri = new URI(URIEncoder.encode(this.getClass().getResource(resource).toString()));
28
	        DataSet dataSet = cdmDocumentBuilder.unmarshal(DataSet.class, new InputStreamReader(this.getClass().getResourceAsStream(resource)),uri.toString());
29
			
30
			NamedArea namedArea = (NamedArea)dataSet.getTerms().get(1);	
31
			assertNotNull("NamedArea must not be null",namedArea);
32
	    }
33
}
(9-9/17)