1   package org.cateproject.marshal;
2   
3   import java.io.IOException;
4   import java.io.Reader;
5   import java.io.StringReader;
6   
7   import javax.xml.bind.JAXBException;
8   
9   import org.cateproject.model.DataSet;
10  import org.junit.Test;
11  import org.xml.sax.SAXException;
12  
13  public class SimpleMarshalTest {
14  	private String documentText = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
15  	"<DataSet xmlns=\"http://cate-project.org/schema/0.6\">\n" +
16  	  "<Occurences/>\n" + 
17  	  "<Agents/>\n" +
18  	  "<TaxonomicNames/>\n" +
19  	  "<Taxa/>" +
20  	  "<Media/>" +
21  	"</DataSet>";
22      
23      /**
24       * test the parsing of a simple document
25       * @throws SAXException 
26       * @throws JAXBException 
27       * @throws IOException 
28       */
29  	@Test
30      public void testEmptyDocument() throws JAXBException, SAXException, IOException 
31      {
32  		CATEDocumentBuilder cateDocumentBuilder = new CATEDocumentBuilder();
33  		
34  		Reader reader = new StringReader(documentText);
35  		DataSet dataSet = cateDocumentBuilder.getDataSet(reader);	
36      }
37      
38      /**
39       * Test the creation of the document builder
40       */
41  	@Test
42      public void testCreation() throws JAXBException, SAXException
43      {
44      	CATEDocumentBuilder cateDocumentBuilder = new CATEDocumentBuilder();
45      }
46  }