下面列出了org.w3c.dom.TypeInfo#com.sun.org.apache.xerces.internal.xs.ItemPSVI 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Test
public void testSettingSimpleType() throws Exception {
try {
reset();
fValidator.setProperty(ROOT_TYPE, typeString);
} catch (SAXException e1) {
fail("Problem setting property: " + e1.getMessage());
}
try {
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("string", fRootNode.getTypeDefinition().getName());
}
@Test
public void testSettingInvalidSimpleType() throws Exception {
try {
reset();
fValidator.setProperty(ROOT_TYPE, typeNonNegInt);
} catch (SAXException e1) {
fail("Problem setting property: " + e1.getMessage());
}
try {
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertError(INVALID_TYPE_ERROR);
assertError(MININCLUSIVE_DERIVATION_ERROR);
assertValidity(ItemPSVI.VALIDITY_INVALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("nonNegativeInteger", fRootNode.getTypeDefinition().getName());
}
private void checkResult() {
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("X", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_NONE, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("anyType", child.getTypeDefinition().getName());
assertTypeNamespace("http://www.w3.org/2001/XMLSchema",
child.getTypeDefinition().getNamespace());
}
private void checkResult() {
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_NONE, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("anyType", child.getTypeDefinition().getName());
assertTypeNamespace("http://www.w3.org/2001/XMLSchema",
child.getTypeDefinition().getNamespace());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("X", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
}
/**
* XERCESJ-1141 root-type-definition property not read by XMLSchemaValidator during reset()
*/
@Test
public void testUsingDocumentBuilderFactory() throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setAttribute(ROOT_TYPE, typeX);
dbf.setAttribute(DOCUMENT_CLASS_NAME,"com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl");
dbf.setNamespaceAware(true);
dbf.setValidating(false);
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
dbf.setSchema(sf.newSchema(fSchemaURL));
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(fDocumentURL.toExternalForm());
ElementPSVI rootNode = (ElementPSVI) document.getDocumentElement();
assertValidity(ItemPSVI.VALIDITY_VALID, rootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, rootNode
.getValidationAttempted());
assertElementNull(rootNode.getElementDeclaration());
assertTypeName("X", rootNode.getTypeDefinition().getName());
}
private void checkFalseResult() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
}
/**
* The purpose of this test is to check if setting the USE_GRAMMAR_POOL_ONLY
* feature to true causes external schemas to not be read. This
* functionality already existed prior to adding the XSLT 2.0 validation
* features; however, because the class that controlled it changed, this
* test simply ensures that the existing functionality did not disappear.
* -PM
*/
@Test
public void testUsingOnlyGrammarPool() {
try {
reset();
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertElementNamespace("xslt.unittests", fRootNode
.getElementDeclaration().getNamespace());
assertTypeName("W", fRootNode.getTypeDefinition().getName());
assertTypeNamespace("xslt.unittests", fRootNode.getTypeDefinition()
.getNamespace());
}
/**
* The purpose of this test is to check if setting the USE_GRAMMAR_POOL_ONLY
* feature to true causes external schemas to not be read. This
* functionality already existed prior to adding the XSLT 2.0 validation
* features; however, because the class that controlled it changed, this
* test simply ensures that the existing functionality did not disappear.
* -PM
*/
@Test
public void testUsingOnlyGrammarPool() {
try {
reset();
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_NONE, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertAnyType(fRootNode.getTypeDefinition());
}
@Test
public void testDefault() {
try {
reset();
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("B", child.getElementDeclaration().getName());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("D", child.getElementDeclaration().getName());
}
private void checkTrueResult() {
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_PARTIAL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertAnyType(fRootNode.getTypeDefinition());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_NONE, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertAnyType(child.getTypeDefinition());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
}
private void checkFalseResult() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
}
private void checkTrueResult() {
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_PARTIAL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertAnyType(fRootNode.getTypeDefinition());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_NONE, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertAnyType(child.getTypeDefinition());
}
private void checkFalseResult() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
}
private void checkResult() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
}
@Test
public void testSettingToEqualType() {
try {
reset();
fValidator.setProperty(ROOT_TYPE, typeX);
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("X", fRootNode.getTypeDefinition().getName());
}
@Test
public void testSettingToDerivedType() {
try {
reset();
// this is required to make it a valid type Y node
((PSVIElementNSImpl) fRootNode).setAttributeNS(null, "attr", "typeY");
fValidator.setProperty(ROOT_TYPE, typeY);
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
}
@Test
public void testSettingToNonDerivedType() {
try {
reset();
fValidator.setProperty(ROOT_TYPE, typeZ);
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Z", fRootNode.getTypeDefinition().getName());
}
@Test
public void testSettingToOtherSchemaType() {
try {
reset();
((PSVIElementNSImpl) fRootNode).setAttributeNS(SchemaSymbols.URI_XSI,
SchemaSymbols.XSI_SCHEMALOCATION,
"xslt.unittests otherNamespace.xsd");
fValidator.setProperty(ROOT_TYPE, typeOtherNamespace);
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("W", fRootNode.getTypeDefinition().getName());
assertTypeNamespace("xslt.unittests", fRootNode.getTypeDefinition()
.getNamespace());
}
@Test
public void testSettingTypeAndXSIType() {
try {
reset();
// this is required to make it a valid type Y node
((PSVIElementNSImpl) fRootNode).setAttributeNS(null, "attr", "typeY");
((PSVIElementNSImpl) fRootNode).setAttributeNS(SchemaSymbols.URI_XSI,
SchemaSymbols.XSI_TYPE, "Y");
fValidator.setProperty(ROOT_TYPE, typeX);
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
}
@Test
public void testSettingTypeAndInvalidXSIType() {
try {
reset();
((PSVIElementNSImpl) fRootNode).setAttributeNS(SchemaSymbols.URI_XSI,
SchemaSymbols.XSI_TYPE, "Z");
fValidator.setProperty(ROOT_TYPE, typeX);
validateDocument();
} catch (Exception e) {
fail("Validation failed: " + e.getMessage());
}
assertError(INVALID_DERIVATION_ERROR);
assertValidity(ItemPSVI.VALIDITY_INVALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Z", fRootNode.getTypeDefinition().getName());
}
private void checkResult() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertTypeName("Y", child.getTypeDefinition().getName());
assertTypeNamespaceNull(child.getTypeDefinition().getNamespace());
}
private void checkDefault() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertTypeName("X", fRootNode.getTypeDefinition().getName());
}
private void doValidityAsserts() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertElementNamespaceNull(fRootNode.getElementDeclaration()
.getNamespace());
assertTypeName("X", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
}
private void checkValidResult() {
assertNoError(DUPLICATE_UNIQUE);
assertNoError(DUPLICATE_KEY);
assertNoError(INVALID_KEYREF);
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("itemList", fRootNode.getElementDeclaration()
.getName());
assertTypeName("itemListType", fRootNode.getTypeDefinition().getName());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("item", child.getElementDeclaration().getName());
assertTypeName("itemType", child.getTypeDefinition().getName());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("item", child.getElementDeclaration().getName());
assertTypeName("itemType", child.getTypeDefinition().getName());
child = super.getChild(3);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("item", child.getElementDeclaration().getName());
assertTypeName("itemType", child.getTypeDefinition().getName());
child = super.getChild(4);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("itemRef", child.getElementDeclaration().getName());
assertTypeName("string", child.getTypeDefinition().getName());
}
private void checkTrueResult() {
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_NONE, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertAnyType(fRootNode.getTypeDefinition());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_NONE, child
.getValidationAttempted());
assertElementNull(child.getElementDeclaration());
assertAnyType(child.getTypeDefinition());
}
private void doValidityAsserts() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertElementNamespaceNull(fRootNode.getElementDeclaration()
.getNamespace());
assertTypeName("X", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
}
private void checkDefault() {
assertError(DUPLICATE_ID);
assertError(NO_ID_BINDING);
assertValidity(ItemPSVI.VALIDITY_INVALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertTypeName("X", fRootNode.getTypeDefinition().getName());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("idType", child.getTypeDefinition().getName());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_INVALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("idType", child.getTypeDefinition().getName());
child = super.getChild(3);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("idrefType", child.getTypeDefinition().getName());
}
private void checkValidResult() {
assertNoError(DUPLICATE_ID);
assertNoError(NO_ID_BINDING);
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementName("A", fRootNode.getElementDeclaration().getName());
assertTypeName("X", fRootNode.getTypeDefinition().getName());
PSVIElementNSImpl child = super.getChild(1);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("idType", child.getTypeDefinition().getName());
child = super.getChild(2);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("idType", child.getTypeDefinition().getName());
child = super.getChild(3);
assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
.getValidationAttempted());
assertElementName("A", child.getElementDeclaration().getName());
assertTypeName("idrefType", child.getTypeDefinition().getName());
}
private void checkTrueResult() {
assertValidity(ItemPSVI.VALIDITY_NOTKNOWN, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_PARTIAL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertAnyType(fRootNode.getTypeDefinition());
checkChild();
}
private void checkFalseResult() {
assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
.getValidationAttempted());
assertElementNull(fRootNode.getElementDeclaration());
assertTypeName("Y", fRootNode.getTypeDefinition().getName());
assertTypeNamespaceNull(fRootNode.getTypeDefinition().getNamespace());
checkChild();
}