Author: dallen6
Date: 2009-05-03 17:26:12 -0400 (Sun, 03 May 2009)
New Revision: 2644
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/NamespacesValidatedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/Order.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/invalid-beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/standard-beans.xml
Removed:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/schema.xsd
Log:
Some improvements and splitting of tests for XML schema related assertions.
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/NamespacesValidatedTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/NamespacesValidatedTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/NamespacesValidatedTest.java 2009-05-03
21:26:12 UTC (rev 2644)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.xml.schema;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * This test is designed to produce an XML validation failure so
+ * that we can detect that the namespace was validated with
+ * the XML parser and the corresponding schema per the spec.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@Resources({
+ @Resource(source="schema.xsd",
destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/schema/schema.xsd")
+})
+(a)BeansXml("invalid-beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NamespacesValidatedTest extends AbstractJSR299Test
+{
+ @Test(groups = { "ri-broken", "xml" })
+ @SpecAssertions({
+ @SpecAssertion(section="9.3", id="a")
+ })
+ public void testValidationFailure()
+ {
+ assert false;
+ }
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/NamespacesValidatedTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/Order.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/Order.java 2009-05-03
21:26:12 UTC (rev 2644)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.xml.schema;
+
+class Order
+{
+ private String shipToAddress;
+ private String shippingMethod;
+
+ public String getShipToAddress()
+ {
+ return shipToAddress;
+ }
+
+ public String getShippingMethod()
+ {
+ return shippingMethod;
+ }
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/Order.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java 2009-05-03
12:18:01 UTC (rev 2643)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java 2009-05-03
21:26:12 UTC (rev 2644)
@@ -1,12 +1,9 @@
package org.jboss.jsr299.tck.tests.xml.schema;
-import javax.inject.DefinitionException;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -16,18 +13,18 @@
@Resources({
@Resource(source="schema.xsd",
destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/schema/schema.xsd")
})
-(a)BeansXml("beans.xml")
-(a)ExpectedDeploymentException(DefinitionException.class)
+(a)BeansXml("standard-beans.xml")
public class StandardSchemaLocationTest extends AbstractJSR299Test
{
- @Test(groups="incontainer-ri-broken")
+ @Test(groups = { "ri-broken", "xml" })
@SpecAssertions({
- @SpecAssertion(section="9.3", id="a"),
@SpecAssertion(section="9.3", id="b"),
@SpecAssertion(section="9.3", id="c")
})
public void testStandardSchemaLocation()
{
- assert false;
+ Order order = getCurrentManager().getInstanceByType(Order.class);
+ assert order.getShipToAddress() != null;
+ assert order.getShipToAddress().equals("123 Main St., Anywhere, MA");
}
}
Deleted:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/beans.xml 2009-05-03
12:18:01 UTC (rev 2643)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/beans.xml 2009-05-03
21:26:12 UTC (rev 2644)
@@ -1,8 +0,0 @@
-<Beans xmlns="urn:java:ee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:java:org.jboss.jsr299.tck.tests.xml.schema
http://mydomain.com/myapp/schema-1.2.xsd">
- <Deploy>
- <Standard />
- <Production />
- </Deploy>
-</Beans>
\ No newline at end of file
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/invalid-beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/invalid-beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/invalid-beans.xml 2009-05-03
21:26:12 UTC (rev 2644)
@@ -0,0 +1,11 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.schema">
+ <Deploy>
+ <Standard />
+ <Production />
+ </Deploy>
+ <test:Order>
+ <test:shipToAddress>123 Main St., Anywhere, MA</test:shipToAddress>
+ <test:shippingMethod>DHL</test:shippingMethod>
+ </test:Order>
+</Beans>
\ No newline at end of file
Property changes on:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/invalid-beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/schema.xsd
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/schema.xsd 2009-05-03
12:18:01 UTC (rev 2643)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/schema.xsd 2009-05-03
21:26:12 UTC (rev 2644)
@@ -1,10 +1,9 @@
-<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:java:ee">
- <xs:element name="Beanses">
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:java:org.jboss.jsr299.tck.tests.xml.schema">
+ <xs:element name="Order">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:any namespace="##any" processContents="skip" />
+ <xs:element name="shipToAddress" />
</xs:sequence>
- <xs:anyAttribute namespace="##any" processContents="skip"
/>
</xs:complexType>
</xs:element>
</xs:schema>
\ No newline at end of file
Copied:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/standard-beans.xml
(from rev 2643,
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/beans.xml)
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/standard-beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/schema/standard-beans.xml 2009-05-03
21:26:12 UTC (rev 2644)
@@ -0,0 +1,10 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.schema">
+ <Deploy>
+ <Standard />
+ <Production />
+ </Deploy>
+ <test:Order>
+ <test:shipToAddress>123 Main St., Anywhere, MA</test:shipToAddress>
+ </test:Order>
+</Beans>
\ No newline at end of file