Project

General

Profile

Download (1.14 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 java.io.InputStreamReader;
12
import eu.etaxonomy.cdm.common.URI;
13

    
14
import org.junit.Assert;
15
import org.junit.Test;
16

    
17
import eu.etaxonomy.cdm.model.agent.Person;
18

    
19
public class CdmDocumentBuilderTest {
20

    
21
	    private final String resource = "/eu/etaxonomy/cdm/io/jaxb/CdmDocumentBuilderTest.xml";
22

    
23
	    @Test
24
	    public void testXInclude() throws Exception {
25
	        CdmDocumentBuilder cdmDocumentBuilder = new CdmDocumentBuilder();
26
	        URI uri = new URI(URIEncoder.encode(this.getClass().getResource(resource).toString()));
27
	        DataSet dataSet = cdmDocumentBuilder.unmarshal(DataSet.class, new InputStreamReader(this.getClass().getResourceAsStream(resource)),uri.toString());
28

    
29
	        Assert.assertFalse("agents should exist", dataSet.getAgents().isEmpty());
30
			Person person = (Person)dataSet.getAgents().get(0);
31
			Assert.assertNotNull(person);
32
	    }
33
}
(3-3/17)