View Javadoc

1   package tests;
2   
3   import junit.framework.TestCase;
4   
5   import javax.xml.parsers.DocumentBuilderFactory;
6   
7   import org.w3c.dom.Document;
8   import org.apache.ws.commons.schema.XmlSchemaCollection;
9   import org.apache.ws.commons.schema.XmlSchema;
10  
11  /**
12   * Created by IntelliJ IDEA.
13   * User: ajith
14   */
15  public class EnumValueTest extends TestCase {
16  
17  
18      public void testValue() throws Exception{
19          //create a DOM document
20          DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
21          documentBuilderFactory.setNamespaceAware(true);
22          Document doc = documentBuilderFactory.newDocumentBuilder().
23                  parse(Resources.asURI("enum.xsd"));
24  
25          XmlSchemaCollection schemaCol = new XmlSchemaCollection();
26          XmlSchema s = schemaCol.read(doc.getDocumentElement());
27  
28          assertNotNull(s);
29      }
30  }