1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package tests.ext;
20
21 import junit.framework.TestCase;
22
23 import javax.xml.parsers.DocumentBuilderFactory;
24
25 import org.w3c.dom.Document;
26 import org.apache.ws.commons.schema.XmlSchemaCollection;
27 import org.apache.ws.commons.schema.XmlSchema;
28 import org.apache.ws.commons.schema.XmlSchemaElement;
29 import tests.Resources;
30
31 import java.util.Iterator;
32 import java.util.Map;
33 import java.io.ByteArrayOutputStream;
34
35
36
37
38 public class PlainExtensionSerializerTest extends TestCase {
39
40 public void testSerialization() throws Exception {
41
42
43 DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
44 documentBuilderFactory.setNamespaceAware(true);
45 Document doc = documentBuilderFactory.newDocumentBuilder().
46 parse(Resources.asURI("/external/externalAnnotations.xsd"));
47
48 XmlSchemaCollection schemaCol = new XmlSchemaCollection();
49 XmlSchema schema = schemaCol.read(doc,null);
50 assertNotNull(schema);
51
52 schema.write(new ByteArrayOutputStream());
53 }
54
55
56 public void testSerialization1() throws Exception {
57
58
59 DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
60 documentBuilderFactory.setNamespaceAware(true);
61 Document doc = documentBuilderFactory.newDocumentBuilder().
62 parse(Resources.asURI("/external/externalElementAnnotations.xsd"));
63
64 XmlSchemaCollection schemaCol = new XmlSchemaCollection();
65 XmlSchema schema = schemaCol.read(doc,null);
66 assertNotNull(schema);
67
68 schema.write(new ByteArrayOutputStream());
69 }
70 }