01: package org.geotools.po;
02:
03: import java.io.InputStream;
04:
05: import junit.framework.TestCase;
06:
07: import org.geotools.po.bindings.POConfiguration;
08: import org.geotools.xml.Parser;
09:
10: /**
11: * Test case which tests the parsing of a sample instance document from
12: * the purchase order schema, po.xsd.
13: *
14: * @author Justin Deoliveira, The Open Planning Project
15: *
16: */
17: public class POTest extends TestCase {
18:
19: public void test() throws Exception {
20:
21: //load the xml file
22: InputStream input = getClass().getResourceAsStream("po.xml");
23:
24: //create the configuration
25: POConfiguration configuration = new POConfiguration();
26:
27: //parse the instance document
28: Parser parser = new Parser(configuration);
29: PurchaseOrderType po = (PurchaseOrderType) parser.parse(input);
30:
31: assertNotNull(po);
32: }
33: }
|