Path: blob/master/test/jdk/javax/xml/jaxp/testng/validation/jdk8037819/FixedAttrTest.java
41159 views
/*1* Licensed to the Apache Software Foundation (ASF) under one or more2* contributor license agreements. See the NOTICE file distributed with3* this work for additional information regarding copyright ownership.4* The ASF licenses this file to You under the Apache License, Version 2.05* (the "License"); you may not use this file except in compliance with6* the License. You may obtain a copy of the License at7*8* http://www.apache.org/licenses/LICENSE-2.09*10* Unless required by applicable law or agreed to in writing, software11* distributed under the License is distributed on an "AS IS" BASIS,12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13* See the License for the specific language governing permissions and14* limitations under the License.15*/16package validation.jdk8037819;1718import com.sun.org.apache.xerces.internal.dom.PSVIElementNSImpl;19import com.sun.org.apache.xerces.internal.xs.ItemPSVI;20import org.testng.annotations.AfterClass;21import org.testng.annotations.BeforeClass;22import org.testng.annotations.Test;23import validation.BaseTest;2425/**26* The purpose of this test is to execute all of the isComparable calls in27* XMLSchemaValidator. There are two calls in processElementContent and two28* calls in processOneAttribute.29*30* @author peterjm31*/32public class FixedAttrTest extends BaseTest {3334protected String getXMLDocument() {35return "fixedAttr.xml";36}3738protected String getSchemaFile() {39return "base.xsd";40}4142public FixedAttrTest(String name) {43super(name);44}4546@BeforeClass47protected void setUp() throws Exception {48super.setUp();49}5051@AfterClass52protected void tearDown() throws Exception {53super.tearDown();54}5556@Test57public void testDefault() {58try {59reset();60validateDocument();61} catch (Exception e) {62fail("Validation failed: " + e.getMessage());63}6465assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());66assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode67.getValidationAttempted());68assertElementName("A", fRootNode.getElementDeclaration().getName());6970PSVIElementNSImpl child = super.getChild(1);71assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());72assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child73.getValidationAttempted());74assertElementName("B", child.getElementDeclaration().getName());7576child = super.getChild(2);77assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());78assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child79.getValidationAttempted());80assertElementName("D", child.getElementDeclaration().getName());81}82}838485