jdk/test/javax/xml/jaxp/testng/validation/8037819/IdentityConstraintCheckingTest.java
author joehw
Fri, 29 Aug 2014 11:59:34 -0700
changeset 26335 67078b90e47b
permissions -rw-r--r--
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26335
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     1
/*
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     2
 * Licensed to the Apache Software Foundation (ASF) under one or more
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     3
 * contributor license agreements.  See the NOTICE file distributed with
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     4
 * this work for additional information regarding copyright ownership.
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     5
 * The ASF licenses this file to You under the Apache License, Version 2.0
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     6
 * (the "License"); you may not use this file except in compliance with
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     7
 * the License.  You may obtain a copy of the License at
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     8
 *
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
     9
 *      http://www.apache.org/licenses/LICENSE-2.0
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    10
 *
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    11
 * Unless required by applicable law or agreed to in writing, software
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    12
 * distributed under the License is distributed on an "AS IS" BASIS,
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    14
 * See the License for the specific language governing permissions and
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    15
 * limitations under the License.
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    16
 */
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    17
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    18
import com.sun.org.apache.xerces.internal.dom.PSVIElementNSImpl;
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    19
import com.sun.org.apache.xerces.internal.xs.ItemPSVI;
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    20
import org.xml.sax.SAXException;
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    21
import org.testng.annotations.AfterClass;
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    22
import org.testng.annotations.BeforeClass;
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    23
import org.testng.annotations.Test;
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    24
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    25
public class IdentityConstraintCheckingTest extends BaseTest {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    26
    // These values are unstable, since they're not actually error keys, but
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    27
    // simply
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    28
    // the first part of the error message.
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    29
    public static final String DUPLICATE_UNIQUE = "cvc-identity-constraint.4.1";
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    30
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    31
    public static final String DUPLICATE_KEY = "cvc-identity-constraint.4.2.2";
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    32
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    33
    public static final String INVALID_KEYREF = "cvc-identity-constraint.4.3";
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    34
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    35
    protected String getXMLDocument() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    36
        return "idc.xml";
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    37
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    38
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    39
    protected String getSchemaFile() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    40
        return "idc.xsd";
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    41
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    42
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    43
    protected String[] getRelevantErrorIDs() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    44
        return new String[] { DUPLICATE_UNIQUE, DUPLICATE_KEY, INVALID_KEYREF };
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    45
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    46
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    47
    public IdentityConstraintCheckingTest(String name) {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    48
        super(name);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    49
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    50
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    51
    @BeforeClass
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    52
    protected void setUp() throws Exception {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    53
        super.setUp();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    54
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    55
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    56
    @AfterClass
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    57
    protected void tearDown() throws Exception {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    58
        super.tearDown();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    59
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    60
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    61
    @Test
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    62
    public void testDefault() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    63
        try {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    64
            reset();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    65
            validateDocument();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    66
        } catch (Exception e) {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    67
            fail("Validation failed: " + e.getMessage());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    68
        }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    69
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    70
        checkDefault();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    71
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    72
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    73
    @Test
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    74
    public void testSetFalse() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    75
        try {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    76
            reset();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    77
            fValidator.setFeature(IDC_CHECKING, false);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    78
            validateDocument();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    79
        } catch (Exception e) {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    80
            fail("Validation failed: " + e.getMessage());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    81
        }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    82
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    83
        checkValidResult();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    84
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    85
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    86
    @Test
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    87
    public void testSetTrue() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    88
        try {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    89
            reset();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    90
            fValidator.setFeature(IDC_CHECKING, true);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    91
            validateDocument();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    92
        } catch (Exception e) {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    93
            fail("Validation failed: " + e.getMessage());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    94
        }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    95
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    96
        checkDefault();
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    97
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    98
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
    99
    private void checkDefault() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   100
        assertError(DUPLICATE_UNIQUE);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   101
        assertError(DUPLICATE_KEY);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   102
        assertError(INVALID_KEYREF);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   103
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   104
        assertValidity(ItemPSVI.VALIDITY_INVALID, fRootNode.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   105
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   106
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   107
        assertElementName("itemList", fRootNode.getElementDeclaration()
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   108
                .getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   109
        assertTypeName("itemListType", fRootNode.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   110
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   111
        // this one is valid because it's the first one to define the unique
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   112
        // value
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   113
        PSVIElementNSImpl child = super.getChild(1);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   114
        assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   115
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   116
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   117
        assertElementName("item", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   118
        assertTypeName("itemType", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   119
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   120
        // invalid because it repeats the unique value
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   121
        child = super.getChild(2);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   122
        assertValidity(ItemPSVI.VALIDITY_INVALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   123
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   124
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   125
        assertElementName("item", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   126
        assertTypeName("itemType", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   127
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   128
        // invalid because it repeats the key
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   129
        child = super.getChild(3);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   130
        assertValidity(ItemPSVI.VALIDITY_INVALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   131
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   132
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   133
        assertElementName("item", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   134
        assertTypeName("itemType", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   135
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   136
        // valid because key references aren't figured out until the validation
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   137
        // root
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   138
        child = super.getChild(4);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   139
        assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   140
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   141
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   142
        assertElementName("itemRef", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   143
        assertTypeName("string", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   144
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   145
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   146
    private void checkValidResult() {
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   147
        assertNoError(DUPLICATE_UNIQUE);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   148
        assertNoError(DUPLICATE_KEY);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   149
        assertNoError(INVALID_KEYREF);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   150
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   151
        assertValidity(ItemPSVI.VALIDITY_VALID, fRootNode.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   152
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, fRootNode
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   153
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   154
        assertElementName("itemList", fRootNode.getElementDeclaration()
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   155
                .getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   156
        assertTypeName("itemListType", fRootNode.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   157
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   158
        PSVIElementNSImpl child = super.getChild(1);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   159
        assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   160
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   161
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   162
        assertElementName("item", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   163
        assertTypeName("itemType", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   164
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   165
        child = super.getChild(2);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   166
        assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   167
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   168
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   169
        assertElementName("item", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   170
        assertTypeName("itemType", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   171
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   172
        child = super.getChild(3);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   173
        assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   174
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   175
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   176
        assertElementName("item", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   177
        assertTypeName("itemType", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   178
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   179
        child = super.getChild(4);
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   180
        assertValidity(ItemPSVI.VALIDITY_VALID, child.getValidity());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   181
        assertValidationAttempted(ItemPSVI.VALIDATION_FULL, child
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   182
                .getValidationAttempted());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   183
        assertElementName("itemRef", child.getElementDeclaration().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   184
        assertTypeName("string", child.getTypeDefinition().getName());
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   185
    }
67078b90e47b 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
diff changeset
   186
}