use sample document with test schemas

Signed-off-by: Florian Thienel <florian@thienel.org>
diff --git a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/content.xsd b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/content.xsd
index dafb955..ae1b70b 100644
--- a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/content.xsd
+++ b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/content.xsd
@@ -11,21 +11,15 @@
 -->

 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.eclipse.org/vex/test/content" xmlns="http://www.eclipse.org/vex/test/content" elementFormDefault="qualified">

 

-	<xs:complexType name="ParagraphType">

-		<xs:complexContent>

-			<xs:restriction base="ContentType"/>

-		</xs:complexContent>

-	</xs:complexType>

-	

-	<xs:complexType name="ContentType">

-		<xs:complexContent>

-			<xs:extension base="xs:string">

+	<xs:complexType name="ContentType" mixed="true">

+		<xs:sequence minOccurs="0" maxOccurs="unbounded">

+			<xs:choice>

 				<xs:element name="b" type="ContentType"/>

 				<xs:element name="i" type="ContentType"/>

-			</xs:extension>

-		</xs:complexContent>

+			</xs:choice>

+		</xs:sequence>

 	</xs:complexType>

 

-	<xs:element name="p" type="ParagraphType"/>

+	<xs:element name="p" type="ContentType"/>

 	

 </xs:schema>
\ No newline at end of file
diff --git a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/structure.xsd b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/structure.xsd
index e345e93..3f788c3 100644
--- a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/structure.xsd
+++ b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/projectFiles/structure.xsd
@@ -16,7 +16,7 @@
 			<xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
 			<xs:choice>
 				<xs:element name="chapter" type="ChapterType" minOccurs="0" maxOccurs="unbounded"/>
-				<xs:any namespace="http://www.eclipse.org/vex/test/content" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:any namespace="http://www.eclipse.org/vex/test/content" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
 			</xs:choice>
 		</xs:sequence>
 	</xs:complexType>
diff --git a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/ProjectPlanTest.java b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/SchemaValidationTest.java
similarity index 60%
rename from sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/ProjectPlanTest.java
rename to sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/SchemaValidationTest.java
index 96055dc..e5f93f6 100644
--- a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/ProjectPlanTest.java
+++ b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/SchemaValidationTest.java
@@ -10,8 +10,7 @@
  *******************************************************************************/

 package org.eclipse.wst.xml.vex.core.internal.dom;

 

-import static org.junit.Assert.assertEquals;

-import static org.junit.Assert.assertNotNull;

+import static org.junit.Assert.*;

 

 import java.io.IOException;

 import java.io.InputStream;

@@ -29,44 +28,44 @@
 /**

  * @author Florian Thienel

  */

-public class ProjectPlanTest {

+public class SchemaValidationTest {

 	

 	@Test

-	public void readProjectPlan() throws Exception {

+	public void readDocumentWithTwoSchemas() throws Exception {

 		final EntityResolver entityResolver = new EntityResolver() {

 			public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {

 				return null;

 			}

 		};

 		

-		final InputStream projectPlanStream = getClass().getResourceAsStream("projectplan.xml");

-		final InputSource projectPlanInputSource = new InputSource(projectPlanStream);

+		final InputStream documentStream = getClass().getResourceAsStream("document.xml");

+		final InputSource documentInputSource = new InputSource(documentStream);

 		

 		final DocumentReader reader = new DocumentReader();

 		reader.setDebugging(true);

 		reader.setEntityResolver(entityResolver);

 		reader.setWhitespacePolicyFactory(IWhitespacePolicyFactory.NULL);

-		final Document projectPlan = reader.read(projectPlanInputSource);

-		assertNotNull(projectPlan);

+		final Document document = reader.read(documentInputSource);

+		assertNotNull(document);

 		

-		final Element rootElement = projectPlan.getRootElement();

+		final Element rootElement = document.getRootElement();

 		assertNotNull(rootElement);

-		assertEquals("plan", rootElement.getLocalName());

-		assertEquals("plan", rootElement.getPrefixedName());

-		assertEquals(new QualifiedName("http://www.eclipse.org/project/plan", "plan"), rootElement.getQualifiedName());

-		assertEquals("http://www.eclipse.org/project/plan", rootElement.getDefaultNamespaceURI());

-		assertEquals("http://www.w3.org/1999/xhtml", rootElement.getNamespaceURI("html"));

+		assertEquals("chapter", rootElement.getLocalName());

+		assertEquals("chapter", rootElement.getPrefixedName());

+		assertEquals(new QualifiedName("http://www.eclipse.org/vex/test/structure", "chapter"), rootElement.getQualifiedName());

+		assertEquals("http://www.eclipse.org/vex/test/structure", rootElement.getDefaultNamespaceURI());

+		assertEquals("http://www.eclipse.org/vex/test/content", rootElement.getNamespaceURI("c"));

 		

-		final Element introductionElement = rootElement.getChildElements().get(1);

-		assertEquals("introduction", introductionElement.getPrefixedName());

-		assertEquals(new QualifiedName("http://www.eclipse.org/project/plan", "introduction"), introductionElement.getQualifiedName());

+		final Element subChapterElement = rootElement.getChildElements().get(1);

+		assertEquals("chapter", subChapterElement.getPrefixedName());

+		assertEquals(new QualifiedName("http://www.eclipse.org/vex/test/structure", "chapter"), subChapterElement.getQualifiedName());

 		

-		final Element introductionDivElement = introductionElement.getChildElements().get(0);

-		assertEquals("div", introductionDivElement.getLocalName());

-		assertEquals("html:div", introductionDivElement.getPrefixedName());

-		assertEquals(new QualifiedName("http://www.w3.org/1999/xhtml", "div"), introductionDivElement.getQualifiedName());

+		final Element paragraphElement = subChapterElement.getChildElements().get(1);

+		assertEquals("p", paragraphElement.getLocalName());

+		assertEquals("c:p", paragraphElement.getPrefixedName());

+		assertEquals(new QualifiedName("http://www.eclipse.org/vex/test/content", "p"), paragraphElement.getQualifiedName());

 	}

-	

+

 	@Test

 	public void getCMDocumentsByLogicalName() throws Exception {

 		final URIResolver uriResolver = URIResolverPlugin.createResolver();

@@ -82,5 +81,5 @@
 		final CMDocument dtd = modelManager.createCMDocument(dtdLocation, null);

 		assertNotNull(dtd);

 	}

-

+	

 }

diff --git a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/document.xml b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/document.xml
new file mode 100644
index 0000000..5eeb284
--- /dev/null
+++ b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/document.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<chapter xmlns="http://www.eclipse.org/vex/test/structure" xmlns:c="http://www.eclipse.org/vex/test/content">

+	<title>Title</title>

+	<chapter>

+		<title>1.1</title>

+		<c:p>The <c:i>first</c:i> <c:b>paragraph</c:b>.</c:p>

+	</chapter>

+	<chapter>

+		<title>1.2</title>

+		<c:p>The <c:b>second</c:b> <c:i>paragraph</c:i>.</c:p>

+	</chapter>

+</chapter>

diff --git a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/projectplan.xml b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/projectplan.xml
deleted file mode 100644
index f66b6c2..0000000
--- a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/internal/dom/projectplan.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

-<?xml-stylesheet type="text/xsl" href="http://www.eclipse.org/projects/project-plan.xsl"?>

-<!-- Taken from http://wiki.eclipse.org/Development_Resources/Project_Plan -->

-<plan plan-format="1.0" xmlns="http://www.eclipse.org/project/plan"

-	xmlns:html="http://www.w3.org/1999/xhtml" name="Project Name">

-	<release projectid="technology.dash" version="1.0" />

-	<introduction>

-		<html:div>Some xhtml content here. Make sure to use the prefix before

-			the elements</html:div>

-	</introduction>

-	<release_deliverables>

-		<html:div>Some xhtml content here. Make sure to use the prefix before

-			the elements</html:div>

-	</release_deliverables>

-	<release_milestones>

-		<preamble>

-			<html:div>Some xhtml content here. Make sure to use the prefix before

-				the elements</html:div>

-		</preamble>

-		<milestone date="7/1/2008" milestone="M1">

-			<html:div>optional html</html:div>

-		</milestone>

-		<milestone date="8/1/2008" milestone="M2">

-			<html:div>optional html</html:div>

-		</milestone>

-		<milestone date="9/1/2008" milestone="RC1">

-			<html:div>optional html</html:div>

-		</milestone>

-		<milestone date="6/28/2009" milestone="1.0" />

-		<postamble>

-			<html:div>html content</html:div>

-		</postamble>

-	</release_milestones>

-	<target_environments>

-		<html:div>Some xhtml content here. Make sure to use the prefix before

-			the elements</html:div>

-		<internationalization>

-			<html:div>Some xhtml content here. Make sure to use the prefix before

-				the elements</html:div>

-		</internationalization>

-	</target_environments>

-	<compatibility_with_previous_releases>

-		<html:div>Some xhtml content here. Make sure to use the prefix before

-			the elements</html:div>

-	</compatibility_with_previous_releases>

-	<themes_and_priorities>

-		<preamble>

-			<html:div>Some xhtml content here. Make sure to use the prefix before

-				the elements</html:div>

-		</preamble>

-		<theme name="Appealing to the Broader Community">

-			<description>...(optional) html...</description>

-			<committed bugzilla="...(recommended) bugzilla search url...">

-				...(optional alternate) html...

-			</committed>

-			<proposed bugzilla="...(recommended) bugzilla search url...">

-				...(optional alternate) html...

-			</proposed>

-			<deferred bugzilla="...(recommended) bugzilla search url...">

-				...(optional alternate) html...

-			</deferred>

-		</theme>

-		<theme name="Design for Extensibility">

-			<description>...(optional) html...</description>

-			<committed bugzilla="...(recommended) bugzilla search url...">

-				...(optional alternate) html...

-			</committed>

-			<proposed bugzilla="...(recommended) bugzilla search url...">

-				...(optional alternate) html...

-			</proposed>

-			<deferred bugzilla="...(recommended) bugzilla search url...">

-				...(optional alternate) html...

-			</deferred>

-		</theme>

-	</themes_and_priorities>

-	<appendix name="Project Refactoring">

-		...html...

-	</appendix>

-</plan>

diff --git a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/tests/VEXCoreTestSuite.java b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/tests/VEXCoreTestSuite.java
index d36c8d1..96959c5 100644
--- a/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/tests/VEXCoreTestSuite.java
+++ b/sourceediting/tests/org.eclipse.wst.xml.vex.core.tests/src/org/eclipse/wst/xml/vex/core/tests/VEXCoreTestSuite.java
@@ -25,7 +25,7 @@
 import org.eclipse.wst.xml.vex.core.internal.dom.GapContentTest;
 import org.eclipse.wst.xml.vex.core.internal.dom.NamespaceStackTest;
 import org.eclipse.wst.xml.vex.core.internal.dom.NamespaceTest;
-import org.eclipse.wst.xml.vex.core.internal.dom.ProjectPlanTest;
+import org.eclipse.wst.xml.vex.core.internal.dom.SchemaValidationTest;
 import org.eclipse.wst.xml.vex.core.internal.dom.SpaceNormalizerTest;
 import org.eclipse.wst.xml.vex.core.internal.dom.TextWrapperTest;
 import org.eclipse.wst.xml.vex.core.internal.layout.ImageBoxTest;
@@ -45,7 +45,7 @@
 		super("Vex Core Tests");
 		addTest(new JUnit4TestAdapter(NamespaceStackTest.class));
 		addTest(new JUnit4TestAdapter(NamespaceTest.class));
-		addTest(new JUnit4TestAdapter(ProjectPlanTest.class));
+		addTest(new JUnit4TestAdapter(SchemaValidationTest.class));
 		addTestSuite(CssTest.class);
 		addTestSuite(PropertyTest.class);
 		addTestSuite(RuleTest.class);