Search in sources :

Example 76 with DOMTestDocumentBuilderFactory

use of org.w3c.domts.DOMTestDocumentBuilderFactory in project webservices-axiom by apache.

the class DOMTestSuiteBuilder method addTests.

protected void addTests() {
    DocumentBuilderFactory dbf = dbff.newInstance();
    dbf.setNamespaceAware(true);
    addTest(new org.apache.axiom.ts.dom.attr.TestCloneNode(dbf, true));
    addTest(new org.apache.axiom.ts.dom.attr.TestCloneNode(dbf, false));
    addTest(new org.apache.axiom.ts.dom.attr.TestGetChildNodes(dbf));
    addTest(new org.apache.axiom.ts.dom.attr.TestGetFirstChild(dbf));
    addTest(new org.apache.axiom.ts.dom.attr.TestGetNamespaceURIWithNoNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.attr.TestGetValueWithMultipleChildren(dbf));
    addTest(new org.apache.axiom.ts.dom.attr.TestLookupNamespaceURIWithoutOwnerElement(dbf));
    addTest(new org.apache.axiom.ts.dom.attr.TestSetPrefixNotNullWithNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.attr.TestSetPrefixNotNullWithoutNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.attr.TestSetPrefixNullWithNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.builder.TestParseURI(dbf));
    addTest(new org.apache.axiom.ts.dom.builder.TestWhitespaceAroundDocumentElement(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestAdoptNode(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestAdoptNodeToSameDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestAdoptNodeWithParent(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestAllowedChildren(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestAppendChildForeignImplementation(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestAppendChildWrongDocument(dbf));
    for (XMLSample file : getInstances(XMLSample.class)) {
        addTest(new org.apache.axiom.ts.dom.document.TestCloneNode(dbf, file));
    }
    addTest(new org.apache.axiom.ts.dom.document.TestCreateAttribute(dbf));
    for (int i = 0; i < validAttrQNames.length; i++) {
        addTest(new org.apache.axiom.ts.dom.document.TestCreateAttributeNS(dbf, validAttrQNames[i]));
    }
    for (int i = 0; i < invalidAttrQNames.length; i++) {
        addTest(new org.apache.axiom.ts.dom.document.TestCreateAttributeNSInvalid(dbf, invalidAttrQNames[i]));
    }
    addTest(new org.apache.axiom.ts.dom.document.TestCreateAttributeNSWithoutNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestCreateCDATASection(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestCreateElement(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestCreateElementNS(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestCreateElementNSWithInvalidName(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestCreateElementNSWithoutNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestCreateEntityReference(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestCreateText(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestDocumentSiblings(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestGetDomConfigDefaults(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestGetOwnerDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestLookupNamespaceURI(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestLookupNamespaceURIWithEmptyDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestLookupPrefixWithEmptyDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.document.TestNormalizeDocumentNamespace(dbf));
    for (XSLTImplementation xsltImplementation : getInstances(XSLTImplementation.class)) {
        addTest(new org.apache.axiom.ts.dom.document.TestTransformerWithIdentityStylesheet(dbf, xsltImplementation));
        addTest(new org.apache.axiom.ts.dom.document.TestTransformerWithStylesheet(dbf, xsltImplementation));
    }
    addTest(new org.apache.axiom.ts.dom.document.TestValidator(dbf));
    addTest(new org.apache.axiom.ts.dom.documentfragment.TestCloneNodeDeep(dbf));
    addTest(new org.apache.axiom.ts.dom.documentfragment.TestCloneNodeShallow(dbf));
    addTest(new org.apache.axiom.ts.dom.documentfragment.TestLookupNamespaceURI(dbf));
    addTest(new org.apache.axiom.ts.dom.documentfragment.TestLookupPrefix(dbf));
    addTest(new org.apache.axiom.ts.dom.documenttype.TestWithParser1(dbf));
    addTest(new org.apache.axiom.ts.dom.documenttype.TestWithParser2(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAppendChild(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAppendChildCyclic(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAppendChildSelf(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAppendChildWrongDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAttributes(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAttributes2(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAttributes3(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestAttributes4(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestCloneNode(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestCloneNodeWithAttributeHavingMultipleChildren(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestCloneNodeWithAttributes(dbf, true));
    addTest(new org.apache.axiom.ts.dom.element.TestCloneNodeWithAttributes(dbf, false));
    addTest(new org.apache.axiom.ts.dom.element.TestGetElementsByTagName(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestGetElementsByTagNameNS(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestGetElementsByTagNameRecursive(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestGetElementsByTagNameWithNamespaces(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestGetElementsByTagNameWithWildcard(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestGetNamespaceURIWithNoNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestGetPrefixWithDefaultNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestGetTextContent(dbf));
    for (XMLSample file : getInstances(XMLSample.class)) {
        for (DOMImplementation from : getInstances(DOMImplementation.class)) {
            addTest(new org.apache.axiom.ts.dom.element.TestImportNode(dbf, file, from));
        }
    }
    addTest(new org.apache.axiom.ts.dom.element.TestInsertBefore(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestInsertBeforeWithDocumentFragment(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupNamespaceURIDefaultBindings(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupNamespaceURIExplicit(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupNamespaceURIImplicit(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupNamespaceURINamespaceDeclarationAsNSUnawareAttribute(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupNamespaceURIXercesJ1586(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupPrefixDefaultBindings(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupPrefixEmptyNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupPrefixExplicitMasked(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestLookupPrefixImplicitMasked(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestRemoveAttributeNodeForeignImplementation(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestRemoveAttributeNodeNotOwner(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestRemoveFirstChild(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestRemoveLastChild(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestRemoveSingleChild(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildCyclic(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildFirst(dbf, false));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildFirst(dbf, true));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildFirstWithDocumentFragment(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildLast(dbf, false));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildLast(dbf, true));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildLastWithDocumentFragment(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildMiddle(dbf, false));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildMiddle(dbf, true));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildMiddleWithDocumentFragment(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildNotFound(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildNullNewChild(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildSingle(dbf, false));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildSingle(dbf, true));
    addTest(new org.apache.axiom.ts.dom.element.TestReplaceChildWrongDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNodeNSForeignImplementation(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNodeNSInUse(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNodeNSReplace(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNodeNSWrongDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNodeWrongDocument(dbf));
    for (int i = 0; i < validAttrQNames.length; i++) {
        addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNS(dbf, validAttrQNames[i], "value"));
    }
    addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNSExisting(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNSExistingDefaultNamespaceDeclaration(dbf));
    for (int i = 0; i < invalidAttrQNames.length; i++) {
        addTest(new org.apache.axiom.ts.dom.element.TestSetAttributeNSInvalid(dbf, invalidAttrQNames[i]));
    }
    addTest(new org.apache.axiom.ts.dom.element.TestSetPrefixNotNullWithNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetPrefixNotNullWithoutNamespace(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetPrefixNull(dbf));
    addTest(new org.apache.axiom.ts.dom.element.TestSetTextContent(dbf));
    addTest(new org.apache.axiom.ts.dom.element.attributes.TestSetNamedItemNSWrongDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.element.attributes.TestSetNamedItemWrongDocument(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestAppendData(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestGetChildNodes(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestGetLength(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestGetWholeText(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestGetWholeTextWithCDATASection(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestGetWholeTextWithComment(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestLookupNamespaceURIWithoutParent(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestReplaceDataAppend(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestSetPrefix(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestSplitText(dbf));
    addTest(new org.apache.axiom.ts.dom.text.TestSplitTextWithoutParent(dbf));
    DOMTestDocumentBuilderFactory factory;
    try {
        factory = new DOMTestDocumentBuilderFactoryImpl(dbff, new DocumentBuilderSetting[] { DocumentBuilderSetting.notCoalescing, DocumentBuilderSetting.notExpandEntityReferences, DocumentBuilderSetting.notIgnoringElementContentWhitespace, DocumentBuilderSetting.namespaceAware, DocumentBuilderSetting.notValidating });
    } catch (DOMTestIncompatibleException ex) {
        // TODO
        throw new Error(ex);
    }
    try {
        addW3CTests(factory, new org.w3c.domts.level1.core.alltests(factory));
        addW3CTests(factory, new org.w3c.domts.level2.core.alltests(factory));
        addW3CTests(factory, new org.w3c.domts.level3.core.alltests(factory));
    } catch (Exception ex) {
        // TODO
        throw new Error(ex);
    }
}
Also used : DOMTestDocumentBuilderFactory(org.w3c.domts.DOMTestDocumentBuilderFactory) DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) DocumentBuilderSetting(org.w3c.domts.DocumentBuilderSetting) XMLSample(org.apache.axiom.ts.xml.XMLSample) DOMTestIncompatibleException(org.w3c.domts.DOMTestIncompatibleException) DOMTestDocumentBuilderFactory(org.w3c.domts.DOMTestDocumentBuilderFactory) XSLTImplementation(org.apache.axiom.ts.jaxp.XSLTImplementation) XMLConstants(javax.xml.XMLConstants) DOMImplementation(org.apache.axiom.ts.jaxp.DOMImplementation) InvocationTargetException(java.lang.reflect.InvocationTargetException) DOMTestIncompatibleException(org.w3c.domts.DOMTestIncompatibleException)

Aggregations

DOMTestDocumentBuilderFactory (org.w3c.domts.DOMTestDocumentBuilderFactory)76 JUnitTestSuiteAdapter (org.w3c.domts.JUnitTestSuiteAdapter)75 Constructor (java.lang.reflect.Constructor)73 JAXPDOMTestDocumentBuilderFactory (org.w3c.domts.JAXPDOMTestDocumentBuilderFactory)60 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)31 LSDocumentBuilderFactory (org.w3c.domts.LSDocumentBuilderFactory)17 BatikTestDocumentBuilderFactory (org.w3c.domts.BatikTestDocumentBuilderFactory)7 TestSuite (junit.framework.TestSuite)2 DOM4JTestDocumentBuilderFactory (org.w3c.domts.DOM4JTestDocumentBuilderFactory)2 DOMTestSuite (org.w3c.domts.DOMTestSuite)2 JTidyDocumentBuilderFactory (org.w3c.domts.JTidyDocumentBuilderFactory)2 XalanDOMTestDocumentBuilderFactory (org.w3c.domts.XalanDOMTestDocumentBuilderFactory)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 XMLConstants (javax.xml.XMLConstants)1 DOMImplementation (org.apache.axiom.ts.jaxp.DOMImplementation)1 XSLTImplementation (org.apache.axiom.ts.jaxp.XSLTImplementation)1 XMLSample (org.apache.axiom.ts.xml.XMLSample)1 DOMTestIncompatibleException (org.w3c.domts.DOMTestIncompatibleException)1 DocumentBuilderSetting (org.w3c.domts.DocumentBuilderSetting)1 XercesHTML2DocumentBuilderFactory (org.w3c.domts.XercesHTML2DocumentBuilderFactory)1