FileDocCategorySizeDatePackage
IsSupported.javaAPI DocAndroid 1.5 API9614Wed May 06 22:41:06 BST 2009tests.org.w3c.dom

IsSupported

public final class IsSupported extends DOMTestCase
The "feature" parameter in the isSupported(feature,version)" method is the name of the feature and the version is the version number of the feature to test. XXX is NOT a legal value for the feature parameter. The method should return "false" since XXX is not a valid feature. Retrieve the root node of the DOM document by invoking the "getDocumentElement()" method. This should create a node object on which the "isSupported(feature,version)" method is invoked with "feature" equal to "XXX" and version to "1.0". The method should return a boolean "false" since XXX is not a valid feature.
author
NIST
author
Mary Brady
see
http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports

Fields Summary
DOMDocumentBuilderFactory
factory
DocumentBuilder
builder
Constructors Summary
Methods Summary
protected voidsetUp()

        super.setUp();
        try {
            factory = new DOMDocumentBuilderFactory(DOMDocumentBuilderFactory
                    .getConfiguration1());
            builder = factory.getBuilder();
        } catch (Exception e) {
            fail("Unexpected exception" + e.getMessage());
        }
    
protected voidtearDown()

        factory = null;
        builder = null;
        super.tearDown();
    
public voidtestIsSupported1()
Runs the test case.

throws
Throwable Any uncaught exception causes test to fail

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("XXX", "1.0");
        assertFalse("throw_False", state);
    
public voidtestIsSupported10()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("CORE", "2.0");
        assertTrue("throw_True", state);
    
public voidtestIsSupported11()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("XML", "2.0");
        assertTrue("throw_True", state);
    
public voidtestIsSupported12()

        List<String> features = new ArrayList<String>();
        features.add("Core");
        features.add("XML");
        features.add("HTML");
        features.add("Views");
        features.add("StyleSheets");
        features.add("CSS");
        features.add("CSS2");
        features.add("Events");
        features.add("UIEvents");
        features.add("MouseEvents");
        features.add("MutationEvents");
        features.add("HTMLEvents");
        features.add("Range");
        features.add("Traversal");
        features.add("bogus.bogus.bogus");

        Document doc;
        Node rootNode;
        String featureElement;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("Core", "2.0");
        assertTrue("Core2", state);
        for (int indexN10078 = 0; indexN10078 < features.size(); indexN10078++) {
            featureElement = (String) features.get(indexN10078);
            state = rootNode.isSupported(featureElement, "1.0");
        }
        for (int indexN10083 = 0; indexN10083 < features.size(); indexN10083++) {
            featureElement = (String) features.get(indexN10083);
            state = rootNode.isSupported(featureElement, "2.0");
        }
    
public voidtestIsSupported13()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("Core", "");
        assertTrue("Core", state);
    
public voidtestIsSupported14()

        Document doc;
        Node rootNode;
        boolean state;
        String nullString = null;

        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("Core", nullString);
        assertTrue("Core", state);
    
public voidtestIsSupported2()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("XML", "9.0");
        assertFalse("throw_False", state);
    
public voidtestIsSupported4()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("xml", "1.0");
        assertTrue("throw_True", state);
    
public voidtestIsSupported5()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("core", "2.0");
        assertTrue("throw_True", state);
    
public voidtestIsSupported6()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("xml", "2.0");
        assertTrue("throw_True", state);
    
public voidtestIsSupported7()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("XML", "");
        assertTrue("throw_True", state);
    
public voidtestIsSupported9()

        Document doc;
        Node rootNode;
        boolean state;
        doc = (Document) load("staff", builder);
        rootNode = doc.getDocumentElement();
        state = rootNode.isSupported("XML", "1.0");
        assertTrue("throw_True", state);