@@ -47,7 +47,7 @@ public class CollectionConfigurationValidationModeTest {
47
47
private static final String valid = "<xsd:schema xmlns:xsd=\" http://www.w3.org/2001/XMLSchema\" targetNamespace=\" http://jmvanel.free.fr/xsd/addressBook\" elementFormDefault=\" qualified\" >" + "<xsd:attribute name=\" uselessAttribute\" type=\" xsd:string\" />" + "<xsd:complexType name=\" record\" >" + "<xsd:sequence>" + "<xsd:element name=\" cname\" type=\" xsd:string\" />" + "<xsd:element name=\" email\" type=\" xsd:string\" />" + "</xsd:sequence>" + "</xsd:complexType>" + "<xsd:element name=\" addressBook\" >" + "<xsd:complexType>" + "<xsd:sequence>" + "<xsd:element name=\" owner\" type=\" record\" />" + "<xsd:element name=\" person\" type=\" record\" minOccurs=\" 0\" maxOccurs=\" unbounded\" />" + "</xsd:sequence>" + "</xsd:complexType>" + "</xsd:element>" + "</xsd:schema>" ;
48
48
private static final String invalid = "<xsd:schema xmlns:xsd=\" http://www.w3.org/2001/XMLSchema\" targetNamespace=\" http://jmvanel.free.fr/xsd/addressBook\" elementFormDefault=\" qualified\" >" + "<xsd:attribute name=\" uselessAttribute\" type=\" xsd:string\" />" + "<xsd:complexType name=\" record\" >" + "<xsd:sequence>" + "<xsd:elementa name=\" cname\" type=\" xsd:string\" />" + "<xsd:elementb name=\" email\" type=\" xsd:string\" />" + "</xsd:sequence>" + "</xsd:complexType>" + "<xsd:element name=\" addressBook\" >" + "<xsd:complexType>" + "<xsd:sequence>" + "<xsd:element name=\" owner\" type=\" record\" />" + "<xsd:element name=\" person\" type=\" record\" minOccurs=\" 0\" maxOccurs=\" unbounded\" />" + "</xsd:sequence>" + "</xsd:complexType>" + "</xsd:element>" + "</xsd:schema>" ;
49
49
private static final String anonymous = "<schema elementFormDefault=\" qualified\" >" + "<attribute name=\" uselessAttribute\" type=\" string\" />" + "<complexType name=\" record\" >" + "<sequence>" + "<elementa name=\" cname\" type=\" string\" />" + "<elementb name=\" email\" type=\" string\" />" + "</sequence>" + "</complexType>" + "<element name=\" addressBook\" >" + "<complexType>" + "<sequence>" + "<element name=\" owner\" type=\" record\" />" + "<element name=\" person\" type=\" record\" minOccurs=\" 0\" maxOccurs=\" unbounded\" />" + "</sequence>" + "</complexType>" + "</element>" + "</schema>" ;
50
- private static final String different = "<asd:schema xmlns:asd=\" http ://www.w3.org/2001/XMLSchemaschema\" targetNamespace=\" http://jmvanel.free.fr/xsd/addressBookbook\" elementFormDefault=\" qualified\" >" + "<asd:attribute name=\" uselessAttribute\" type=\" asd:string\" />" + "<asd:complexType name=\" record\" >" + "<asd:sequence>" + "<asd:element name=\" cname\" type=\" asd:string\" />" + "<asd:element name=\" email\" type=\" asd:string\" />" + "</asd:sequence>" + "</asd:complexType>" + "<asd:element name=\" addressBook\" >" + "<asd:complexType>" + "<asd:sequence>" + "<asd:element name=\" owner\" type=\" record\" />" + "<asd:element name=\" person\" type=\" record\" minOccurs=\" 0\" maxOccurs=\" unbounded\" />" + "</asd:sequence>" + "</asd:complexType>" + "</asd:element>" + "</asd:schema>" ;
50
+ private static final String different = "<asd:schema xmlns:asd=\" https ://www.w3.org/2001/XMLSchemaschema\" targetNamespace=\" http://jmvanel.free.fr/xsd/addressBookbook\" elementFormDefault=\" qualified\" >" + "<asd:attribute name=\" uselessAttribute\" type=\" asd:string\" />" + "<asd:complexType name=\" record\" >" + "<asd:sequence>" + "<asd:element name=\" cname\" type=\" asd:string\" />" + "<asd:element name=\" email\" type=\" asd:string\" />" + "</asd:sequence>" + "</asd:complexType>" + "<asd:element name=\" addressBook\" >" + "<asd:complexType>" + "<asd:sequence>" + "<asd:element name=\" owner\" type=\" record\" />" + "<asd:element name=\" person\" type=\" record\" minOccurs=\" 0\" maxOccurs=\" unbounded\" />" + "</asd:sequence>" + "</asd:complexType>" + "</asd:element>" + "</asd:schema>" ;
51
51
52
52
private static final String xconf_yes = "<collection xmlns=\" http://exist-db.org/collection-config/1.0\" ><validation mode=\" yes\" /></collection>" ;
53
53
private static final String xconf_no = "<collection xmlns=\" http://exist-db.org/collection-config/1.0\" ><validation mode=\" no\" /></collection>" ;
@@ -104,10 +104,10 @@ public void insertModeFalse() throws XMLDBException {
104
104
105
105
@ Test
106
106
public void insertModeTrue () throws XMLDBException {
107
- // namespace provided, valid document; should pass
108
107
createCollection ("/db/true" );
109
108
storeCollectionXconf ("/db/system/config/db/true" , xconf_yes );
110
109
110
+ // namespace provided, valid document; should pass
111
111
storeDocument ("/db/true" , "valid.xml" , valid );
112
112
113
113
// namespace provided, invalid document; should fail
@@ -148,10 +148,10 @@ public void insertModeTrue() throws XMLDBException {
148
148
149
149
@ Test
150
150
public void insertModeAuto () throws XMLDBException {
151
- // namespace provided, valid document; should pass
152
151
createCollection ("/db/auto" );
153
152
storeCollectionXconf ("/db/system/config/db/auto" , xconf_auto );
154
153
154
+ // namespace provided, valid document; should pass
155
155
storeDocument ("/db/auto" , "valid.xml" , valid );
156
156
157
157
0 commit comments