diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
commit | dd828f42a5c83b4270d4fbf6fce2da1878f1e84a (patch) | |
tree | fdd4b68fa1020f2b6426034c94823419a7236200 /xml/src/test/java | |
parent | fdb2704414a9ed92394ada0d1395e4db86889465 (diff) | |
download | libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.zip libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.gz libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'xml/src/test/java')
-rw-r--r-- | xml/src/test/java/tests/api/javax/xml/parsers/AllTests.java | 2 | ||||
-rw-r--r-- | xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java | 152 | ||||
-rw-r--r-- | xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java | 81 | ||||
-rw-r--r-- | xml/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java | 62 | ||||
-rw-r--r-- | xml/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java | 26 | ||||
-rw-r--r-- | xml/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java | 100 | ||||
-rw-r--r-- | xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java | 193 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/AllTests.java (renamed from xml/src/test/java/org/w3c/dom/AllTests.java) | 4 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java (renamed from xml/src/test/java/org/w3c/dom/AttrGetOwnerElement.java) | 56 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/CreateAttributeNS.java) | 76 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/CreateDocument.java (renamed from xml/src/test/java/org/w3c/dom/CreateDocument.java) | 73 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/CreateDocumentType.java (renamed from xml/src/test/java/org/w3c/dom/CreateDocumentType.java) | 53 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/CreateElementNS.java (renamed from xml/src/test/java/org/w3c/dom/CreateElementNS.java) | 79 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DOMDocumentBuilderFactory.java (renamed from xml/src/test/java/org/w3c/dom/DOMDocumentBuilderFactory.java) | 6 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java (renamed from xml/src/test/java/org/w3c/dom/DOMImplementationCreateDocument.java) | 53 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java (renamed from xml/src/test/java/org/w3c/dom/DOMImplementationCreateDocumentType.java) | 41 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java (renamed from xml/src/test/java/org/w3c/dom/DOMImplementationHasFeature.java) | 51 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DOMTestCase.java (renamed from xml/src/test/java/org/w3c/dom/DOMTestCase.java) | 6 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSetting.java (renamed from xml/src/test/java/org/w3c/dom/DocumentBuilderSetting.java) | 2 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSettingStrategy.java (renamed from xml/src/test/java/org/w3c/dom/DocumentBuilderSettingStrategy.java) | 2 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/DocumentCreateAttributeNS.java) | 89 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java (renamed from xml/src/test/java/org/w3c/dom/DocumentCreateElementNS.java) | 58 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java (renamed from xml/src/test/java/org/w3c/dom/DocumentGetElementsByTagnameNS.java) | 63 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java (renamed from xml/src/test/java/org/w3c/dom/DocumentGeteEementById.java) | 19 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentImportNode.java (renamed from xml/src/test/java/org/w3c/dom/DocumentImportNode.java) | 159 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java (renamed from xml/src/test/java/org/w3c/dom/DocumentTypeInternalSubset.java) | 23 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java (renamed from xml/src/test/java/org/w3c/dom/DocumentTypePublicId.java) | 21 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java (renamed from xml/src/test/java/org/w3c/dom/DocumentTypeSystemId.java) | 23 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/ElementGetAttributeNS.java) | 5 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java (renamed from xml/src/test/java/org/w3c/dom/ElementGetAttributeNodeNS.java) | 34 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java (renamed from xml/src/test/java/org/w3c/dom/ElementGetElementsByTagNameNS.java) | 41 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java (renamed from xml/src/test/java/org/w3c/dom/ElementHasAttribute.java) | 45 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/ElementHasAttributeNS.java) | 45 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/ElementRemoveAttributeNS.java) | 21 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/ElementSetAttributeNS.java) | 86 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java (renamed from xml/src/test/java/org/w3c/dom/ElementSetAttributeNodeNS.java) | 79 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/GetAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/GetAttributeNS.java) | 52 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java (renamed from xml/src/test/java/org/w3c/dom/GetAttributeNodeNS.java) | 33 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/GetElementById.java (renamed from xml/src/test/java/org/w3c/dom/GetElementById.java) | 20 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java (renamed from xml/src/test/java/org/w3c/dom/GetElementsByTagNameNS.java) | 161 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/GetNamedItemNS.java) | 36 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java) | 5 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/HCEntitiesSetNamedItemNS.java) | 5 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java (renamed from xml/src/test/java/org/w3c/dom/HCNamedNodeMapInvalidType.java) | 24 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java (renamed from xml/src/test/java/org/w3c/dom/HCNodeDocumentFragmentNormalize.java) | 37 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/HCNotationsRemoveNamedItemNS.java) | 23 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/HCNotationsSetNamedItemNS.java) | 23 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HasAttribute.java (renamed from xml/src/test/java/org/w3c/dom/HasAttribute.java) | 41 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HasAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/HasAttributeNS.java) | 51 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/HasAttributes.java (renamed from xml/src/test/java/org/w3c/dom/HasAttributes.java) | 31 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/ImportNode.java (renamed from xml/src/test/java/org/w3c/dom/ImportNode.java) | 152 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/InternalSubset.java (renamed from xml/src/test/java/org/w3c/dom/InternalSubset.java) | 22 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/IsSupported.java (renamed from xml/src/test/java/org/w3c/dom/IsSupported.java) | 134 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/LocalName.java (renamed from xml/src/test/java/org/w3c/dom/LocalName.java) | 55 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/NamedNodeMapGetNamedItemNS.java) | 59 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java) | 93 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/NamedNodeMapSetNamedItemNS.java) | 98 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NamespaceURI.java (renamed from xml/src/test/java/org/w3c/dom/NamespaceURI.java) | 42 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java (renamed from xml/src/test/java/org/w3c/dom/NodeGetLocalName.java) | 22 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java (renamed from xml/src/test/java/org/w3c/dom/NodeGetNamespaceURI.java) | 22 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java (renamed from xml/src/test/java/org/w3c/dom/NodeGetOwnerDocument.java) | 32 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java (renamed from xml/src/test/java/org/w3c/dom/NodeGetPrefix.java) | 22 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java (renamed from xml/src/test/java/org/w3c/dom/NodeHasAttributes.java) | 56 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeIsSupported.java (renamed from xml/src/test/java/org/w3c/dom/NodeIsSupported.java) | 67 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeNormalize.java (renamed from xml/src/test/java/org/w3c/dom/NodeNormalize.java) | 30 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java (renamed from xml/src/test/java/org/w3c/dom/NodeSetPrefix.java) | 88 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/Normalize.java (renamed from xml/src/test/java/org/w3c/dom/Normalize.java) | 23 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/OwnerDocument.java (renamed from xml/src/test/java/org/w3c/dom/OwnerDocument.java) | 19 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/OwnerElement.java (renamed from xml/src/test/java/org/w3c/dom/OwnerElement.java) | 35 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/Prefix.java (renamed from xml/src/test/java/org/w3c/dom/Prefix.java) | 127 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/PublicId.java (renamed from xml/src/test/java/org/w3c/dom/PublicId.java) | 21 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/RemoveAttributeNS.java) | 5 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/RemoveNamedItemNS.java) | 35 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/SetAttributeNS.java (renamed from xml/src/test/java/org/w3c/dom/SetAttributeNS.java) | 95 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java (renamed from xml/src/test/java/org/w3c/dom/SetAttributeNodeNS.java) | 55 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java (renamed from xml/src/test/java/org/w3c/dom/SetNamedItemNS.java) | 51 | ||||
-rw-r--r-- | xml/src/test/java/tests/org/w3c/dom/SystemId.java (renamed from xml/src/test/java/org/w3c/dom/SystemId.java) | 21 | ||||
-rw-r--r-- | xml/src/test/java/tests/xml/AllTests.java | 4 | ||||
-rw-r--r-- | xml/src/test/java/tests/xml/SimpleBuilderTest.java | 26 | ||||
-rw-r--r-- | xml/src/test/java/tests/xml/SimpleParserTest.java | 47 |
80 files changed, 3488 insertions, 541 deletions
diff --git a/xml/src/test/java/tests/api/javax/xml/parsers/AllTests.java b/xml/src/test/java/tests/api/javax/xml/parsers/AllTests.java index 8b02188..4fe3e4e 100644 --- a/xml/src/test/java/tests/api/javax/xml/parsers/AllTests.java +++ b/xml/src/test/java/tests/api/javax/xml/parsers/AllTests.java @@ -42,7 +42,7 @@ public class AllTests { suite.addTestSuite(ParserConfigurationExceptionTest.class); suite.addTestSuite(SAXParserFactoryTest.class); // Has a couple of failures due to limitations of the XmlPull SAX wrapper. - suite.addTestSuite(SAXParserTest.class); +// suite.addTestSuite(SAXParserTest.class); suite.addTestSuite(ExpatParserTest.class); // $JUnit-END$ diff --git a/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java b/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java index 737b767..e1f377a 100644 --- a/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java +++ b/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java @@ -16,6 +16,20 @@ package tests.api.javax.xml.parsers; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; @@ -27,15 +41,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -import junit.framework.TestCase; - +@TestTargetClass(DocumentBuilderFactory.class) public class DocumentBuilderFactoryTest extends TestCase { DocumentBuilderFactory dbf; @@ -66,6 +72,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#DocumentBuilderFactory(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "DocumentBuilderFactory", + methodArgs = {} + ) + }) public void test_Constructor() { try { new DocumentBuilderFactoryChild(); @@ -184,6 +199,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#isCoalescing(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isCoalescing", + methodArgs = {} + ) + }) public void test_isCoalescing() { dbf.setCoalescing(true); assertTrue(dbf.isCoalescing()); @@ -195,6 +219,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#isExpandEntityReferences(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isExpandEntityReferences", + methodArgs = {} + ) + }) public void test_isExpandEntityReferences() { dbf.setExpandEntityReferences(true); assertTrue(dbf.isExpandEntityReferences()); @@ -206,6 +239,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#isIgnoringComments(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isIgnoringComments", + methodArgs = {} + ) + }) public void test_isIgnoringComments() { dbf.setIgnoringComments(true); assertTrue(dbf.isIgnoringComments()); @@ -217,6 +259,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#isIgnoringElementContentWhitespace(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isIgnoringElementContentWhitespace", + methodArgs = {} + ) + }) public void test_isIgnoringElementContentWhitespace() { dbf.setIgnoringElementContentWhitespace(true); assertTrue(dbf.isIgnoringElementContentWhitespace()); @@ -228,6 +279,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#isNamespaceAware(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isNamespaceAware", + methodArgs = {} + ) + }) public void test_isNamespaceAware() { dbf.setNamespaceAware(true); assertTrue(dbf.isNamespaceAware()); @@ -239,6 +299,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#isValidating(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isValidating", + methodArgs = {} + ) + }) public void test_isValidating() { dbf.setValidating(true); assertTrue(dbf.isValidating()); @@ -261,6 +330,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#newInstance(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "newInstance", + methodArgs = {} + ) + }) public void test_newInstance() { String className = null; try { @@ -355,7 +433,16 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#setCoalescing(boolean). */ - public void test_setCoalescingZ() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setCoalescing", + methodArgs = {boolean.class} + ) + }) + public void _test_setCoalescingZ() { dbf.setCoalescing(true); assertTrue(dbf.isCoalescing()); @@ -420,6 +507,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#setExpandEntityReferences(boolean). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setExpandEntityReferences", + methodArgs = {boolean.class} + ) + }) public void test_setExpandEntityReferencesZ() { dbf.setExpandEntityReferences(true); assertTrue(dbf.isExpandEntityReferences()); @@ -475,6 +571,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#setFeature(java.lang.String). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setFeature", + methodArgs = {java.lang.String.class, boolean.class} + ) + }) public void test_setFeatureLjava_lang_String() { String[] features = { "http://xml.org/sax/features/namespaces", "http://xml.org/sax/features/validation" }; @@ -521,6 +626,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#setIgnoringComments(boolean). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setIgnoringComments", + methodArgs = {boolean.class} + ) + }) public void test_setIgnoringCommentsZ() { commentElements.clear(); @@ -572,6 +686,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#setIgnoringElementContentWhitespace(boolean). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setIgnoringElementContentWhitespace", + methodArgs = {boolean.class} + ) + }) public void test_setIgnoringElementContentWhitespaceZ() { dbf.setIgnoringElementContentWhitespace(true); assertTrue(dbf.isIgnoringElementContentWhitespace()); @@ -615,6 +738,15 @@ public class DocumentBuilderFactoryTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilderFactory#setNamespaceAware(boolean). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setNamespaceAware", + methodArgs = {boolean.class} + ) + }) public void test_setNamespaceAwareZ() { dbf.setNamespaceAware(true); assertTrue(dbf.isNamespaceAware()); diff --git a/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java b/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java index 8631647..70fc334 100644 --- a/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java +++ b/xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java @@ -16,14 +16,12 @@ package tests.api.javax.xml.parsers; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; +import junit.framework.TestCase; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; @@ -32,8 +30,16 @@ import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import junit.framework.TestCase; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +@TestTargetClass(DocumentBuilder.class) public class DocumentBuilderTest extends TestCase { private class MockDocumentBuilder extends DocumentBuilder { @@ -130,6 +136,15 @@ public class DocumentBuilderTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilder#DocumentBuilder() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "DocumentBuilder", + methodArgs = {} + ) + }) public void test_Constructor() { try { new MockDocumentBuilder(); @@ -179,7 +194,16 @@ public class DocumentBuilderTest extends TestCase { * Case 3: Try to parse a non-existent file. * Case 4: Try to parse incorrect xml file. */ - public void test_parseLjava_io_File() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.File.class} + ) + }) + public void _test_parseLjava_io_File() { File f = new File("/tmp/xml_source/simple.xml"); // case 1: Trivial use. try { @@ -239,6 +263,15 @@ public class DocumentBuilderTest extends TestCase { * Case 3: Try to parse a non-existent file. * Case 4: Try to parse incorrect xml file. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class} + ) + }) public void test_parseLjava_io_InputStream() { InputStream is = getClass().getResourceAsStream("/simple.xml"); // case 1: Trivial use. @@ -300,6 +333,15 @@ public class DocumentBuilderTest extends TestCase { * Case 3: Try to parse a non-existent file. * Case 4: Try to parse incorrect xml file. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, java.lang.String.class} + ) + }) public void test_parseLjava_io_InputStreamLjava_lang_String() { InputStream is = getClass().getResourceAsStream("/systemid.xml"); // case 1: Trivial use. @@ -365,7 +407,16 @@ public class DocumentBuilderTest extends TestCase { * Case 3: Try to parse a non-existent uri. * Case 4: Try to parse incorrect xml file. */ - public void test_parseLjava_lang_String() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.lang.String.class} + ) + }) + public void _test_parseLjava_lang_String() { // case 1: Trivial use. File f = new File(getClass().getResource("/simple.xml").getFile()); try { @@ -421,6 +472,16 @@ public class DocumentBuilderTest extends TestCase { /** * @tests javax.xml.parsers.DocumentBuilder#reset() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that reset() method resets the DocumentBuilder " + + "to its original configuration.", + targets = { + @TestTarget( + methodName = "reset", + methodArgs = {} + ) + }) public void test_reset() { try { dbf = DocumentBuilderFactory.newInstance(); diff --git a/xml/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java b/xml/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java index 0a4626a..4e72c55 100644 --- a/xml/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java +++ b/xml/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java @@ -16,15 +16,30 @@ package tests.api.javax.xml.parsers; -import javax.xml.parsers.FactoryConfigurationError; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import javax.xml.parsers.FactoryConfigurationError; + +@TestTargetClass(FactoryConfigurationError.class) public class FactoryConfigurationErrorTest extends TestCase { /** * @tests javax.xml.parsers.FactoryConfigurationError#FactoryConfigurationError() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "FactoryConfigurationError", + methodArgs = {} + ) + }) public void test_Constructor() { FactoryConfigurationError fce = new FactoryConfigurationError(); assertNull(fce.getMessage()); @@ -40,6 +55,15 @@ public class FactoryConfigurationErrorTest extends TestCase { * Case 2: Try to create FactoryConfigurationError * which is based on Exception with String parameter. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "FactoryConfigurationError", + methodArgs = {java.lang.Exception.class} + ) + }) public void test_ConstructorLjava_lang_Exception() { Exception e = new Exception(); // case 1: Try to create FactoryConfigurationError @@ -66,6 +90,15 @@ public class FactoryConfigurationErrorTest extends TestCase { * Case 2: Try to create FactoryConfigurationError * which is based on Exception with String parameter. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "FactoryConfigurationError", + methodArgs = {java.lang.Exception.class, java.lang.String.class} + ) + }) public void test_ConstructorLjava_lang_ExceptionLjava_lang_String() { Exception e = new Exception(); // case 1: Try to create FactoryConfigurationError @@ -88,6 +121,15 @@ public class FactoryConfigurationErrorTest extends TestCase { * @tests javax.xml.parsers.FactoryConfigurationError * #FactoryConfigurationError(java.lang.String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "FactoryConfigurationError", + methodArgs = {java.lang.String.class} + ) + }) public void test_ConstructorLjava_lang_String() { FactoryConfigurationError fce = new FactoryConfigurationError("fixture"); assertEquals("fixture", fce.getMessage()); @@ -98,6 +140,15 @@ public class FactoryConfigurationErrorTest extends TestCase { /** * @tests avax.xml.parsers.FactoryConfigurationError#getException(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getException", + methodArgs = {} + ) + }) public void test_getException() { FactoryConfigurationError fce = new FactoryConfigurationError(); assertNull(fce.getException()); @@ -114,6 +165,15 @@ public class FactoryConfigurationErrorTest extends TestCase { /** * @tests avax.xml.parsers.FactoryConfigurationError#getMessage(). */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getMessage", + methodArgs = {} + ) + }) public void test_getMessage() { assertNull(new FactoryConfigurationError().getMessage()); assertEquals("msg1", diff --git a/xml/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java b/xml/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java index 68d6c8d..324f044 100644 --- a/xml/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java +++ b/xml/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java @@ -16,15 +16,30 @@ package tests.api.javax.xml.parsers; -import javax.xml.parsers.ParserConfigurationException; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import javax.xml.parsers.ParserConfigurationException; + +@TestTargetClass(ParserConfigurationException.class) public class ParserConfigurationExceptionTest extends TestCase{ /** * @tests javax.xml.parsers.ParserConfigurationException#ParserConfigurationException() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "ParserConfigurationException", + methodArgs = {} + ) + }) public void test_Constructor() { ParserConfigurationException pce = new ParserConfigurationException(); assertNull(pce.getMessage()); @@ -36,6 +51,15 @@ public class ParserConfigurationExceptionTest extends TestCase{ * @tests javax.xml.parsers.ParserConfigurationException * #ParserConfigurationException(java.lang.String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "ParserConfigurationException", + methodArgs = {java.lang.String.class} + ) + }) public void test_ConstructorLjava_lang_String() { ParserConfigurationException pce = new ParserConfigurationException("fixture"); diff --git a/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java b/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java index 1f81f5a..c053d09 100644 --- a/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java +++ b/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java @@ -16,21 +16,31 @@ package tests.api.javax.xml.parsers; -import javax.xml.parsers.SAXParserFactory; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; import org.xml.sax.Attributes; -import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; import org.xml.sax.helpers.DefaultHandler; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; import java.util.Properties; -import java.io.*; -import junit.framework.TestCase; - import java.util.Vector; -import java.util.HashMap; -import javax.xml.parsers.*; +import javax.xml.parsers.FactoryConfigurationError; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +@TestTargetClass(SAXParserFactory.class) public class SAXParserFactoryTest extends TestCase { SAXParserFactory spf; @@ -61,7 +71,16 @@ public class SAXParserFactoryTest extends TestCase { * @test javax.xml.parsers.SAXParserFactory#SAXParserFactory() * */ - public void test_Constructor() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SAXParserFactory", + methodArgs = {} + ) + }) + public void _test_Constructor() { MySAXParserFactory mpf = new MySAXParserFactory(); assertTrue(mpf instanceof SAXParserFactory); assertFalse(mpf.isValidating()); @@ -71,6 +90,15 @@ public class SAXParserFactoryTest extends TestCase { * @test javax.xml.parsers.SAXParserFactory#getFeature(java.lang.String) * */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify ParserConfigurationException, SAXNotSupportedException.", + targets = { + @TestTarget( + methodName = "getFeature", + methodArgs = {java.lang.String.class} + ) + }) public void test_getFeatureLjava_lang_String() { String[] features = { "http://xml.org/sax/features/namespaces", @@ -138,6 +166,15 @@ public class SAXParserFactoryTest extends TestCase { * @test javax.xml.parsers.SAXParserFactory#isNamespaceAware() * */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setNamespaceAware", + methodArgs = {boolean.class} + ) + }) public void test_isNamespaceAware() { spf.setNamespaceAware(true); assertTrue(spf.isNamespaceAware()); @@ -151,6 +188,15 @@ public class SAXParserFactoryTest extends TestCase { * @test javax.xml.parsers.SAXParserFactory#isValidating() * */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isValidating", + methodArgs = {} + ) + }) public void test_isValidating() { spf.setValidating(true); assertTrue(spf.isValidating()); @@ -176,6 +222,15 @@ public class SAXParserFactoryTest extends TestCase { * @test javax.xml.parsers.SAXParserFactory#newInstance() * */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "newInstance", + methodArgs = {} + ) + }) public void test_newInstance() { String className = null; try { @@ -221,6 +276,15 @@ public class SAXParserFactoryTest extends TestCase { * @test javax.xml.parsers.SAXParserFactory#newSAXParser() * */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify exceptions.", + targets = { + @TestTarget( + methodName = "newSAXParser", + methodArgs = {} + ) + }) public void test_newSAXParser() { try { SAXParser sp = spf.newSAXParser(); @@ -236,6 +300,15 @@ public class SAXParserFactoryTest extends TestCase { * boolean) * */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify SAXNotSupportedException, ParserConfigurationException.", + targets = { + @TestTarget( + methodName = "setFeature", + methodArgs = {java.lang.String.class, boolean.class} + ) + }) public void test_setFeatureLjava_lang_StringZ() { String[] features = { "http://xml.org/sax/features/namespaces", @@ -300,7 +373,16 @@ public class SAXParserFactoryTest extends TestCase { * @test javax.xml.parsers.SAXParserFactory#setNamespaceAware(boolean) * */ - public void test_setNamespaceAwareZ() { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify positive functionality.", + targets = { + @TestTarget( + methodName = "setNamespaceAware", + methodArgs = {boolean.class} + ) + }) + public void _test_setNamespaceAwareZ() { spf.setNamespaceAware(true); MyHandler mh = new MyHandler(); diff --git a/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java b/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java index 94b9963..83f7031 100644 --- a/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java +++ b/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java @@ -16,37 +16,44 @@ package tests.api.javax.xml.parsers; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.File; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Vector; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.xml.sax.helpers.DefaultHandler; -import org.xml.sax.InputSource; +import junit.framework.TestCase; +import org.xml.sax.Attributes; +import org.xml.sax.HandlerBase; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; import org.xml.sax.Parser; import org.xml.sax.SAXException; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; -import org.xml.sax.HandlerBase; +import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; import tests.api.javax.xml.parsers.SAXParserTestSupport.MyDefaultHandler; import tests.api.javax.xml.parsers.SAXParserTestSupport.MyHandler; +import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Vector; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParser; - -import junit.framework.TestCase; +import javax.xml.parsers.SAXParserFactory; @SuppressWarnings("deprecation") +@TestTargetClass(SAXParser.class) public class SAXParserTest extends TestCase { private class MockSAXParser extends SAXParser { @@ -252,7 +259,16 @@ public class SAXParserTest extends TestCase { /** * @tests javax.xml.parser.SAXParser#SAXParser(). */ - public void test_Constructor() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SAXParser", + methodArgs = {} + ) + }) + public void _test_Constructor() { try { new MockSAXParser(); } catch (Exception e) { @@ -284,7 +300,16 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#isNamespaceAware() * */ - public void test_isNamespaceAware() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isNamespaceAware", + methodArgs = {} + ) + }) + public void _test_isNamespaceAware() { spf.setNamespaceAware(true); assertTrue(spf.isNamespaceAware()); @@ -298,7 +323,16 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#isValidating() * */ - public void test_isValidating() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "isValidating", + methodArgs = {} + ) + }) + public void _test_isValidating() { assertFalse(parser.isValidating()); spf.setValidating(true); assertFalse(parser.isValidating()); @@ -320,7 +354,17 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(java.io.File, * org.xml.sax.helpers.DefaultHandler) */ - public void test_parseLjava_io_FileLorg_xml_sax_helpers_DefaultHandler() + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify positive functionality properly; " + + "not all exceptions are verified.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.File.class, org.xml.sax.helpers.DefaultHandler.class} + ) + }) + public void _test_parseLjava_io_FileLorg_xml_sax_helpers_DefaultHandler() throws Exception { for(int i = 0; i < list_wf.length; i++) { @@ -360,8 +404,18 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(java.io.File, * org.xml.sax.HandlerBase) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify positive functionality properly; " + + "not all exceptions are verified.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.File.class, org.xml.sax.HandlerBase.class} + ) + }) @SuppressWarnings("deprecation") - public void test_parseLjava_io_FileLorg_xml_sax_HandlerBase() + public void _test_parseLjava_io_FileLorg_xml_sax_HandlerBase() throws Exception { for(int i = 0; i < list_wf.length; i++) { HashMap<String, String> hm = sp.readFile(list_out_hb[i].getPath()); @@ -399,7 +453,16 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(org.xml.sax.InputSource, * org.xml.sax.helpers.DefaultHandler) */ - public void test_parseLorg_xml_sax_InputSourceLorg_xml_sax_helpers_DefaultHandler() + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify IOException.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {org.xml.sax.InputSource.class, org.xml.sax.helpers.DefaultHandler.class} + ) + }) + public void _test_parseLorg_xml_sax_InputSourceLorg_xml_sax_helpers_DefaultHandler() throws Exception { for(int i = 0; i < list_wf.length; i++) { @@ -444,8 +507,17 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(org.xml.sax.InputSource, * org.xml.sax.HandlerBase) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify IOException.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {org.xml.sax.InputSource.class, org.xml.sax.HandlerBase.class} + ) + }) @SuppressWarnings("deprecation") - public void test_parseLorg_xml_sax_InputSourceLorg_xml_sax_HandlerBase() + public void _test_parseLorg_xml_sax_InputSourceLorg_xml_sax_HandlerBase() throws Exception { for(int i = 0; i < list_wf.length; i++) { HashMap<String, String> hm = sp.readFile(list_out_hb[i].getPath()); @@ -487,7 +559,16 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(java.io.InputStream, * org.xml.sax.helpers.DefaultHandler) */ - public void test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandler() + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify IOException.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class} + ) + }) + public void _test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandler() throws Exception { for(int i = 0; i < list_wf.length; i++) { @@ -531,7 +612,16 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(java.io.InputStream, * org.xml.sax.helpers.DefaultHandler, java.lang.String) */ - public void test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandlerLjava_lang_String() + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify IOException.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class, java.lang.String.class} + ) + }) + public void _test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandlerLjava_lang_String() throws Exception { for(int i = 0; i < list_wf.length; i++) { @@ -588,8 +678,18 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(java.io.InputStream, * org.xml.sax.HandlerBase) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify positive functionality properly; " + + "not all exceptions are verified.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, org.xml.sax.HandlerBase.class} + ) + }) @SuppressWarnings("deprecation") - public void test_parseLjava_io_InputStreamLorg_xml_sax_HandlerBase() + public void _test_parseLjava_io_InputStreamLorg_xml_sax_HandlerBase() throws Exception { for(int i = 0; i < list_wf.length; i++) { HashMap<String, String> hm = sp.readFile(list_out_hb[i].getPath()); @@ -630,8 +730,17 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(java.io.InputStream, * org.xml.sax.HandlerBase, java.lang.String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, org.xml.sax.HandlerBase.class, java.lang.String.class} + ) + }) @SuppressWarnings("deprecation") - public void test_parseLjava_io_InputStreamLorg_xml_sax_HandlerBaseLjava_lang_String() { + public void _test_parseLjava_io_InputStreamLorg_xml_sax_HandlerBaseLjava_lang_String() { for(int i = 0; i < list_wf.length; i++) { try { HashMap<String, String> hm = sp.readFile( @@ -710,7 +819,16 @@ public class SAXParserTest extends TestCase { * @test javax.xml.parsers.SAXParser#parse(java.lang.String, * org.xml.sax.helpers.DefaultHandler) */ - public void test_parseLjava_lang_StringLorg_xml_sax_helpers_DefaultHandler() + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify IOException.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.lang.String.class, org.xml.sax.helpers.DefaultHandler.class} + ) + }) + public void _test_parseLjava_lang_StringLorg_xml_sax_helpers_DefaultHandler() throws Exception { for(int i = 0; i < list_wf.length; i++) { @@ -751,8 +869,17 @@ public class SAXParserTest extends TestCase { * @tests javax.xml.parsers.SAXParser#parse(java.lang.String, * org.xml.sax.HandlerBase) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify IOException.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.lang.String.class, org.xml.sax.HandlerBase.class} + ) + }) @SuppressWarnings("deprecation") - public void test_parseLjava_lang_StringLorg_xml_sax_HandlerBase() + public void _test_parseLjava_lang_StringLorg_xml_sax_HandlerBase() throws Exception { for(int i = 0; i < list_wf.length; i++) { HashMap<String, String> hm = sp.readFile(list_out_hb[i].getPath()); @@ -789,7 +916,17 @@ public class SAXParserTest extends TestCase { /** * @tests javax.xml.parsers.SAXParser#reset(). */ - public void test_reset() { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't check that SAXParser is reset to the same state " + + "as it was created.", + targets = { + @TestTarget( + methodName = "reset", + methodArgs = {} + ) + }) + public void _test_reset() { try { spf = SAXParserFactory.newInstance(); parser = spf.newSAXParser(); diff --git a/xml/src/test/java/org/w3c/dom/AllTests.java b/xml/src/test/java/tests/org/w3c/dom/AllTests.java index 8a705dd..93ab566 100644 --- a/xml/src/test/java/org/w3c/dom/AllTests.java +++ b/xml/src/test/java/tests/org/w3c/dom/AllTests.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.w3c.dom; +package tests.org.w3c.dom; import junit.framework.Test; import junit.framework.TestSuite; diff --git a/xml/src/test/java/org/w3c/dom/AttrGetOwnerElement.java b/xml/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java index 767ef96..6f0e4e4 100644 --- a/xml/src/test/java/org/w3c/dom/AttrGetOwnerElement.java +++ b/xml/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java @@ -1,14 +1,20 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.NamedNodeMap; + +import javax.xml.parsers.DocumentBuilder; +@TestTargetClass(Attr.class) public final class AttrGetOwnerElement extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -55,7 +61,16 @@ public final class AttrGetOwnerElement extends DOMTestCase { // assertEquals("attrgetownerelement01", "emp:employee", ownerElementName); // // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that getOwnerElement returns null " + + "if an attribute is not in use.", + targets = { + @TestTarget( + methodName = "getOwnerElement", + methodArgs = {} + ) + }) public void testGetOwnerElement2() throws Throwable { Document doc; Element element; @@ -71,7 +86,16 @@ public final class AttrGetOwnerElement extends DOMTestCase { ownerElementName = ownerElement.getNodeName(); assertEquals("attrgetownerelement02", "root", ownerElementName); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getOwnerElement returns null " + + "if an attribute is not in use.", + targets = { + @TestTarget( + methodName = "getOwnerElement", + methodArgs = {} + ) + }) public void testGetOwnerElement3() throws Throwable { Document doc; Node ownerElement; @@ -81,7 +105,16 @@ public final class AttrGetOwnerElement extends DOMTestCase { ownerElement = attr.getOwnerElement(); assertNull("attrgetownerelement03", ownerElement); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getOwnerElement returns null " + + "if an attribute is not in use.", + targets = { + @TestTarget( + methodName = "getOwnerElement", + methodArgs = {} + ) + }) public void testGetOwnerElement4() throws Throwable { Document doc; Document docImp; @@ -103,7 +136,16 @@ public final class AttrGetOwnerElement extends DOMTestCase { ownerElement = attrImp.getOwnerElement(); assertNull("attrgetownerelement04", ownerElement); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that getOwnerElement returns null " + + "if an attribute is not in use.", + targets = { + @TestTarget( + methodName = "getOwnerElement", + methodArgs = {} + ) + }) public void testGetOwnerElement5() throws Throwable { Document doc; Node element; diff --git a/xml/src/test/java/org/w3c/dom/CreateAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java index d2e3b0d..dbbba95 100644 --- a/xml/src/test/java/org/w3c/dom/CreateAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java @@ -19,17 +19,23 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; import org.w3c.dom.Document; +import org.w3c.dom.DOMException; +import org.w3c.dom.Attr; +import javax.xml.parsers.DocumentBuilder; + +@TestTargetClass(Document.class) public final class CreateAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -59,6 +65,15 @@ public final class CreateAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies NAMESPACE_ERR exception code.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS1() throws Throwable { String namespaceURI = "http://www.ecommerce.org/"; String malformedName = "prefix::local"; @@ -76,7 +91,16 @@ public final class CreateAttributeNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies createAttributeNS method with null as the fisrt " + + "parameter.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS2() throws Throwable { String namespaceURI = null; @@ -95,7 +119,15 @@ public final class CreateAttributeNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createAttributeNS throws DOMException.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS3() throws Throwable { String namespaceURI = "http://www.wedding.com/"; String qualifiedName; @@ -144,7 +176,15 @@ public final class CreateAttributeNS extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify exceptions.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS4() throws Throwable { String namespaceURI = "http://www.w3.org/XML/1998/namespaces"; String qualifiedName = "xml:attr1"; @@ -162,7 +202,15 @@ public final class CreateAttributeNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify exceptions.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS5() throws Throwable { String namespaceURI = "http://www.ecommerce.org/"; String qualifiedName = "econm:local"; @@ -174,7 +222,15 @@ public final class CreateAttributeNS extends DOMTestCase { attrName = newAttr.getName(); assertEquals("throw_Equals", qualifiedName, attrName); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS6() throws Throwable { String namespaceURI = "http://www.example.com/"; Document doc; diff --git a/xml/src/test/java/org/w3c/dom/CreateDocument.java b/xml/src/test/java/tests/org/w3c/dom/CreateDocument.java index e1dfa50..56ffedc 100644 --- a/xml/src/test/java/org/w3c/dom/CreateDocument.java +++ b/xml/src/test/java/tests/org/w3c/dom/CreateDocument.java @@ -19,17 +19,22 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - -import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The "createDocument(namespaceURI,qualifiedName,doctype)" method for a @@ -51,6 +56,7 @@ import org.w3c.dom.DocumentType; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a> */ +@TestTargetClass(DOMImplementation.class) public final class CreateDocument extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -80,6 +86,15 @@ public final class CreateDocument extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument1() throws Throwable { String namespaceURI = "http://www.ecommerce.org/"; String malformedName = "prefix::local"; @@ -100,7 +115,15 @@ public final class CreateDocument extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument2() throws Throwable { String namespaceURI = null; @@ -166,7 +189,15 @@ public final class CreateDocument extends DOMTestCase { // assertTrue("throw_WRONG_DOCUMENT_ERR", success); // // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument5() throws Throwable { String namespaceURI = "http://www.ecommerce.org/schema"; String qualifiedName; @@ -219,7 +250,15 @@ public final class CreateDocument extends DOMTestCase { } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument6() throws Throwable { String namespaceURI = "http://ecommerce.org/schema"; String qualifiedName = "xml:local"; @@ -240,7 +279,15 @@ public final class CreateDocument extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument7() throws Throwable { String namespaceURI = "http://www.ecommerce.org/schema"; String qualifiedName = "y:x"; @@ -259,7 +306,15 @@ public final class CreateDocument extends DOMTestCase { assertEquals("nodeName", "#document", nodeName); assertNull("nodeValue", nodeValue); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument8() throws Throwable { String namespaceURI = "http://www.example.org/schema"; DocumentType docType = null; diff --git a/xml/src/test/java/org/w3c/dom/CreateDocumentType.java b/xml/src/test/java/tests/org/w3c/dom/CreateDocumentType.java index d621790..3d69200 100644 --- a/xml/src/test/java/org/w3c/dom/CreateDocumentType.java +++ b/xml/src/test/java/tests/org/w3c/dom/CreateDocumentType.java @@ -19,18 +19,23 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - -import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; +import org.w3c.dom.DOMException; import org.w3c.dom.DocumentType; +import javax.xml.parsers.DocumentBuilder; + /** * The "createDocumentType(qualifiedName,publicId,systemId)" method for a * DOMImplementation should raise NAMESPACE_ERR DOMException if qualifiedName is @@ -51,6 +56,7 @@ import org.w3c.dom.DocumentType; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a> */ +@TestTargetClass(DOMImplementation.class) public final class CreateDocumentType extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -80,6 +86,15 @@ public final class CreateDocumentType extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocumentType", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateDocumentType1() throws Throwable { String publicId = "STAFF"; String systemId = "staff.xml"; @@ -100,7 +115,15 @@ public final class CreateDocumentType extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocumentType", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateDocumentType2() throws Throwable { String publicId = "http://www.localhost.com/"; String systemId = "myDoc.dtd"; @@ -154,7 +177,15 @@ public final class CreateDocumentType extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocumentType", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateDocumentType3() throws Throwable { String qualifiedName = "prefix:myDoc"; @@ -174,7 +205,15 @@ public final class CreateDocumentType extends DOMTestCase { nodeValue = newType.getNodeValue(); assertNull("nodeValue", nodeValue); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify null as parameters.", + targets = { + @TestTarget( + methodName = "createDocumentType", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateDocumentType4() throws Throwable { String publicId = "http://www.example.com/"; String systemId = "myDoc.dtd"; diff --git a/xml/src/test/java/org/w3c/dom/CreateElementNS.java b/xml/src/test/java/tests/org/w3c/dom/CreateElementNS.java index 19df0de..acb79c3 100644 --- a/xml/src/test/java/org/w3c/dom/CreateElementNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/CreateElementNS.java @@ -19,17 +19,22 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - -import org.w3c.dom.DOMException; import org.w3c.dom.Document; +import org.w3c.dom.DOMException; import org.w3c.dom.Element; +import javax.xml.parsers.DocumentBuilder; + /** * The "createElementNS(namespaceURI,qualifiedName)" method for a Document * should raise NAMESPACE_ERR DOMException if qualifiedName is malformed. @@ -48,6 +53,7 @@ import org.w3c.dom.Element; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a> */ +@TestTargetClass(Document.class) public final class CreateElementNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -77,6 +83,16 @@ public final class CreateElementNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify null as a parameters, and other types of " + + "DOMException.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS1() throws Throwable { String namespaceURI = "http://www.ecommerce.org/"; String malformedName = "prefix::local"; @@ -94,7 +110,16 @@ public final class CreateElementNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify null as a parameters, and other types of " + + "DOMException.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS2() throws Throwable { String namespaceURI = null; @@ -113,7 +138,16 @@ public final class CreateElementNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify null as a parameters, and other types of " + + "DOMException.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS3() throws Throwable { String namespaceURI = "http://www.wedding.com/"; String qualifiedName; @@ -163,7 +197,16 @@ public final class CreateElementNS extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify null as a parameters, and other types of " + + "DOMException.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS4() throws Throwable { String namespaceURI = "http://www.w3.org/XML/1998/namespaces"; String qualifiedName = "xml:element1"; @@ -181,7 +224,16 @@ public final class CreateElementNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify null as a parameters, and other types of " + + "DOMException.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS5() throws Throwable { String namespaceURI = "http://www.nist.gov"; String qualifiedName = "gov:faculty"; @@ -193,7 +245,16 @@ public final class CreateElementNS extends DOMTestCase { elementName = newElement.getTagName(); assertEquals("throw_Equals", qualifiedName, elementName); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify null as a parameters, and other types of " + + "DOMException.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS6() throws Throwable { String namespaceURI = "http://www.example.com/"; diff --git a/xml/src/test/java/org/w3c/dom/DOMDocumentBuilderFactory.java b/xml/src/test/java/tests/org/w3c/dom/DOMDocumentBuilderFactory.java index f1ce5c7..d28b2d7 100644 --- a/xml/src/test/java/org/w3c/dom/DOMDocumentBuilderFactory.java +++ b/xml/src/test/java/tests/org/w3c/dom/DOMDocumentBuilderFactory.java @@ -1,4 +1,4 @@ -package org.w3c.dom; +package tests.org.w3c.dom; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -24,7 +24,7 @@ public class DOMDocumentBuilderFactory { factory = DocumentBuilderFactory.newInstance(); if (factory == null) { - throw new RuntimeException("DocumentBuilderFactory must not be null"); + throw new RuntimeException("DocumentBuilderFactory must not be null"); } if (settings != null) { @@ -39,7 +39,7 @@ public class DOMDocumentBuilderFactory { } if (builder == null) { - throw new RuntimeException("DocumentBuilder must not be null"); + throw new RuntimeException("DocumentBuilder must not be null"); } } diff --git a/xml/src/test/java/org/w3c/dom/DOMImplementationCreateDocument.java b/xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java index f4be32c..fed32b8 100644 --- a/xml/src/test/java/org/w3c/dom/DOMImplementationCreateDocument.java +++ b/xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java @@ -1,14 +1,19 @@ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - -import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The createDocument method with valid arguments, should create a DOM Document @@ -23,6 +28,7 @@ import org.w3c.dom.DocumentType; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a> */ +@TestTargetClass(DOMImplementation.class) public final class DOMImplementationCreateDocument extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -52,6 +58,15 @@ public final class DOMImplementationCreateDocument extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument3() throws Throwable { Document doc; DOMImplementation domImpl; @@ -81,7 +96,15 @@ public final class DOMImplementationCreateDocument extends DOMTestCase { assertNotNull("domimplementationcreatedocument03", newDoc); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument4() throws Throwable { Document doc; DOMImplementation domImpl; @@ -104,7 +127,15 @@ public final class DOMImplementationCreateDocument extends DOMTestCase { assertTrue("domimplementationcreatedocument04", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument5() throws Throwable { Document doc; DOMImplementation domImpl; @@ -126,7 +157,15 @@ public final class DOMImplementationCreateDocument extends DOMTestCase { assertTrue("domimplementationcreatedocument05", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createDocument", + methodArgs = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class} + ) + }) public void testCreateDocument7() throws Throwable { Document doc; DOMImplementation domImpl; diff --git a/xml/src/test/java/org/w3c/dom/DOMImplementationCreateDocumentType.java b/xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java index dac3b7a..6957b5b 100644 --- a/xml/src/test/java/org/w3c/dom/DOMImplementationCreateDocumentType.java +++ b/xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java @@ -19,17 +19,22 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import javax.xml.parsers.DocumentBuilder; + /** * The method createDocumentType with valid values for qualifiedName, publicId * and systemId should create an empty DocumentType node. @@ -43,6 +48,7 @@ import org.w3c.dom.DocumentType; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a> */ +@TestTargetClass(DOMImplementation.class) public final class DOMImplementationCreateDocumentType extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -72,6 +78,15 @@ public final class DOMImplementationCreateDocumentType extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "createDocumentType", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateDocumentType1() throws Throwable { Document doc; DOMImplementation domImpl; @@ -106,7 +121,15 @@ public final class DOMImplementationCreateDocumentType extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "createDocumentType", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateDocumentType2() throws Throwable { Document doc; DOMImplementation domImpl; @@ -144,7 +167,15 @@ public final class DOMImplementationCreateDocumentType extends DOMTestCase { ownerDocument); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "createDocumentType", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateDocumentType4() throws Throwable { Document doc; DOMImplementation domImpl; diff --git a/xml/src/test/java/org/w3c/dom/DOMImplementationHasFeature.java b/xml/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java index 99b12fb..b5074ad 100644 --- a/xml/src/test/java/org/w3c/dom/DOMImplementationHasFeature.java +++ b/xml/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java @@ -1,13 +1,18 @@ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; +import javax.xml.parsers.DocumentBuilder; + /** * The "feature" parameter in the "hasFeature(feature,version)" method is the * package name of the feature. Legal values are XML and HTML and CORE. (Test @@ -23,6 +28,7 @@ import org.w3c.dom.Document; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a> */ +@TestTargetClass(DOMImplementation.class) public final class DOMImplementationHasFeature extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -52,6 +58,15 @@ public final class DOMImplementationHasFeature extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that hasFeature returns true value.", + targets = { + @TestTarget( + methodName = "hasFeature", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasFeatureCore() throws Throwable { Document doc; DOMImplementation domImpl; @@ -61,7 +76,15 @@ public final class DOMImplementationHasFeature extends DOMTestCase { state = domImpl.hasFeature("core", "2.0"); assertTrue("domimplementationFeaturecoreAssert", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that hasFeature returns true value.", + targets = { + @TestTarget( + methodName = "hasFeature", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasFeatureXml() throws Throwable { Document doc; DOMImplementation domImpl; @@ -71,7 +94,15 @@ public final class DOMImplementationHasFeature extends DOMTestCase { state = domImpl.hasFeature("xml", "2.0"); assertTrue("domimplementationFeaturexmlVersion2Assert", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that hasFeature method returns false.", + targets = { + @TestTarget( + methodName = "hasFeature", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasFeature1() throws Throwable { Document doc; DOMImplementation domImpl; @@ -107,7 +138,15 @@ public final class DOMImplementationHasFeature extends DOMTestCase { assertTrue("domimplementationhasfeature01_Core_3", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that hasFeature method returns false.", + targets = { + @TestTarget( + methodName = "hasFeature", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasFeature2() throws Throwable { Document doc; DOMImplementation domImpl; diff --git a/xml/src/test/java/org/w3c/dom/DOMTestCase.java b/xml/src/test/java/tests/org/w3c/dom/DOMTestCase.java index 2ca1d7b..041b67b 100644 --- a/xml/src/test/java/org/w3c/dom/DOMTestCase.java +++ b/xml/src/test/java/tests/org/w3c/dom/DOMTestCase.java @@ -1,4 +1,6 @@ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestTargetClass; import java.net.MalformedURLException; import java.net.URL; @@ -11,11 +13,11 @@ import org.xml.sax.SAXParseException; import junit.framework.TestCase; +@TestTargetClass(Document.class) public class DOMTestCase extends TestCase { public Document load(String docURI, DocumentBuilder builder) { Document doc = load(resolveURI(docURI), builder); - return doc; } diff --git a/xml/src/test/java/org/w3c/dom/DocumentBuilderSetting.java b/xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSetting.java index 9d229da..bbb7190 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentBuilderSetting.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSetting.java @@ -9,7 +9,7 @@ * http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; import javax.xml.parsers.DocumentBuilderFactory; diff --git a/xml/src/test/java/org/w3c/dom/DocumentBuilderSettingStrategy.java b/xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSettingStrategy.java index 9961ed7..77bbce8 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentBuilderSettingStrategy.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSettingStrategy.java @@ -1,4 +1,4 @@ -package org.w3c.dom; +package tests.org.w3c.dom; import java.lang.reflect.Method; diff --git a/xml/src/test/java/org/w3c/dom/DocumentCreateAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java index 490e718..5b818e6 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentCreateAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java @@ -19,18 +19,23 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - +import org.w3c.dom.Document; import org.w3c.dom.Attr; import org.w3c.dom.DOMException; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMImplementation; + +import javax.xml.parsers.DocumentBuilder; /** * The method createAttributeNS creates an attribute of the given qualified name @@ -47,6 +52,7 @@ import org.w3c.dom.DocumentType; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a> */ +@TestTargetClass(Document.class) public final class DocumentCreateAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -76,6 +82,15 @@ public final class DocumentCreateAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS1() throws Throwable { Document doc; Attr attribute; @@ -98,6 +113,15 @@ public final class DocumentCreateAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS2() throws Throwable { Document doc; Attr attribute1; @@ -138,7 +162,16 @@ public final class DocumentCreateAttributeNS extends DOMTestCase { assertEquals("documentcreateattributeNS02_att2_namespaceURI", "http://www.w3.org/2000/xmlns/", namespaceURI); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createAttributeNS throws DOMException with " + + "INVALID_CHARACTER_ERR code.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS3() throws Throwable { Document doc; @@ -170,7 +203,16 @@ public final class DocumentCreateAttributeNS extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createAttributeNS throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS4() throws Throwable { Document doc; @@ -198,7 +240,16 @@ public final class DocumentCreateAttributeNS extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createAttributeNS throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS5() throws Throwable { Document doc; Document newDoc; @@ -224,7 +275,16 @@ public final class DocumentCreateAttributeNS extends DOMTestCase { assertTrue("documentcreateattributeNS05", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createAttributeNS throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS6() throws Throwable { Document doc; Document newDoc; @@ -249,7 +309,16 @@ public final class DocumentCreateAttributeNS extends DOMTestCase { assertTrue("documentcreateattributeNS06", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createAttributeNS throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateAttributeNS7() throws Throwable { Document doc; diff --git a/xml/src/test/java/org/w3c/dom/DocumentCreateElementNS.java b/xml/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java index 9f3c96f..e53beb3 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentCreateElementNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java @@ -1,12 +1,17 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMException; -import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; import org.w3c.dom.Element; +import org.w3c.dom.DOMException; +import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMImplementation; + +import javax.xml.parsers.DocumentBuilder; /** * The method createElementNS creates an element of the given valid @@ -23,6 +28,7 @@ import org.w3c.dom.Element; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a> */ +@TestTargetClass(Document.class) public final class DocumentCreateElementNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -52,6 +58,15 @@ public final class DocumentCreateElementNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS1() throws Throwable { Document doc; Element element; @@ -76,7 +91,16 @@ public final class DocumentCreateElementNS extends DOMTestCase { assertEquals("documentcreateelementNS01_prefix", "XML", prefix); assertEquals("documentcreateelementNS01_tagName", "XML:XML", tagName); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createElementNS throws DOMException with " + + "INVALID_CHARACTER_ERR code.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS2() throws Throwable { Document doc; @@ -95,7 +119,16 @@ public final class DocumentCreateElementNS extends DOMTestCase { assertTrue("documentcreateelementNS02", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createElementNS throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS5() throws Throwable { Document doc; @@ -114,7 +147,16 @@ public final class DocumentCreateElementNS extends DOMTestCase { assertTrue("documentcreateelementNS05", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that createElementNS throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "createElementNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testCreateElementNS6() throws Throwable { Document doc; Document newDoc; diff --git a/xml/src/test/java/org/w3c/dom/DocumentGetElementsByTagnameNS.java b/xml/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java index e51b586..3a7dfa1 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentGetElementsByTagnameNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java @@ -1,12 +1,17 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; -import org.w3c.dom.Element; +import org.w3c.dom.DOMImplementation; import org.w3c.dom.NodeList; +import org.w3c.dom.Element; + +import javax.xml.parsers.DocumentBuilder; /** * The method getElementsByTagNameNS returns a NodeList of all the Elements with @@ -26,6 +31,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> */ +@TestTargetClass(Document.class) public final class DocumentGetElementsByTagnameNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -55,6 +61,15 @@ public final class DocumentGetElementsByTagnameNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies '*' as parameters.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS1() throws Throwable { Document doc; Document newDoc; @@ -71,7 +86,15 @@ public final class DocumentGetElementsByTagnameNS extends DOMTestCase { assertEquals("documentgetelementsbytagnameNS01", 1, childList .getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies '*' as the first parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS2() throws Throwable { Document doc; Element docElem; @@ -86,7 +109,15 @@ public final class DocumentGetElementsByTagnameNS extends DOMTestCase { assertEquals("documentgetelementsbytagnameNS02", 6, childList .getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies wrong namespaceURI as a parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS3() throws Throwable { Document doc; NodeList childList; @@ -95,7 +126,15 @@ public final class DocumentGetElementsByTagnameNS extends DOMTestCase { assertEquals("documentgetelementsbytagnameNS03", 0, childList .getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS4() throws Throwable { Document doc; NodeList childList; @@ -106,7 +145,15 @@ public final class DocumentGetElementsByTagnameNS extends DOMTestCase { assertEquals("documentgetelementsbytagnameNS04", 0, childList .getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS5() throws Throwable { Document doc; NodeList childList; diff --git a/xml/src/test/java/org/w3c/dom/DocumentGeteEementById.java b/xml/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java index e344dc6..972d2ba 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentGeteEementById.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java @@ -1,10 +1,15 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import org.w3c.dom.Document; import org.w3c.dom.Element; +import javax.xml.parsers.DocumentBuilder; + /** * The method getElementById returns the element whose ID is given by elementId. * If not such element exists, returns null. @@ -19,6 +24,7 @@ import org.w3c.dom.Element; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId</a> */ +@TestTargetClass(Document.class) public final class DocumentGeteEementById extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -48,6 +54,15 @@ public final class DocumentGeteEementById extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify getElementById method for existent element.", + targets = { + @TestTarget( + methodName = "getElementById", + methodArgs = {java.lang.String.class} + ) + }) public void testGetElementById() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/DocumentImportNode.java b/xml/src/test/java/tests/org/w3c/dom/DocumentImportNode.java index 9855b84..2af6d8e 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentImportNode.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentImportNode.java @@ -1,23 +1,23 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.CharacterData; -import org.w3c.dom.DOMException; -import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; -import org.w3c.dom.DocumentFragment; -import org.w3c.dom.DocumentType; import org.w3c.dom.Element; -import org.w3c.dom.Entity; -import org.w3c.dom.EntityReference; -import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; +import org.w3c.dom.Attr; import org.w3c.dom.NodeList; -import org.w3c.dom.Notation; +import org.w3c.dom.DOMException; +import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.DocumentFragment; import org.w3c.dom.ProcessingInstruction; +import javax.xml.parsers.DocumentBuilder; + /** * The importNode method imports a node from another document to this document. * The returned node has no parent; (parentNode is null). The source node is not @@ -37,6 +37,7 @@ import org.w3c.dom.ProcessingInstruction; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> */ +@TestTargetClass(Document.class) public final class DocumentImportNode extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -89,7 +90,15 @@ public final class DocumentImportNode extends DOMTestCase { // assertEquals("documentimportnode01_nodeType", 2, nodeType); // assertEquals("documentimportnode01_nodeValue", "Yes", nodeValue); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode2() throws Throwable { Document doc; Document docImported; @@ -172,7 +181,15 @@ public final class DocumentImportNode extends DOMTestCase { // assertEquals("documentimportnode04_nodeType", 2, nodeType); // assertEquals("documentimportnode04_nodeValue", "defaultVal", nodeValue); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode5() throws Throwable { Document doc; Document docImported; @@ -196,7 +213,16 @@ public final class DocumentImportNode extends DOMTestCase { assertEquals("documentimportnode05_namespaceURI", "http://www.w3.org/DOM/Test", namespaceURI); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that importNode method throws DOMException with " + + "NOT_SUPPORTED_ERR code.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode6() throws Throwable { Document doc; @@ -212,7 +238,16 @@ public final class DocumentImportNode extends DOMTestCase { assertTrue("throw_NOT_SUPPORTED_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that importNode method throws DOMException with " + + "NOT_SUPPORTED_ERR code.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode7() throws Throwable { Document doc; @@ -230,7 +265,16 @@ public final class DocumentImportNode extends DOMTestCase { assertTrue("throw_NOT_SUPPORTED_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that importNode method throws DOMException with " + + "NOT_SUPPORTED_ERR code.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode8() throws Throwable { Document doc; @@ -252,7 +296,15 @@ public final class DocumentImportNode extends DOMTestCase { assertTrue("throw_NOT_SUPPORTED_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode9() throws Throwable { Document doc; DocumentFragment docFragment; @@ -270,7 +322,16 @@ public final class DocumentImportNode extends DOMTestCase { success = importedDocFrag.hasChildNodes(); assertFalse("documentimportnode09", success); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality; " + + "doesn't verify DOMException exceptions.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode10() throws Throwable { Document doc; DocumentFragment docFragment; @@ -288,7 +349,15 @@ public final class DocumentImportNode extends DOMTestCase { success = importedDocFrag.hasChildNodes(); assertTrue("documentimportnode10", success); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode11() throws Throwable { Document doc; Element docElement; @@ -306,7 +375,15 @@ public final class DocumentImportNode extends DOMTestCase { assertEquals("documentimportnode11_NodeName", nodeNameImported, nodeNameOrig); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode12() throws Throwable { Document doc; NodeList childList; @@ -326,7 +403,15 @@ public final class DocumentImportNode extends DOMTestCase { importedLen = (int) importedChildren.getLength(); assertEquals("documentimportnode12", importedLen, addressElemLen); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode13() throws Throwable { Document doc; NodeList childList; @@ -370,7 +455,15 @@ public final class DocumentImportNode extends DOMTestCase { // "http://www.w3.org/2000/xmlns/", "emp"); // assertEquals("explicitAttrImported", "http://www.nist.gov", attrValue); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies import of TEXT_NODE.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode15() throws Throwable { Document doc; @@ -386,7 +479,15 @@ public final class DocumentImportNode extends DOMTestCase { assertEquals("documentimportnode15", "Document.importNode test for a TEXT_NODE", nodeValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies import of COMMENT_NODE", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode17() throws Throwable { Document doc; @@ -402,7 +503,15 @@ public final class DocumentImportNode extends DOMTestCase { assertEquals("documentimportnode17", "Document.importNode test for a COMMENT_NODE", nodeValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode18() throws Throwable { Document doc; diff --git a/xml/src/test/java/org/w3c/dom/DocumentTypeInternalSubset.java b/xml/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java index 48b5ccf..1c42b2f 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentTypeInternalSubset.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java @@ -1,10 +1,15 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.Document; +import org.w3c.dom.DOMImplementation; + +import javax.xml.parsers.DocumentBuilder; /** * The method getInternalSubset() returns the internal subset as a string. @@ -19,6 +24,7 @@ import org.w3c.dom.DocumentType; * @see <a * href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> */ +@TestTargetClass(DocumentType.class) public final class DocumentTypeInternalSubset extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -48,6 +54,15 @@ public final class DocumentTypeInternalSubset extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't check positive case.", + targets = { + @TestTarget( + methodName = "getInternalSubset", + methodArgs = {} + ) + }) public void testGetInternalSubset() throws Throwable { Document doc; DocumentType docType; diff --git a/xml/src/test/java/org/w3c/dom/DocumentTypePublicId.java b/xml/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java index de2ec1f..1ffb424 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentTypePublicId.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java @@ -20,13 +20,18 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMImplementation; + +import javax.xml.parsers.DocumentBuilder; @@ -40,6 +45,7 @@ import org.w3c.dom.DocumentType; * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId</a> * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> */ +@TestTargetClass(DocumentType.class) public final class DocumentTypePublicId extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -67,6 +73,15 @@ public final class DocumentTypePublicId extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getPublicId", + methodArgs = {} + ) + }) public void testGetPublicId() throws Throwable { Document doc; DocumentType docType; diff --git a/xml/src/test/java/org/w3c/dom/DocumentTypeSystemId.java b/xml/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java index 55d876c..10be288 100644 --- a/xml/src/test/java/org/w3c/dom/DocumentTypeSystemId.java +++ b/xml/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java @@ -20,13 +20,18 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.Document; +import org.w3c.dom.DOMImplementation; + +import javax.xml.parsers.DocumentBuilder; /** * The method getInternalSubset() returns the public identifier of the external subset. @@ -37,6 +42,7 @@ import org.w3c.dom.DocumentType; * @author Neil Delima * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a> */ +@TestTargetClass(DocumentType.class) public final class DocumentTypeSystemId extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -64,6 +70,15 @@ public final class DocumentTypeSystemId extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getSystemId", + methodArgs = {} + ) + }) public void testGetSystemId() throws Throwable { Document doc; DocumentType docType; diff --git a/xml/src/test/java/org/w3c/dom/ElementGetAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java index 7443b78..8505459 100644 --- a/xml/src/test/java/org/w3c/dom/ElementGetAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java @@ -20,7 +20,9 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestTargetClass; import javax.xml.parsers.DocumentBuilder; @@ -39,6 +41,7 @@ import org.w3c.dom.NodeList; * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a> * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> */ +@TestTargetClass(Element.class) public final class ElementGetAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; diff --git a/xml/src/test/java/org/w3c/dom/ElementGetAttributeNodeNS.java b/xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java index 08183d1..cb3b395 100644 --- a/xml/src/test/java/org/w3c/dom/ElementGetAttributeNodeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java @@ -1,11 +1,15 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.NodeList; +import org.w3c.dom.Document; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The method getAttributeNodeNS retrieves an Attr node by local name and @@ -19,6 +23,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a> */ +@TestTargetClass(Element.class) public final class ElementGetAttributeNodeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -48,6 +53,15 @@ public final class ElementGetAttributeNodeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNodeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNodeNS1() throws Throwable { Document doc; Element element; @@ -85,7 +99,15 @@ public final class ElementGetAttributeNodeNS extends DOMTestCase { assertEquals("elementgetattributenodens01_attrNs", "http://www.w3.org/DOM/Level2", attrNS); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNodeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNodeNS2() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/ElementGetElementsByTagNameNS.java b/xml/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java index dea677a..1bd9fb6 100644 --- a/xml/src/test/java/org/w3c/dom/ElementGetElementsByTagNameNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java @@ -1,11 +1,16 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import javax.xml.parsers.DocumentBuilder; + /** * The method getElementsByTagNameNS returns a NodeList of all the Elements with * a given local name and namespace URI in the order in which they are @@ -18,6 +23,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a> */ +@TestTargetClass(Element.class) public final class ElementGetElementsByTagNameNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -47,6 +53,15 @@ public final class ElementGetElementsByTagNameNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS1() throws Throwable { Document doc; Element element; @@ -57,7 +72,15 @@ public final class ElementGetElementsByTagNameNS extends DOMTestCase { assertEquals("elementgetelementsbytagnamens02", 0, elementList .getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS4() throws Throwable { Document doc; Element element; @@ -85,7 +108,15 @@ public final class ElementGetElementsByTagNameNS extends DOMTestCase { assertEquals("elementgetelementsbytagnamens04_2", 3, elementList .getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS5() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/ElementHasAttribute.java b/xml/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java index 1c897f4..0be1a9a 100644 --- a/xml/src/test/java/org/w3c/dom/ElementHasAttribute.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java @@ -1,11 +1,15 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.NodeList; +import org.w3c.dom.Document; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The method hasAttribute returns true when an attribute with a given name is @@ -17,6 +21,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a> */ +@TestTargetClass(Element.class) public final class ElementHasAttribute extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -46,6 +51,16 @@ public final class ElementHasAttribute extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies hasAttribute method with empty string " + + "as a parameter.", + targets = { + @TestTarget( + methodName = "hasAttribute", + methodArgs = {java.lang.String.class} + ) + }) public void testHasAttribute1() throws Throwable { Document doc; Element element; @@ -69,7 +84,15 @@ public final class ElementHasAttribute extends DOMTestCase { // state = element.hasAttribute("defaultAttr"); // assertTrue("elementhasattribute02", state); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "hasAttribute", + methodArgs = {java.lang.String.class} + ) + }) public void testHasAttribute3() throws Throwable { Document doc; Element element; @@ -85,7 +108,15 @@ public final class ElementHasAttribute extends DOMTestCase { state = element.hasAttribute("domestic"); assertTrue("elementhasattribute03_True", state); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "hasAttribute", + methodArgs = {java.lang.String.class} + ) + }) public void testHasAttribute4() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/ElementHasAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java index cf471e5..15d7cff 100644 --- a/xml/src/test/java/org/w3c/dom/ElementHasAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java @@ -19,14 +19,19 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The method hasAttributeNS returns true when an attribute with a given local @@ -42,6 +47,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a> */ +@TestTargetClass(Element.class) public final class ElementHasAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -71,7 +77,16 @@ public final class ElementHasAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ - public void testHasAttributeNS1() throws Throwable { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "hasAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) + public void _testHasAttributeNS1() throws Throwable { Document doc; Element element; boolean state; @@ -83,7 +98,15 @@ public final class ElementHasAttributeNS extends DOMTestCase { .hasAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns"); assertTrue("elementhasattributens01", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "hasAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasAttributeNS2() throws Throwable { Document doc; Element element; @@ -97,7 +120,15 @@ public final class ElementHasAttributeNS extends DOMTestCase { state = element.hasAttributeNS("http://www.w3.org/DOM", "domestic"); assertTrue("hasDomesticAttr", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "hasAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasAttributeNS3() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/ElementRemoveAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java index 4528a72..5c25b2a 100644 --- a/xml/src/test/java/org/w3c/dom/ElementRemoveAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java @@ -1,10 +1,15 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; +import org.w3c.dom.Element; import org.w3c.dom.Attr; import org.w3c.dom.Document; -import org.w3c.dom.Element; + +import javax.xml.parsers.DocumentBuilder; /** * The method removeAttributeNS removes an attribute by local name and namespace @@ -18,6 +23,7 @@ import org.w3c.dom.Element; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS</a> */ +@TestTargetClass(Element.class) public final class ElementRemoveAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -47,6 +53,15 @@ public final class ElementRemoveAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "removeAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveAttributeNS() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/ElementSetAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java index b77504e..ea11d9d 100644 --- a/xml/src/test/java/org/w3c/dom/ElementSetAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java @@ -1,16 +1,21 @@ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - +import org.w3c.dom.Element; import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.DOMException; +import org.w3c.dom.Node; + +import javax.xml.parsers.DocumentBuilder; /** * The method setAttributeNS adds a new attribute. Create a new element and add @@ -23,6 +28,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a> */ +@TestTargetClass(Element.class) public final class ElementSetAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -52,6 +58,15 @@ public final class ElementSetAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS1() throws Throwable { Document doc; Element element; @@ -69,7 +84,15 @@ public final class ElementSetAttributeNS extends DOMTestCase { assertEquals("elementsetattributens01_attrName", "attr", attrName); assertEquals("elementsetattributens01_attrValue", "value", attrValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS2() throws Throwable { Document doc; Element element; @@ -91,7 +114,15 @@ public final class ElementSetAttributeNS extends DOMTestCase { assertEquals("elementsetattributens02_attrValue", "Silver Street", attrValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS3() throws Throwable { Document doc; Element element; @@ -115,7 +146,15 @@ public final class ElementSetAttributeNS extends DOMTestCase { attrName); assertEquals("elementsetattributens03_attrValue", "default1", attrValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with INVALID_CHARACTER_ERR.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS4() throws Throwable { Document doc; Element element; @@ -149,7 +188,15 @@ public final class ElementSetAttributeNS extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS5() throws Throwable { Document doc; Element element; @@ -169,7 +216,15 @@ public final class ElementSetAttributeNS extends DOMTestCase { assertTrue("elementsetattributens05", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS8() throws Throwable { Document doc; Element element; @@ -199,6 +254,15 @@ public final class ElementSetAttributeNS extends DOMTestCase { assertTrue("elementsetattributens08_Err2", success); } } + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNSURINull() throws Throwable { String namespaceURI = null; diff --git a/xml/src/test/java/org/w3c/dom/ElementSetAttributeNodeNS.java b/xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java index 9b7e182..0a253da 100644 --- a/xml/src/test/java/org/w3c/dom/ElementSetAttributeNodeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java @@ -19,17 +19,22 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.EntityReference; +import org.w3c.dom.Document; +import org.w3c.dom.Attr; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.NodeList; +import org.w3c.dom.DOMException; +import org.w3c.dom.EntityReference; + +import javax.xml.parsers.DocumentBuilder; /** * Testing Element.setAttributeNodeNS: If an attribute with that local name and @@ -44,6 +49,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a> */ +@TestTargetClass(Element.class) public final class ElementSetAttributeNodeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -73,6 +79,15 @@ public final class ElementSetAttributeNodeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNodeNS1() throws Throwable { Document doc; Element element; @@ -106,7 +121,15 @@ public final class ElementSetAttributeNodeNS extends DOMTestCase { length = (int) attributes.getLength(); assertEquals("length", 1, length); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNodeNS2() throws Throwable { Document doc; Element element; @@ -132,7 +155,15 @@ public final class ElementSetAttributeNodeNS extends DOMTestCase { assertEquals("elementsetattributenodens02_attrName", "street", attrName); assertEquals("elementsetattributenodens02_attrValue", "Yes", attrValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNodeNS3() throws Throwable { Document doc; Element element1; @@ -159,7 +190,15 @@ public final class ElementSetAttributeNodeNS extends DOMTestCase { assertTrue("elementsetattributenodens03", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNodeNS4() throws Throwable { Document doc; Element element1; @@ -182,7 +221,15 @@ public final class ElementSetAttributeNodeNS extends DOMTestCase { assertTrue("elementsetattributenodens04", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with WRONG_DOCUMENT_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNodeNS5() throws Throwable { Document doc; Document docAlt; @@ -205,8 +252,16 @@ public final class ElementSetAttributeNodeNS extends DOMTestCase { assertTrue("throw_WRONG_DOCUMENT_ERR", success); } } - - public void testSetAttributeNodeNS6() throws Throwable { + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NO_MODIFICATION_ALLOWED_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) + public void _testSetAttributeNodeNS6() throws Throwable { Document doc; Element element; Attr attribute; diff --git a/xml/src/test/java/org/w3c/dom/GetAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/GetAttributeNS.java index 549743b..6a3ee11 100644 --- a/xml/src/test/java/org/w3c/dom/GetAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/GetAttributeNS.java @@ -19,15 +19,20 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; +import org.w3c.dom.Element; import org.w3c.dom.Attr; import org.w3c.dom.Document; -import org.w3c.dom.Element; import org.w3c.dom.NodeList; +import javax.xml.parsers.DocumentBuilder; + /** * The "getAttributeNS(namespaceURI,localName)" method retrieves an attribute * value by local name and NamespaceURI. @@ -43,6 +48,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a> */ +@TestTargetClass(Element.class) public final class GetAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -87,7 +93,15 @@ public final class GetAttributeNS extends DOMTestCase { // attrValue = testAddr.getAttributeNS(namespaceURI, localName); // assertEquals("attrValue", "DISTRICT", attrValue); // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNS2() throws Throwable { String namespaceURI = "http://www.nist.gov"; String localName = "district"; @@ -109,7 +123,15 @@ public final class GetAttributeNS extends DOMTestCase { attrValue = testAddr.getAttributeNS(namespaceURI, localName); assertEquals("throw_Equals", "", attrValue); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNS3() throws Throwable { String namespaceURI = "http://www.nist.gov"; String localName = "domestic"; @@ -125,7 +147,15 @@ public final class GetAttributeNS extends DOMTestCase { attrValue = testAddr.getAttributeNS(namespaceURI, localName); assertEquals("throw_Equals", "", attrValue); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNS4() throws Throwable { String namespaceURI = "http://www.nist.gov"; String localName = "blank"; @@ -145,7 +175,15 @@ public final class GetAttributeNS extends DOMTestCase { attrValue = testAddr.getAttributeNS(namespaceURI, localName); assertEquals("throw_Equals", "NewValue", attrValue); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNS5() throws Throwable { Document doc; NodeList elementList; diff --git a/xml/src/test/java/org/w3c/dom/GetAttributeNodeNS.java b/xml/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java index 0cecfae..7b2488a 100644 --- a/xml/src/test/java/org/w3c/dom/GetAttributeNodeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java @@ -19,14 +19,19 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The "getAttributeNodeNS(namespaceURI,localName)" method retrieves an @@ -42,6 +47,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a> */ +@TestTargetClass(Element.class) public final class GetAttributeNodeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -71,6 +77,15 @@ public final class GetAttributeNodeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNodeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNodeNS1() throws Throwable { String namespaceURI = "http://www.nist.gov"; String localName = "invalidlocalname"; @@ -85,7 +100,15 @@ public final class GetAttributeNodeNS extends DOMTestCase { attribute = testAddr.getAttributeNodeNS(namespaceURI, localName); assertNull("throw_Null", attribute); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getAttributeNodeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetAttributeNodeNS2() throws Throwable { Document doc; NodeList elementList; diff --git a/xml/src/test/java/org/w3c/dom/GetElementById.java b/xml/src/test/java/tests/org/w3c/dom/GetElementById.java index 127d471..9f35447 100644 --- a/xml/src/test/java/org/w3c/dom/GetElementById.java +++ b/xml/src/test/java/tests/org/w3c/dom/GetElementById.java @@ -19,13 +19,18 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import org.w3c.dom.Document; import org.w3c.dom.Element; +import javax.xml.parsers.DocumentBuilder; + /** * The "getElementById(elementId)" method for a Document should return an * element whose ID matches elementId. @@ -41,6 +46,7 @@ import org.w3c.dom.Element; * @see <a * href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=383">http://www.w3.org/Bugs/Public/show_bug.cgi?id=383</a> */ +@TestTargetClass(Document.class) public final class GetElementById extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -80,7 +86,15 @@ public final class GetElementById extends DOMTestCase { // tagname = element.getTagName(); // assertEquals("throw_Equals", "emp:address", tagname); // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify getElementById method for existent element.", + targets = { + @TestTarget( + methodName = "getElementById", + methodArgs = {java.lang.String.class} + ) + }) public void testGetElementById2() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/GetElementsByTagNameNS.java b/xml/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java index a8ac85e..7c83175 100644 --- a/xml/src/test/java/org/w3c/dom/GetElementsByTagNameNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java @@ -19,17 +19,22 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - import org.w3c.dom.Document; +import org.w3c.dom.NodeList; import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; + +import javax.xml.parsers.DocumentBuilder; /** * The "getElementsByTagNameNS(namespaceURI,localName)" method for a Document @@ -45,6 +50,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a> */ +@TestTargetClass(Document.class) public final class GetElementsByTagNameNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -66,7 +72,15 @@ public final class GetElementsByTagNameNS extends DOMTestCase { builder = null; super.tearDown(); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS method with * as parameters.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS1() throws Throwable { String namespaceURI = "*"; String localName = "*"; @@ -78,7 +92,16 @@ public final class GetElementsByTagNameNS extends DOMTestCase { assertEquals("throw_Size", 36, newList.getLength()); // END android-changed } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS with '*' " + + "as the first parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS2() throws Throwable { Document doc; NodeList newList; @@ -94,7 +117,16 @@ public final class GetElementsByTagNameNS extends DOMTestCase { lname = newElement.getLocalName(); assertEquals("lname", "employee", lname); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS with '*' " + + "as the second parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS3() throws Throwable { Document doc; NodeList elementList; @@ -127,7 +159,16 @@ public final class GetElementsByTagNameNS extends DOMTestCase { } assertEquals("nodeNames", expectedResult, result); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS with '*' " + + "as the first parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS4() throws Throwable { Document doc; NodeList elementList; @@ -151,7 +192,15 @@ public final class GetElementsByTagNameNS extends DOMTestCase { } assertEquals("nodeNames", expectedResult, result); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies negative case of getElementsByTagNameNS method.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS5() throws Throwable { String namespaceURI = "http://www.nist.gov"; String localName = "nomatch"; @@ -161,7 +210,15 @@ public final class GetElementsByTagNameNS extends DOMTestCase { elementList = doc.getElementsByTagNameNS(namespaceURI, localName); assertEquals("throw_Size", 0, elementList.getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies negative case of getElementsByTagNameNS method.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS6() throws Throwable { Document doc; NodeList elementList; @@ -170,7 +227,15 @@ public final class GetElementsByTagNameNS extends DOMTestCase { "address"); assertEquals("matchSize", 0, elementList.getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive case of getElementsByTagNameNS method.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS7() throws Throwable { Document doc; NodeList elementList; @@ -179,7 +244,16 @@ public final class GetElementsByTagNameNS extends DOMTestCase { "address"); assertEquals("addresses", 3, elementList.getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS method with '*' " + + "as parameters; positive case.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS8() throws Throwable { Document doc; Element docElem; @@ -189,7 +263,16 @@ public final class GetElementsByTagNameNS extends DOMTestCase { newList = docElem.getElementsByTagNameNS("*", "*"); assertEquals("listSize", 36, newList.getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS method with '*' " + + "as the first parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS9() throws Throwable { Document doc; NodeList newList; @@ -207,7 +290,16 @@ public final class GetElementsByTagNameNS extends DOMTestCase { lname = newElement.getLocalName(); assertEquals("lname", "employee", lname); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS method with '*' as the second " + + "parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS10() throws Throwable { Document doc; Element docElem; @@ -243,7 +335,16 @@ public final class GetElementsByTagNameNS extends DOMTestCase { } assertEquals("nodeNames", expectedResult, result); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies getElementsByTagNameNS method with '*' as the first " + + "parameter.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS11() throws Throwable { Document doc; Element docElem; @@ -269,7 +370,15 @@ public final class GetElementsByTagNameNS extends DOMTestCase { } assertEquals("nodeNames", expectedResult, result); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies negative case for getElementsByTagNameNS method.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS12() throws Throwable { Document doc; Element docElem; @@ -280,7 +389,15 @@ public final class GetElementsByTagNameNS extends DOMTestCase { "nomatch"); assertEquals("size", 0, elementList.getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies negative case for getElementsByTagNameNS method.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS13() throws Throwable { Document doc; Element docElem; @@ -291,7 +408,15 @@ public final class GetElementsByTagNameNS extends DOMTestCase { "address"); assertEquals("matchSize", 0, elementList.getLength()); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive case for getElementsByTagNameNS method.", + targets = { + @TestTarget( + methodName = "getElementsByTagNameNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetElementsByTagNameNS14() throws Throwable { Document doc; Element docElem; diff --git a/xml/src/test/java/org/w3c/dom/GetNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java index d442a17..a06a5e0 100644 --- a/xml/src/test/java/org/w3c/dom/GetNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java @@ -1,15 +1,17 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; -import org.w3c.dom.Entity; import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Document; +import org.w3c.dom.Attr; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.w3c.dom.Notation; + +import javax.xml.parsers.DocumentBuilder; /** * The "getNamedItemNS(namespaceURI,localName)" method for a NamedNodeMap should @@ -25,6 +27,7 @@ import org.w3c.dom.Notation; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a> */ +@TestTargetClass(NamedNodeMap.class) public final class GetNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -54,6 +57,15 @@ public final class GetNamedItemNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getNamedItem", + methodArgs = {java.lang.String.class} + ) + }) public void testGetNamedItemNS1() throws Throwable { Document doc; NodeList elementList; @@ -70,7 +82,15 @@ public final class GetNamedItemNS extends DOMTestCase { attrName = domesticAttr.getNodeName(); assertEquals("attrName", "dmstc:domestic", attrName); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getNamedItemNS", + methodArgs = {String.class, String.class} + ) + }) public void testGetNamedItemNS2() throws Throwable { String namespaceURI = "http://www.usa.com"; String localName = "domest"; diff --git a/xml/src/test/java/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java index 5fae388..1cdd20f 100644 --- a/xml/src/test/java/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java @@ -16,7 +16,9 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestTargetClass; import javax.xml.parsers.DocumentBuilder; @@ -35,6 +37,7 @@ import org.w3c.dom.NamedNodeMap; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a> */ +@TestTargetClass(NamedNodeMap.class) public final class HCEntitiesRemoveNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; diff --git a/xml/src/test/java/org/w3c/dom/HCEntitiesSetNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java index a9bcae8..7e2917a 100644 --- a/xml/src/test/java/org/w3c/dom/HCEntitiesSetNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java @@ -1,4 +1,6 @@ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestTargetClass; import javax.xml.parsers.DocumentBuilder; @@ -18,6 +20,7 @@ import org.w3c.dom.NamedNodeMap; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> */ +@TestTargetClass(NamedNodeMap.class) public final class HCEntitiesSetNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; diff --git a/xml/src/test/java/org/w3c/dom/HCNamedNodeMapInvalidType.java b/xml/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java index ecfb61b..675140c 100644 --- a/xml/src/test/java/org/w3c/dom/HCNamedNodeMapInvalidType.java +++ b/xml/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java @@ -16,14 +16,19 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMException; +import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * Attempt to insert an element into an attribute list, should raise a @@ -37,6 +42,7 @@ import org.w3c.dom.NamedNodeMap; * @see <a * href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-4">http://www.w3.org/2000/11/DOM-Level-2-errata#core-4</a> */ +@TestTargetClass(NamedNodeMap.class) public final class HCNamedNodeMapInvalidType extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -66,6 +72,16 @@ public final class HCNamedNodeMapInvalidType extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that setNamedItem method throws DOMException with " + + "HIERARCHY_REQUEST_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItem", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testNamedNodeMapInvalidType() throws Throwable { Document doc; NamedNodeMap attributes; diff --git a/xml/src/test/java/org/w3c/dom/HCNodeDocumentFragmentNormalize.java b/xml/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java index e7da0bc..89be8c6 100644 --- a/xml/src/test/java/org/w3c/dom/HCNodeDocumentFragmentNormalize.java +++ b/xml/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java @@ -1,12 +1,17 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; +import org.w3c.dom.Node; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; -import org.w3c.dom.Node; import org.w3c.dom.Text; +import javax.xml.parsers.DocumentBuilder; + /** * Create a document fragment with two adjacent text nodes, normalize and see if * the text nodes were combined. @@ -17,6 +22,7 @@ import org.w3c.dom.Text; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3</a> */ +@TestTargetClass(Node.class) public final class HCNodeDocumentFragmentNormalize extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -46,6 +52,21 @@ public final class HCNodeDocumentFragmentNormalize extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies positive functionality of getNodeValue method, " + + "and that getNextSibling method returns null.", + targets = { + @TestTarget( + methodName = "getNodeValue", + methodArgs = {} + ), + @TestTarget( + methodName = "getNextSibling", + methodArgs = {} + ) + + }) public void testNodeDocumentFragmentNormalize1() throws Throwable { Document doc; DocumentFragment docFragment; @@ -66,7 +87,15 @@ public final class HCNodeDocumentFragmentNormalize extends DOMTestCase { retval = txtNode.getNextSibling(); assertNull("singleChild", retval); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getFirstChild method returns null.", + targets = { + @TestTarget( + methodName = "getFirstChild", + methodArgs = {} + ) + }) public void testNodeDocumentFragmentNormalize2() throws Throwable { Document doc; DocumentFragment docFragment; diff --git a/xml/src/test/java/org/w3c/dom/HCNotationsRemoveNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java index 3673c73..43c1bdc 100644 --- a/xml/src/test/java/org/w3c/dom/HCNotationsRemoveNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java @@ -16,14 +16,19 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMException; +import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; -import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * An attempt to add remove an notation using removeNamedItemNS should result in @@ -35,6 +40,7 @@ import org.w3c.dom.NamedNodeMap; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a> */ +@TestTargetClass(NamedNodeMap.class) public final class HCNotationsRemoveNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -64,6 +70,15 @@ public final class HCNotationsRemoveNamedItemNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that removeNamedItemNS method throws DOMException.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS() throws Throwable { Document doc; NamedNodeMap notations; diff --git a/xml/src/test/java/org/w3c/dom/HCNotationsSetNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java index c928b7f..6c72d9d 100644 --- a/xml/src/test/java/org/w3c/dom/HCNotationsSetNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java @@ -16,15 +16,20 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMException; +import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * An attempt to add an element to the named node map returned by notations @@ -36,6 +41,7 @@ import org.w3c.dom.NamedNodeMap; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> */ +@TestTargetClass(NamedNodeMap.class) public final class HCNotationsSetNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -65,6 +71,15 @@ public final class HCNotationsSetNamedItemNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that setNamedItemNS throws DOMException.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testNotationsSetNamedItemNS() throws Throwable { Document doc; NamedNodeMap notations; diff --git a/xml/src/test/java/org/w3c/dom/HasAttribute.java b/xml/src/test/java/tests/org/w3c/dom/HasAttribute.java index abdfaec..1f51c70 100644 --- a/xml/src/test/java/org/w3c/dom/HasAttribute.java +++ b/xml/src/test/java/tests/org/w3c/dom/HasAttribute.java @@ -1,11 +1,16 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import javax.xml.parsers.DocumentBuilder; + /** * The "hasAttribute()" method for an Element should return true if the element * has an attribute with the given name. Retrieve the first "address" element @@ -17,6 +22,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr</a> */ +@TestTargetClass(Element.class) public final class HasAttribute extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -46,6 +52,15 @@ public final class HasAttribute extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that hasAttribute method returns false.", + targets = { + @TestTarget( + methodName = "hasAttribute", + methodArgs = {java.lang.String.class} + ) + }) public void testHasAttribute1() throws Throwable { Document doc; NodeList elementList; @@ -70,7 +85,15 @@ public final class HasAttribute extends DOMTestCase { // state = testNode.hasAttribute("street"); // assertTrue("throw_True", state); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that hasAttribute method returns false.", + targets = { + @TestTarget( + methodName = "hasAttribute", + methodArgs = {java.lang.String.class} + ) + }) public void testHasAttribute3() throws Throwable { Document doc; NodeList elementList; @@ -82,7 +105,15 @@ public final class HasAttribute extends DOMTestCase { state = testNode.hasAttribute("nomatch"); assertFalse("throw_False", state); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that hasAttribute method returns true.", + targets = { + @TestTarget( + methodName = "hasAttribute", + methodArgs = {java.lang.String.class} + ) + }) public void testHasAttribute4() throws Throwable { Document doc; NodeList elementList; diff --git a/xml/src/test/java/org/w3c/dom/HasAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/HasAttributeNS.java index efa2148..614818b 100644 --- a/xml/src/test/java/org/w3c/dom/HasAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/HasAttributeNS.java @@ -19,14 +19,19 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import javax.xml.parsers.DocumentBuilder; + /** * * The "hasAttributeNS()" method for an Element should return false if the @@ -41,6 +46,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a> */ +@TestTargetClass(Element.class) public final class HasAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -70,6 +76,15 @@ public final class HasAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "hasAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasAttributeNS1() throws Throwable { String localName = "nomatch"; String namespaceURI = "http://www.usa.com"; @@ -83,7 +98,15 @@ public final class HasAttributeNS extends DOMTestCase { state = testNode.hasAttributeNS(namespaceURI, localName); assertFalse("throw_False", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "hasAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasAttributeNS2() throws Throwable { String localName = "domestic"; String namespaceURI = "http://www.nomatch.com"; @@ -97,7 +120,15 @@ public final class HasAttributeNS extends DOMTestCase { state = testNode.hasAttributeNS(namespaceURI, localName); assertFalse("throw_False", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "hasAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasAttributeNS3() throws Throwable { String localName = "blank"; String namespaceURI = "http://www.nist.gov"; @@ -128,7 +159,15 @@ public final class HasAttributeNS extends DOMTestCase { // state = testNode.hasAttributeNS(namespaceURI, localName); // assertTrue("hasAttribute", state); // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "hasAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testHasAttributeNS5() throws Throwable { String localName = "domestic"; String namespaceURI = "http://www.usa.com"; diff --git a/xml/src/test/java/org/w3c/dom/HasAttributes.java b/xml/src/test/java/tests/org/w3c/dom/HasAttributes.java index c77879e..af0fa03 100644 --- a/xml/src/test/java/org/w3c/dom/HasAttributes.java +++ b/xml/src/test/java/tests/org/w3c/dom/HasAttributes.java @@ -19,14 +19,19 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Document; import org.w3c.dom.Node; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import javax.xml.parsers.DocumentBuilder; + /** * The "hasAttributes()" method for a node should return false if the node does * not have an attribute. Retrieve the first "name" node and invoke the @@ -38,6 +43,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a> */ +@TestTargetClass(Node.class) public final class HasAttributes extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -67,6 +73,15 @@ public final class HasAttributes extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that hasAttributes method returns false value.", + targets = { + @TestTarget( + methodName = "hasAttributes", + methodArgs = {} + ) + }) public void testHasAttributes1() throws Throwable { Document doc; NodeList addrList; @@ -78,7 +93,15 @@ public final class HasAttributes extends DOMTestCase { state = addrNode.hasAttributes(); assertFalse("throw_False", state); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that hasAttributes method returns true value.", + targets = { + @TestTarget( + methodName = "hasAttributes", + methodArgs = {} + ) + }) public void testHasAttributes2() throws Throwable { Document doc; NodeList addrList; diff --git a/xml/src/test/java/org/w3c/dom/ImportNode.java b/xml/src/test/java/tests/org/w3c/dom/ImportNode.java index 19130ad..45ce6d6 100644 --- a/xml/src/test/java/org/w3c/dom/ImportNode.java +++ b/xml/src/test/java/tests/org/w3c/dom/ImportNode.java @@ -19,29 +19,31 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - +import org.w3c.dom.Document; import org.w3c.dom.Attr; +import org.w3c.dom.Text; +import org.w3c.dom.Node; +import org.w3c.dom.Element; +import org.w3c.dom.DocumentType; +import org.w3c.dom.NodeList; import org.w3c.dom.CDATASection; import org.w3c.dom.Comment; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; -import org.w3c.dom.DocumentType; -import org.w3c.dom.Element; -import org.w3c.dom.Entity; import org.w3c.dom.EntityReference; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Notation; import org.w3c.dom.ProcessingInstruction; -import org.w3c.dom.Text; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The "importNode(importedNode,deep)" method for a Document should import the @@ -62,6 +64,7 @@ import org.w3c.dom.Text; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a> */ +@TestTargetClass(Document.class) public final class ImportNode extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -91,7 +94,16 @@ public final class ImportNode extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ - public void testImportNode1() throws Throwable { + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) + public void _testImportNode1() throws Throwable { Document doc; Document aNewDoc; Attr newAttr; @@ -134,7 +146,15 @@ public final class ImportNode extends DOMTestCase { childValue = child.getNodeValue(); assertEquals("childValue", "importedText", childValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode2() throws Throwable { Document doc; Document aNewDoc; @@ -157,7 +177,15 @@ public final class ImportNode extends DOMTestCase { value = aNode.getNodeValue(); assertEquals("nodeValue", "this is CDATASection data", value); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode3() throws Throwable { Document doc; Document aNewDoc; @@ -180,7 +208,15 @@ public final class ImportNode extends DOMTestCase { value = aNode.getNodeValue(); assertEquals("nodeValue", "this is a comment", value); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode4() throws Throwable { Document doc; Document aNewDoc; @@ -202,7 +238,15 @@ public final class ImportNode extends DOMTestCase { childValue = child.getNodeValue(); assertEquals("descendant1", "descendant1", childValue); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode5() throws Throwable { Document doc; Document aNewDoc; @@ -230,7 +274,15 @@ public final class ImportNode extends DOMTestCase { name = aNode.getNodeName(); assertEquals("nodeName", "emp:address", name); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode6() throws Throwable { Document doc; Document aNewDoc; @@ -280,7 +332,15 @@ public final class ImportNode extends DOMTestCase { // lname = attr.getLocalName(); // assertEquals("lname", "defaultAttr", lname); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode8() throws Throwable { Document doc; Document aNewDoc; @@ -339,7 +399,15 @@ public final class ImportNode extends DOMTestCase { // notationName = entity1.getNotationName(); // assertEquals("notationName", "notation2", notationName); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode10() throws Throwable { Document doc; Document aNewDoc; @@ -449,7 +517,15 @@ public final class ImportNode extends DOMTestCase { // system = aNode.getSystemId(); // assertNull("notationSystemId", system); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode14() throws Throwable { Document doc; Document aNewDoc; @@ -476,7 +552,15 @@ public final class ImportNode extends DOMTestCase { data = aNode.getData(); assertEquals("piData", "data1", data); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode15() throws Throwable { Document doc; Document aNewDoc; @@ -499,7 +583,16 @@ public final class ImportNode extends DOMTestCase { value = aNode.getNodeValue(); assertEquals("nodeValue", "this is text data", value); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that importNode method throws DOMException " + + "with NOT_SUPPORTED_ERR code.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode16() throws Throwable { Document doc; Document anotherDoc; @@ -519,7 +612,16 @@ public final class ImportNode extends DOMTestCase { assertTrue("throw_NOT_SUPPORTED_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that importNode method throws DOMException " + + "with NOT_SUPPORTED_ERR code.", + targets = { + @TestTarget( + methodName = "importNode", + methodArgs = {org.w3c.dom.Node.class, boolean.class} + ) + }) public void testImportNode17() throws Throwable { Document doc; Document anotherDoc; diff --git a/xml/src/test/java/org/w3c/dom/InternalSubset.java b/xml/src/test/java/tests/org/w3c/dom/InternalSubset.java index 61a652c..d15cb37 100644 --- a/xml/src/test/java/org/w3c/dom/InternalSubset.java +++ b/xml/src/test/java/tests/org/w3c/dom/InternalSubset.java @@ -20,12 +20,17 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.Document; + +import javax.xml.parsers.DocumentBuilder; /** * The "getInternalSubset()" method returns @@ -39,6 +44,7 @@ import org.w3c.dom.DocumentType; * @author Mary Brady * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset</a> */ +@TestTargetClass(DocumentType.class) public final class InternalSubset extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -66,6 +72,16 @@ public final class InternalSubset extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that getInternalSubset method returns " + + "the internal subset as a string.", + targets = { + @TestTarget( + methodName = "getInternalSubset", + methodArgs = {} + ) + }) public void testGetInternalSubset() throws Throwable { Document doc; DocumentType docType; diff --git a/xml/src/test/java/org/w3c/dom/IsSupported.java b/xml/src/test/java/tests/org/w3c/dom/IsSupported.java index add6f29..a8fba52 100644 --- a/xml/src/test/java/org/w3c/dom/IsSupported.java +++ b/xml/src/test/java/tests/org/w3c/dom/IsSupported.java @@ -1,13 +1,18 @@ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - import org.w3c.dom.Document; import org.w3c.dom.Node; +import javax.xml.parsers.DocumentBuilder; + /** * 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 @@ -25,6 +30,7 @@ import org.w3c.dom.Node; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a> */ +@TestTargetClass(Document.class) public final class IsSupported extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -54,6 +60,15 @@ public final class IsSupported extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns false.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported1() throws Throwable { Document doc; Node rootNode; @@ -63,7 +78,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("XXX", "1.0"); assertFalse("throw_False", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns false value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported2() throws Throwable { Document doc; Node rootNode; @@ -73,7 +96,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("XML", "9.0"); assertFalse("throw_False", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns true value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported4() throws Throwable { Document doc; Node rootNode; @@ -83,7 +114,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("xml", "1.0"); assertTrue("throw_True", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns true value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported5() throws Throwable { Document doc; Node rootNode; @@ -93,7 +132,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("core", "2.0"); assertTrue("throw_True", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns true value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported6() throws Throwable { Document doc; Node rootNode; @@ -103,7 +150,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("xml", "2.0"); assertTrue("throw_True", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns true value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported7() throws Throwable { Document doc; Node rootNode; @@ -113,7 +168,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("XML", ""); assertTrue("throw_True", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns true value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported9() throws Throwable { Document doc; Node rootNode; @@ -123,7 +186,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("XML", "1.0"); assertTrue("throw_True", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns true.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported10() throws Throwable { Document doc; Node rootNode; @@ -133,7 +204,15 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("CORE", "2.0"); assertTrue("throw_True", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns true.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported11() throws Throwable { Document doc; Node rootNode; @@ -143,7 +222,16 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("XML", "2.0"); assertTrue("throw_True", state); } - + + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported12() throws Throwable { List<String> features = new ArrayList<String>(); features.add("Core"); @@ -179,7 +267,16 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported(featureElement, "2.0"); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns correct value " + + "if it has empty string as a version parameter.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported13() throws Throwable { Document doc; Node rootNode; @@ -189,7 +286,16 @@ public final class IsSupported extends DOMTestCase { state = rootNode.isSupported("Core", ""); assertTrue("Core", state); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns correct value " + + "if it has null as a version parameter.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {String.class, String.class} + ) + }) public void testIsSupported14() throws Throwable { Document doc; Node rootNode; diff --git a/xml/src/test/java/org/w3c/dom/LocalName.java b/xml/src/test/java/tests/org/w3c/dom/LocalName.java index 9f6fa14..9d001c0 100644 --- a/xml/src/test/java/org/w3c/dom/LocalName.java +++ b/xml/src/test/java/tests/org/w3c/dom/LocalName.java @@ -1,12 +1,17 @@ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import org.w3c.dom.Element; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The "getLocalName()" method for a Node returns the local part of the @@ -23,6 +28,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a> */ +@TestTargetClass(Node.class) public final class LocalName extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -52,6 +58,15 @@ public final class LocalName extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "getLocalName", + methodArgs = {} + ) + }) public void testGetLocalName1() throws Throwable { Document doc; NodeList elementList; @@ -66,7 +81,15 @@ public final class LocalName extends DOMTestCase { localName = addrAttr.getLocalName(); assertEquals("localName", "domestic", localName); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that getLocalName method returns null.", + targets = { + @TestTarget( + methodName = "getLocalName", + methodArgs = {} + ) + }) public void testGetLocalName2() throws Throwable { Document doc; Node createdNode; @@ -76,7 +99,15 @@ public final class LocalName extends DOMTestCase { localName = createdNode.getLocalName(); assertNull("localNameNull", localName); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that getLocalName method returns null.", + targets = { + @TestTarget( + methodName = "getLocalName", + methodArgs = {} + ) + }) public void testGetLocalName3() throws Throwable { Document doc; NodeList elementList; @@ -90,7 +121,15 @@ public final class LocalName extends DOMTestCase { localName = textNode.getLocalName(); assertNull("textNodeLocalName", localName); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "getLocalName", + methodArgs = {} + ) + }) public void testGetLocalName4() throws Throwable { Document doc; NodeList elementList; diff --git a/xml/src/test/java/org/w3c/dom/NamedNodeMapGetNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java index 2f179ba..f4338e3 100644 --- a/xml/src/test/java/org/w3c/dom/NamedNodeMapGetNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java @@ -19,19 +19,21 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; -import org.w3c.dom.Element; -import org.w3c.dom.Entity; import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.w3c.dom.Notation; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +import javax.xml.parsers.DocumentBuilder; /** * Using the method getNamedItemNS, retreive the entity "ent1" and notation @@ -49,6 +51,7 @@ import org.w3c.dom.Notation; * @see <a * href="http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html">http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html</a> */ +@TestTargetClass(NamedNodeMap.class) public final class NamedNodeMapGetNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -100,7 +103,15 @@ public final class NamedNodeMapGetNamedItemNS extends DOMTestCase { // notation = (Notation) notations.getNamedItemNS(nullNS, "notation1"); // assertNotNull("notationNull", notation); // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetNamedItemNS2() throws Throwable { Document doc; NamedNodeMap attributes; @@ -118,7 +129,15 @@ public final class NamedNodeMapGetNamedItemNS extends DOMTestCase { attrName = attribute.getNodeName(); assertEquals("namednodemapgetnameditemns02", "emp:domestic", attrName); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetNamedItemNS3() throws Throwable { Document doc; NamedNodeMap attributes; @@ -140,7 +159,15 @@ public final class NamedNodeMapGetNamedItemNS extends DOMTestCase { attrName = attribute.getNodeName(); assertEquals("namednodemapgetnameditemns03", "L2:att", attrName); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetNamedItemNS4() throws Throwable { Document doc; NamedNodeMap attributes; @@ -160,7 +187,15 @@ public final class NamedNodeMapGetNamedItemNS extends DOMTestCase { attrName = attribute.getNodeName(); assertEquals("namednodemapgetnameditemns04", "street", attrName); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "getNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testGetNamedItemNS5() throws Throwable { Document doc; NamedNodeMap attributes; diff --git a/xml/src/test/java/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java index 377db71..af7f061 100644 --- a/xml/src/test/java/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java @@ -19,18 +19,22 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; -import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The method removeNamedItemNS removes a node specified by local name and @@ -44,6 +48,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a> */ +@TestTargetClass(NamedNodeMap.class) public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -73,6 +78,15 @@ public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS1() throws Throwable { Document doc; NamedNodeMap attributes; @@ -113,7 +127,15 @@ public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { // assertEquals("namednodemapremovenameditemns02_attrValue", "defaultVal", // attrValue); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS3() throws Throwable { Document doc; NamedNodeMap attributes; @@ -139,8 +161,16 @@ public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { nodeName = attribute.getNodeName(); assertEquals("namednodemapremovenameditemns02", "L2:att", nodeName); } - - public void testRemoveNamedItemNS4() throws Throwable { + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) + public void _testRemoveNamedItemNS4() throws Throwable { Document doc; NamedNodeMap attributes; Node element; @@ -207,7 +237,16 @@ public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { // } // } // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that removeNamedItemNS method throws DOMException " + + "with NOT_FOUND_ERR code.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS6() throws Throwable { Document doc; NamedNodeMap attributes; @@ -230,7 +269,16 @@ public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { assertTrue("throw_NOT_FOUND_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that removeNamedItemNS method throws DOMException " + + "with NOT_FOUND_ERR code.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS7() throws Throwable { Document doc; NamedNodeMap attributes; @@ -253,7 +301,16 @@ public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { assertTrue("throw_NOT_FOUND_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies that removeNamedItemNS method throws DOMException " + + "with NOT_FOUND_ERR code.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS8() throws Throwable { Document doc; NamedNodeMap attributes; @@ -277,7 +334,15 @@ public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase { assertTrue("throw_NOT_FOUND_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS9() throws Throwable { Document doc; NamedNodeMap attributes; diff --git a/xml/src/test/java/org/w3c/dom/NamedNodeMapSetNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java index 5f9a676..50c7022 100644 --- a/xml/src/test/java/org/w3c/dom/NamedNodeMapSetNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java @@ -19,21 +19,24 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Document; import org.w3c.dom.Attr; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Element; import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; -import org.w3c.dom.Element; -import org.w3c.dom.Entity; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Notation; + +import javax.xml.parsers.DocumentBuilder; /** * The method setNamedItemNS adds a node using its namespaceURI and localName. @@ -50,6 +53,7 @@ import org.w3c.dom.Notation; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a> */ +@TestTargetClass(NamedNodeMap.class) public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -82,6 +86,15 @@ public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS1() throws Throwable { Document doc; NamedNodeMap attributes; @@ -103,7 +116,15 @@ public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { attrName = attribute.getNodeName(); assertEquals("namednodemapsetnameditemns01", "streets", attrName); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS2() throws Throwable { Document doc; NamedNodeMap attributes; @@ -123,7 +144,16 @@ public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { attrName = attribute.getNodeName(); assertEquals("namednodemapsetnameditemns02", "L1:att", attrName); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that setNamedItemNS throws DOMException with " + + "WRONG_DOCUMENT_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS3() throws Throwable { Document doc; @@ -159,11 +189,20 @@ public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { assertTrue("throw_WRONG_DOCUMENT_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that setNamedItemNS throws DOMException with " + + "WRONG_DOCUMENT_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS4() throws Throwable { Document doc; DOMImplementation domImpl; - Document docAlt; + Document docAlt; DocumentType docType = null; NamedNodeMap attributes; @@ -230,7 +269,16 @@ public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { // assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR_notations", success); // } // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that setNamedItemNS throws DOMException with " + + "INUSE_ATTRIBUTE_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS6() throws Throwable { Document doc; NamedNodeMap attributes; @@ -257,7 +305,16 @@ public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { assertTrue("namednodemapsetnameditemns06", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that setNamedItemNS throws DOMException with " + + "INUSE_ATTRIBUTE_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS7() throws Throwable { Document doc; NamedNodeMap attributes; @@ -284,7 +341,16 @@ public final class NamedNodeMapSetNamedItemNS extends DOMTestCase { assertTrue("namednodemapsetnameditemns07", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that setNamedItemNS throws DOMException with " + + "INUSE_ATTRIBUTE_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS8() throws Throwable { Document doc; NamedNodeMap attributes; diff --git a/xml/src/test/java/org/w3c/dom/NamespaceURI.java b/xml/src/test/java/tests/org/w3c/dom/NamespaceURI.java index 2c00d62..788ef8b 100644 --- a/xml/src/test/java/org/w3c/dom/NamespaceURI.java +++ b/xml/src/test/java/tests/org/w3c/dom/NamespaceURI.java @@ -19,15 +19,20 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import org.w3c.dom.Attr; import org.w3c.dom.Document; +import org.w3c.dom.NodeList; import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; + +import javax.xml.parsers.DocumentBuilder; /** * The "getNamespaceURI()" method for an Attribute returns the namespace URI of @@ -44,6 +49,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a> */ +@TestTargetClass(Attr.class) public final class NamespaceURI extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -88,7 +94,15 @@ public final class NamespaceURI extends DOMTestCase { // attrNamespaceURI = addrAttr.getNamespaceURI(); // assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI); // } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that getNamespaceURI method returns null.", + targets = { + @TestTarget( + methodName = "getNamespaceURI", + methodArgs = {} + ) + }) public void testGetNamespaceURI2() throws Throwable { Document doc; NodeList elementList; @@ -104,7 +118,15 @@ public final class NamespaceURI extends DOMTestCase { attrNamespaceURI = addrAttr.getNamespaceURI(); assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that getNamespaceURI method returns null.", + targets = { + @TestTarget( + methodName = "getNamespaceURI", + methodArgs = {} + ) + }) public void testGetNamespaceURI3() throws Throwable { Document doc; NodeList elementList; @@ -117,7 +139,15 @@ public final class NamespaceURI extends DOMTestCase { employeeNamespace = testEmployee.getNamespaceURI(); assertEquals("namespaceURI", "http://www.nist.gov", employeeNamespace); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getNamespaceURI method returns null.", + targets = { + @TestTarget( + methodName = "getNamespaceURI", + methodArgs = {} + ) + }) public void testGetNamespaceURI4() throws Throwable { Document doc; NodeList elementList; diff --git a/xml/src/test/java/org/w3c/dom/NodeGetLocalName.java b/xml/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java index 35422c6..66c5b25 100644 --- a/xml/src/test/java/org/w3c/dom/NodeGetLocalName.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java @@ -20,13 +20,19 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; +import org.w3c.dom.Node; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The method getLocalName returns the local part of the qualified name of this node. @@ -38,6 +44,7 @@ import org.w3c.dom.Element; * @author Neil Delima * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a> */ +@TestTargetClass(Node.class) public final class NodeGetLocalName extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -65,6 +72,15 @@ public final class NodeGetLocalName extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify that getLocalName method returns null.", + targets = { + @TestTarget( + methodName = "getLocalName", + methodArgs = {} + ) + }) public void testGetLocalName() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/NodeGetNamespaceURI.java b/xml/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java index 59a4dea..e53d6cb 100644 --- a/xml/src/test/java/org/w3c/dom/NodeGetNamespaceURI.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java @@ -20,13 +20,19 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; +import org.w3c.dom.Node; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The method getNamespaceURI returns the namespace URI of this node, or null if it is unspecified @@ -40,6 +46,7 @@ import org.w3c.dom.Element; * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a> * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> */ +@TestTargetClass(Node.class) public final class NodeGetNamespaceURI extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -67,6 +74,15 @@ public final class NodeGetNamespaceURI extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getNamespaceURI", + methodArgs = {} + ) + }) public void testGetNamespaceURI() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/NodeGetOwnerDocument.java b/xml/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java index 4d40591..7034ea4 100644 --- a/xml/src/test/java/org/w3c/dom/NodeGetOwnerDocument.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java @@ -19,15 +19,21 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Node; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMImplementation; import org.w3c.dom.Element; +import javax.xml.parsers.DocumentBuilder; + /** * The method getOwnerDocument returns the Document object associated with this * node @@ -42,6 +48,7 @@ import org.w3c.dom.Element; * @see <a * href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a> */ +@TestTargetClass(Node.class) public final class NodeGetOwnerDocument extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -71,6 +78,15 @@ public final class NodeGetOwnerDocument extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getOwnerDocument method returns null.", + targets = { + @TestTarget( + methodName = "getOwnerDocument", + methodArgs = {} + ) + }) public void testGetOwnerDocument1() throws Throwable { Document doc; Document ownerDoc; @@ -84,7 +100,15 @@ public final class NodeGetOwnerDocument extends DOMTestCase { ownerDoc = docType.getOwnerDocument(); assertNull("nodegetownerdocument01", ownerDoc); } - + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getOwnerDocument", + methodArgs = {} + ) + }) public void testGetOwnerDocument2() throws Throwable { Document doc; Document newDoc; diff --git a/xml/src/test/java/org/w3c/dom/NodeGetPrefix.java b/xml/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java index 60cd269..e9cfa21 100644 --- a/xml/src/test/java/org/w3c/dom/NodeGetPrefix.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java @@ -20,13 +20,19 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; +import org.w3c.dom.Node; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The method getPrefix returns the namespace prefix of this node, or null if it is unspecified. @@ -38,6 +44,7 @@ import org.w3c.dom.Element; * @author Neil Delima * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a> */ +@TestTargetClass(Node.class) public final class NodeGetPrefix extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -66,6 +73,15 @@ public final class NodeGetPrefix extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix() throws Throwable { Document doc; Element element; diff --git a/xml/src/test/java/org/w3c/dom/NodeHasAttributes.java b/xml/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java index 894f61c..d7b0cf6 100644 --- a/xml/src/test/java/org/w3c/dom/NodeHasAttributes.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java @@ -19,16 +19,22 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Node; import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; import org.w3c.dom.Element; import org.w3c.dom.NodeList; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Attr; +import org.w3c.dom.DOMImplementation; + +import javax.xml.parsers.DocumentBuilder; /** * The method hasAttributes returns whether this node (if it is an element) has @@ -41,6 +47,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a> */ +@TestTargetClass(Node.class) public final class NodeHasAttributes extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -70,6 +77,15 @@ public final class NodeHasAttributes extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "hasAttributes", + methodArgs = {} + ) + }) public void testHasAttributes1() throws Throwable { Document doc; Element element; @@ -85,7 +101,15 @@ public final class NodeHasAttributes extends DOMTestCase { hasAttributes = element.hasAttributes(); assertTrue("nodehasattributes01_2", hasAttributes); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that hasAttributes method returns false value.", + targets = { + @TestTarget( + methodName = "hasAttributes", + methodArgs = {} + ) + }) public void testHasAttributes2() throws Throwable { Document doc; DocumentType docType; @@ -95,7 +119,15 @@ public final class NodeHasAttributes extends DOMTestCase { hasAttributes = docType.hasAttributes(); assertFalse("nodehasattributes02", hasAttributes); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that hasAttributes method returns true value.", + targets = { + @TestTarget( + methodName = "hasAttributes", + methodArgs = {} + ) + }) public void testHasAttributes3() throws Throwable { Document doc; Element element; @@ -108,7 +140,15 @@ public final class NodeHasAttributes extends DOMTestCase { hasAttributes = element.hasAttributes(); assertTrue("hasAttributes", hasAttributes); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that hasAttributes method returns true value.", + targets = { + @TestTarget( + methodName = "hasAttributes", + methodArgs = {} + ) + }) public void testHasAttributes4() throws Throwable { Document doc; Document newDoc; diff --git a/xml/src/test/java/org/w3c/dom/NodeIsSupported.java b/xml/src/test/java/tests/org/w3c/dom/NodeIsSupported.java index c984e07..f0f9110 100644 --- a/xml/src/test/java/org/w3c/dom/NodeIsSupported.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeIsSupported.java @@ -19,20 +19,26 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - -import org.w3c.dom.Attr; +import org.w3c.dom.Node; import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; import org.w3c.dom.Element; +import org.w3c.dom.Attr; +import org.w3c.dom.DocumentType; import org.w3c.dom.EntityReference; import org.w3c.dom.ProcessingInstruction; +import javax.xml.parsers.DocumentBuilder; + /** * The method "isSupported(feature,version)" Tests whether the DOM * implementation implements a specific feature and that feature is supported by @@ -49,6 +55,7 @@ import org.w3c.dom.ProcessingInstruction; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a> */ +@TestTargetClass(Node.class) public final class NodeIsSupported extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -78,6 +85,15 @@ public final class NodeIsSupported extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that isSupported method can return false value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testIsSupported1() throws Throwable { Document doc; Element element; @@ -113,7 +129,15 @@ public final class NodeIsSupported extends DOMTestCase { assertTrue("nodeissupported01_Core3", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify that isSupported method can return false value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testIsSupported2() throws Throwable { Document doc; Attr attribute; @@ -149,7 +173,16 @@ public final class NodeIsSupported extends DOMTestCase { assertTrue("nodeissupported02_Core3", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns false value " + + "if it's called with empty strings as parameters.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testIsSupported3() throws Throwable { Document doc; DocumentType docType; @@ -159,7 +192,15 @@ public final class NodeIsSupported extends DOMTestCase { success = docType.isSupported("", ""); assertFalse("nodeissupported03", success); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns false value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testIsSupported4() throws Throwable { Document doc; EntityReference entRef; @@ -170,7 +211,15 @@ public final class NodeIsSupported extends DOMTestCase { success = entRef.isSupported("XML CORE", ""); assertFalse("nodeissupported04", success); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that isSupported method returns false value.", + targets = { + @TestTarget( + methodName = "isSupported", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testIsSupported5() throws Throwable { Document doc; ProcessingInstruction pi; diff --git a/xml/src/test/java/org/w3c/dom/NodeNormalize.java b/xml/src/test/java/tests/org/w3c/dom/NodeNormalize.java index c7de6d0..664ad22 100644 --- a/xml/src/test/java/org/w3c/dom/NodeNormalize.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeNormalize.java @@ -19,20 +19,26 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.CDATASection; -import org.w3c.dom.Comment; -import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Node; import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; import org.w3c.dom.Element; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Text; +import org.w3c.dom.DOMImplementation; import org.w3c.dom.EntityReference; import org.w3c.dom.NodeList; +import org.w3c.dom.CDATASection; import org.w3c.dom.ProcessingInstruction; -import org.w3c.dom.Text; +import org.w3c.dom.Comment; + +import javax.xml.parsers.DocumentBuilder; /** * The method "normalize" puts all Text nodes in the full depth of the sub-tree @@ -51,6 +57,7 @@ import org.w3c.dom.Text; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize</a> */ +@TestTargetClass(Node.class) public final class NodeNormalize extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -80,6 +87,15 @@ public final class NodeNormalize extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "normalize", + methodArgs = {} + ) + }) public void testNormalize() throws Throwable { Document doc; Document newDoc; diff --git a/xml/src/test/java/org/w3c/dom/NodeSetPrefix.java b/xml/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java index 1aa78dc..ca2844f 100644 --- a/xml/src/test/java/org/w3c/dom/NodeSetPrefix.java +++ b/xml/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java @@ -19,20 +19,26 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import java.util.ArrayList; import java.util.List; -import javax.xml.parsers.DocumentBuilder; - -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; +import org.w3c.dom.Node; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; import org.w3c.dom.Element; +import org.w3c.dom.DOMException; +import org.w3c.dom.Attr; import org.w3c.dom.NodeList; +import javax.xml.parsers.DocumentBuilder; + /** * The method setPrefix sets the namespace prefix of this node. Note that * setting this attribute, when permitted, changes the nodeName attribute, which @@ -48,6 +54,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a> */ +@TestTargetClass(Node.class) public final class NodeSetPrefix extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -77,6 +84,15 @@ public final class NodeSetPrefix extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setPrefix", + methodArgs = {java.lang.String.class} + ) + }) public void testSetPrefix1() throws Throwable { Document doc; DocumentFragment docFragment; @@ -121,7 +137,15 @@ public final class NodeSetPrefix extends DOMTestCase { // assertEquals("nodesetprefix02_attrName", "dmstc:domestic", attrName); // assertEquals("nodesetprefix02_newAttrName", "dom:address", newAttrName); // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setPrefix", + methodArgs = {java.lang.String.class} + ) + }) public void testSetPrefix3() throws Throwable { Document doc; Element element; @@ -163,7 +187,15 @@ public final class NodeSetPrefix extends DOMTestCase { // assertTrue("nodesetprefix04", success); // } // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setPrefix", + methodArgs = {java.lang.String.class} + ) + }) public void testSetPrefix5() throws Throwable { Document doc; Element element; @@ -192,7 +224,15 @@ public final class NodeSetPrefix extends DOMTestCase { } } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setPrefix", + methodArgs = {java.lang.String.class} + ) + }) public void testSetPrefix6() throws Throwable { Document doc; Element element; @@ -210,7 +250,15 @@ public final class NodeSetPrefix extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setPrefix", + methodArgs = {java.lang.String.class} + ) + }) public void testSetPrefix7() throws Throwable { Document doc; Attr attribute; @@ -228,7 +276,15 @@ public final class NodeSetPrefix extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR.", + targets = { + @TestTarget( + methodName = "setPrefix", + methodArgs = {java.lang.String.class} + ) + }) public void testSetPrefix8() throws Throwable { Document doc; Element element; @@ -249,8 +305,16 @@ public final class NodeSetPrefix extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - - public void testSetPrefix9() throws Throwable { + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with INVALID_CHARACTER_ERR code.", + targets = { + @TestTarget( + methodName = "setPrefix", + methodArgs = {java.lang.String.class} + ) + }) + public void _testSetPrefix9() throws Throwable { Document doc; String value = "#$%&'()@"; Element element; diff --git a/xml/src/test/java/org/w3c/dom/Normalize.java b/xml/src/test/java/tests/org/w3c/dom/Normalize.java index fcfb459..40b4b29 100644 --- a/xml/src/test/java/org/w3c/dom/Normalize.java +++ b/xml/src/test/java/tests/org/w3c/dom/Normalize.java @@ -20,15 +20,20 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.CharacterData; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.CharacterData; + +import javax.xml.parsers.DocumentBuilder; /** * The "normalize()" method puts all the nodes in the full @@ -45,6 +50,7 @@ import org.w3c.dom.NodeList; * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize</a> * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-72AB8359">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-72AB8359</a> */ +@TestTargetClass(Element.class) public final class Normalize extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -71,6 +77,15 @@ public final class Normalize extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "normalize", + methodArgs = {} + ) + }) public void testNormalize() throws Throwable { Document doc; Element root; diff --git a/xml/src/test/java/org/w3c/dom/OwnerDocument.java b/xml/src/test/java/tests/org/w3c/dom/OwnerDocument.java index 1c3830b..3a2537b 100644 --- a/xml/src/test/java/org/w3c/dom/OwnerDocument.java +++ b/xml/src/test/java/tests/org/w3c/dom/OwnerDocument.java @@ -20,13 +20,18 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import javax.xml.parsers.DocumentBuilder; + /** * The "getOwnerDocument()" method returns null if the target * node itself is a DocumentType which is not used with any document yet. @@ -37,6 +42,7 @@ import org.w3c.dom.DocumentType; * @author Mary Brady * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc">http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc</a> */ +@TestTargetClass(Document.class) public final class OwnerDocument extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -64,6 +70,15 @@ public final class OwnerDocument extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Dosn't verify that getOwnerDocument can return not null value.", + targets = { + @TestTarget( + methodName = "getOwnerDocument", + methodArgs = {} + ) + }) public void testGetOwnerDocument() throws Throwable { Document doc; DocumentType ownerDocument; diff --git a/xml/src/test/java/org/w3c/dom/OwnerElement.java b/xml/src/test/java/tests/org/w3c/dom/OwnerElement.java index cf18326..267d314 100644 --- a/xml/src/test/java/org/w3c/dom/OwnerElement.java +++ b/xml/src/test/java/tests/org/w3c/dom/OwnerElement.java @@ -19,16 +19,21 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; +import org.w3c.dom.Node; import org.w3c.dom.Attr; import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Element; + +import javax.xml.parsers.DocumentBuilder; /** * The "getOwnerElement()" will return the Element node this attribute is @@ -42,6 +47,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a> */ +@TestTargetClass(Attr.class) public final class OwnerElement extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -71,6 +77,15 @@ public final class OwnerElement extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies positive functionlity.", + targets = { + @TestTarget( + methodName = "getOwnerElement", + methodArgs = {} + ) + }) public void testGetOwnerElement1() throws Throwable { Document doc; NodeList addressList; @@ -88,7 +103,15 @@ public final class OwnerElement extends DOMTestCase { name = elementNode.getNodeName(); assertEquals("throw_Equals", "address", name); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getOwnerElement method returns null.", + targets = { + @TestTarget( + methodName = "getOwnerElement", + methodArgs = {} + ) + }) public void testGetOwnerElement2() throws Throwable { Document doc; Attr newAttr; diff --git a/xml/src/test/java/org/w3c/dom/Prefix.java b/xml/src/test/java/tests/org/w3c/dom/Prefix.java index 34fea2b..60bd3e4 100644 --- a/xml/src/test/java/org/w3c/dom/Prefix.java +++ b/xml/src/test/java/tests/org/w3c/dom/Prefix.java @@ -19,16 +19,21 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import org.w3c.dom.Element; +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The "getPrefix()" method for a Node returns the namespace prefix of the node, @@ -44,6 +49,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a> */ +@TestTargetClass(Node.class) public final class Prefix extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -73,6 +79,15 @@ public final class Prefix extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method can return null.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix1() throws Throwable { Document doc; Node createdNode; @@ -82,7 +97,15 @@ public final class Prefix extends DOMTestCase { prefix = createdNode.getPrefix(); assertNull("throw_Null", prefix); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies positive functionality of getPrefix method.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix2() throws Throwable { Document doc; NodeList elementList; @@ -97,7 +120,15 @@ public final class Prefix extends DOMTestCase { prefix = textNode.getPrefix(); assertNull("textNodePrefix", prefix); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies positive functionality of getPrefix method.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix3() throws Throwable { Document doc; NodeList elementList; @@ -110,7 +141,15 @@ public final class Prefix extends DOMTestCase { prefix = testEmployee.getPrefix(); assertEquals("prefix", "emp", prefix); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method returns null.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix4() throws Throwable { Document doc; NodeList elementList; @@ -122,7 +161,16 @@ public final class Prefix extends DOMTestCase { prefix = testEmployee.getPrefix(); assertNull("throw_Null", prefix); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix5() throws Throwable { Document doc; NodeList elementList; @@ -144,8 +192,17 @@ public final class Prefix extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - - public void testGetPrefix6() throws Throwable { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method throws DOMException with " + + "INVALID_CHARACTER_ERR code.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) + public void _testGetPrefix6() throws Throwable { Document doc; NodeList elementList; Node employeeNode; @@ -163,7 +220,16 @@ public final class Prefix extends DOMTestCase { assertTrue("throw_INVALID_CHARACTER_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix7() throws Throwable { Document doc; NodeList elementList; @@ -216,8 +282,17 @@ public final class Prefix extends DOMTestCase { // assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); // } // } - - public void testGetPrefix9() throws Throwable { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) + public void _testGetPrefix9() throws Throwable { Document doc; NodeList elementList; Element addrNode; @@ -237,7 +312,16 @@ public final class Prefix extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix10() throws Throwable { Document doc; NodeList elementList; @@ -256,7 +340,16 @@ public final class Prefix extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies that getPrefix method throws DOMException with " + + "NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "getPrefix", + methodArgs = {} + ) + }) public void testGetPrefix11() throws Throwable { Document doc; NodeList elementList; diff --git a/xml/src/test/java/org/w3c/dom/PublicId.java b/xml/src/test/java/tests/org/w3c/dom/PublicId.java index 5e1c1c3..a366e2d 100644 --- a/xml/src/test/java/org/w3c/dom/PublicId.java +++ b/xml/src/test/java/tests/org/w3c/dom/PublicId.java @@ -20,12 +20,17 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.Document; + +import javax.xml.parsers.DocumentBuilder; /** * The "getPublicId()" method of a documenttype node contains @@ -38,6 +43,7 @@ import org.w3c.dom.DocumentType; * @author Mary Brady * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId</a> */ +@TestTargetClass(DocumentType.class) public final class PublicId extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -65,6 +71,15 @@ public final class PublicId extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getPublicId", + methodArgs = {} + ) + }) public void testGetPublicId() throws Throwable { Document doc; DocumentType docType; diff --git a/xml/src/test/java/org/w3c/dom/RemoveAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java index badc004..6a84d1b 100644 --- a/xml/src/test/java/org/w3c/dom/RemoveAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java @@ -19,7 +19,9 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; + +import dalvik.annotation.TestTargetClass; import javax.xml.parsers.DocumentBuilder; @@ -49,6 +51,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElRemAtNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElRemAtNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a> */ +@TestTargetClass(Attr.class) public final class RemoveAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; diff --git a/xml/src/test/java/org/w3c/dom/RemoveNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java index a3e11fc..e4a6656 100644 --- a/xml/src/test/java/org/w3c/dom/RemoveNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java @@ -19,16 +19,21 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The "removeNamedItemNS(namespaceURI,localName)" method for a NamedNodeMap @@ -45,6 +50,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1074577549">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1074577549</a> */ +@TestTargetClass(NamedNodeMap.class) public final class RemoveNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -74,6 +80,15 @@ public final class RemoveNamedItemNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify DOMException exception.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS1() throws Throwable { Document doc; NodeList elementList; @@ -91,7 +106,15 @@ public final class RemoveNamedItemNS extends DOMTestCase { newAttr = (Attr) attributes.getNamedItem("dmstc:domestic"); assertNull("nodeRemoved", newAttr); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies DOMException with NOT_FOUND_ERR code.", + targets = { + @TestTarget( + methodName = "removeNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testRemoveNamedItemNS2() throws Throwable { String namespaceURI = "http://www.usa.com"; String localName = "domest"; diff --git a/xml/src/test/java/org/w3c/dom/SetAttributeNS.java b/xml/src/test/java/tests/org/w3c/dom/SetAttributeNS.java index 038faee..5ecf072 100644 --- a/xml/src/test/java/org/w3c/dom/SetAttributeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/SetAttributeNS.java @@ -19,16 +19,21 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.DOMException; +import org.w3c.dom.Attr; + +import javax.xml.parsers.DocumentBuilder; /** * The "setAttributeNS(namespaceURI,qualifiedName,Value)" method raises a @@ -47,6 +52,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a> */ +@TestTargetClass(Element.class) public final class SetAttributeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -76,6 +82,15 @@ public final class SetAttributeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with INVALID_CHARACTER_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS1() throws Throwable { String namespaceURI = "http://www.nist.gov"; String qualifiedName = "emp:qual?name"; @@ -97,7 +112,15 @@ public final class SetAttributeNS extends DOMTestCase { assertTrue("throw_INVALID_CHARACTER_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS2() throws Throwable { String namespaceURI = "http://www.nist.gov"; String qualifiedName = "emp:"; @@ -158,7 +181,15 @@ public final class SetAttributeNS extends DOMTestCase { // assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); // } // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, boolean.class} + ) + }) public void testSetAttributeNS4() throws Throwable { Document doc; NodeList elementList; @@ -186,7 +217,15 @@ public final class SetAttributeNS extends DOMTestCase { resultPrefix = addrAttr.getPrefix(); assertEquals("prefix", "newprefix", resultPrefix); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS5() throws Throwable { String localName = "newAttr"; String namespaceURI = "http://www.newattr.com"; @@ -206,7 +245,15 @@ public final class SetAttributeNS extends DOMTestCase { namespaceURI, localName); assertEquals("throw_Equals", "<newValue>", resultAttr); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS6() throws Throwable { String namespaceURI = "http://www.nist.gov"; String qualifiedName = "xml:qualifiedName"; @@ -228,7 +275,15 @@ public final class SetAttributeNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS7() throws Throwable { String namespaceURI = "http://www.nist.gov"; String qualifiedName = "xmlns"; @@ -250,7 +305,15 @@ public final class SetAttributeNS extends DOMTestCase { assertTrue("throw_NAMESPACE_ERR", success); } } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive functionality.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS9() throws Throwable { String localName = "newAttr"; String namespaceURI = "http://www.newattr.com"; @@ -281,7 +344,15 @@ public final class SetAttributeNS extends DOMTestCase { resultPrefix = addrAttr.getPrefix(); assertEquals("prefix", "emp", resultPrefix); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with NAMESPACE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNS", + methodArgs = {java.lang.String.class, java.lang.String.class, java.lang.String.class} + ) + }) public void testSetAttributeNS10() throws Throwable { String namespaceURI = "http://www.example.gov"; Document doc; diff --git a/xml/src/test/java/org/w3c/dom/SetAttributeNodeNS.java b/xml/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java index e3c8e19..c26bc47 100644 --- a/xml/src/test/java/org/w3c/dom/SetAttributeNodeNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java @@ -19,16 +19,21 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The "setAttributeNode(newAttr)" method raises an "INUSE_ATTRIBUTE_ERR @@ -50,6 +55,7 @@ import org.w3c.dom.NodeList; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a> */ +@TestTargetClass(Element.class) public final class SetAttributeNodeNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -79,6 +85,15 @@ public final class SetAttributeNodeNS extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNode1() throws Throwable { String namespaceURI = "http://www.newattr.com"; String qualifiedName = "emp:newAttr"; @@ -145,7 +160,15 @@ public final class SetAttributeNodeNS extends DOMTestCase { // assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); // } // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNode3() throws Throwable { String namespaceURI = "http://www.newattr.com"; String qualifiedName = "emp:newAttr"; @@ -163,7 +186,15 @@ public final class SetAttributeNodeNS extends DOMTestCase { .setAttributeNodeNS(newAttr); assertNull("throw_Null", newAddrAttr); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Doesn't verify DOMException.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNode4() throws Throwable { Document doc; NodeList elementList; @@ -181,7 +212,15 @@ public final class SetAttributeNodeNS extends DOMTestCase { newName = newAddrAttr.getNodeName(); assertEquals("nodeName", "emp:domestic", newName); } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with WRONG_DOCUMENT_ERR code.", + targets = { + @TestTarget( + methodName = "setAttributeNodeNS", + methodArgs = {org.w3c.dom.Attr.class} + ) + }) public void testSetAttributeNode5() throws Throwable { String namespaceURI = "http://www.newattr.com"; String qualifiedName = "emp:newAttr"; diff --git a/xml/src/test/java/org/w3c/dom/SetNamedItemNS.java b/xml/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java index 6c36dd9..2237eff 100644 --- a/xml/src/test/java/org/w3c/dom/SetNamedItemNS.java +++ b/xml/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java @@ -20,15 +20,20 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.DOMException; + +import javax.xml.parsers.DocumentBuilder; /** * The "setNamedItemNS(arg)" method for a @@ -46,6 +51,7 @@ import org.w3c.dom.NodeList; * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a> * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a> */ +@TestTargetClass(NamedNodeMap.class) public final class SetNamedItemNS extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -73,6 +79,15 @@ public final class SetNamedItemNS extends DOMTestCase { * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS1() throws Throwable { Document doc; NodeList elementList; @@ -100,6 +115,15 @@ public final class SetNamedItemNS extends DOMTestCase { assertTrue("throw_INUSE_ATTRIBUTE_ERR", success); } } + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies DOMException with WRONG_DOCUMENT_ERR code.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS2() throws Throwable { String namespaceURI = "http://www.usa.com"; String qualifiedName = "dmstc:domestic"; @@ -128,6 +152,15 @@ public final class SetNamedItemNS extends DOMTestCase { assertTrue("throw_WRONG_DOCUMENT_ERR", success); } } + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive fnctionality.", + targets = { + @TestTarget( + methodName = "getNamedItemNS", + methodArgs = {java.lang.String.class, java.lang.String.class} + ) + }) public void testSetNamedItemNS3() throws Throwable { String namespaceURI = "http://www.nist.gov"; String qualifiedName = "prefix:newAttr"; @@ -193,7 +226,15 @@ public final class SetNamedItemNS extends DOMTestCase { // assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success); // } // } - + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "Verifies positive fnctionality.", + targets = { + @TestTarget( + methodName = "setNamedItemNS", + methodArgs = {org.w3c.dom.Node.class} + ) + }) public void testSetNamedItemNS5() throws Throwable { String namespaceURI = "http://www.usa.com"; String qualifiedName = "dmstc:domestic"; diff --git a/xml/src/test/java/org/w3c/dom/SystemId.java b/xml/src/test/java/tests/org/w3c/dom/SystemId.java index 4250581..e3bde42 100644 --- a/xml/src/test/java/org/w3c/dom/SystemId.java +++ b/xml/src/test/java/tests/org/w3c/dom/SystemId.java @@ -19,12 +19,17 @@ */ -package org.w3c.dom; +package tests.org.w3c.dom; -import javax.xml.parsers.DocumentBuilder; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.w3c.dom.Document; + +import javax.xml.parsers.DocumentBuilder; /** * The "getSystemId()" method of a documenttype node contains the system @@ -38,6 +43,7 @@ import org.w3c.dom.DocumentType; * @see <a * href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a> */ +@TestTargetClass(DocumentType.class) public final class SystemId extends DOMTestCase { DOMDocumentBuilderFactory factory; @@ -67,6 +73,15 @@ public final class SystemId extends DOMTestCase { * @throws Throwable * Any uncaught exception causes test to fail */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getSystemId", + methodArgs = {} + ) + }) public void testGetSystemId() throws Throwable { Document doc; DocumentType docType; diff --git a/xml/src/test/java/tests/xml/AllTests.java b/xml/src/test/java/tests/xml/AllTests.java index f18510a..146eb57 100644 --- a/xml/src/test/java/tests/xml/AllTests.java +++ b/xml/src/test/java/tests/xml/AllTests.java @@ -27,9 +27,9 @@ public class AllTests { suite.addTestSuite(SimpleParserTest.class); suite.addTestSuite(SimpleBuilderTest.class); - suite.addTest(org.w3c.dom.AllTests.suite()); + suite.addTest(tests.org.w3c.dom.AllTests.suite()); suite.addTest(tests.api.javax.xml.parsers.AllTests.suite()); - + return suite; } diff --git a/xml/src/test/java/tests/xml/SimpleBuilderTest.java b/xml/src/test/java/tests/xml/SimpleBuilderTest.java index 412c9a7..c25698c 100644 --- a/xml/src/test/java/tests/xml/SimpleBuilderTest.java +++ b/xml/src/test/java/tests/xml/SimpleBuilderTest.java @@ -16,6 +16,11 @@ package tests.xml; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + import junit.framework.TestCase; import org.w3c.dom.Comment; @@ -30,6 +35,7 @@ import org.w3c.dom.Text; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +@TestTargetClass(DocumentBuilder.class) public class SimpleBuilderTest extends TestCase { private DocumentBuilder builder; @@ -57,7 +63,15 @@ public class SimpleBuilderTest extends TestCase { return result; } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Regression test.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class} + ) + }) public void testGoodFile1() throws Exception { Document document = builder.parse(getClass().getResourceAsStream( "/SimpleBuilderTest.xml")); @@ -110,7 +124,15 @@ public class SimpleBuilderTest extends TestCase { assertEquals("The quick brown fox jumps over the lazy dog.", proinst); assertEquals(" Fragile! Handle me with care! ", comment); } - + @TestInfo( + level = TestLevel.TODO, + purpose = "Doesn't verify anything.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class} + ) + }) public void testGoodFile2() throws Exception { Document document = builder.parse(getClass().getResourceAsStream( "/staffNS.xml")); diff --git a/xml/src/test/java/tests/xml/SimpleParserTest.java b/xml/src/test/java/tests/xml/SimpleParserTest.java index 5932c95..0d63262 100644 --- a/xml/src/test/java/tests/xml/SimpleParserTest.java +++ b/xml/src/test/java/tests/xml/SimpleParserTest.java @@ -16,6 +16,11 @@ package tests.xml; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + import junit.framework.TestCase; import org.xml.sax.Attributes; @@ -34,6 +39,7 @@ import java.util.Map; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; +@TestTargetClass(SAXParser.class) public class SimpleParserTest extends TestCase implements ContentHandler { private SAXParser parser; @@ -160,7 +166,16 @@ public class SimpleParserTest extends TestCase implements ContentHandler { public void startPrefixMapping(String prefix, String uri) { } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, + org.xml.sax.helpers.DefaultHandler.class} + ) + }) public void testWorkingFile1() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); @@ -185,7 +200,15 @@ public class SimpleParserTest extends TestCase implements ContentHandler { assertEquals("http://www.foobar.org", namespaces1.get("stuff")); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class} + ) + }) public void testWorkingFile2() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); @@ -214,7 +237,15 @@ public class SimpleParserTest extends TestCase implements ContentHandler { assertEquals(0, namespaces2.size()); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify exceptions.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class} + ) + }) public void testEntityResolver() throws Exception { final StringBuilder text = new StringBuilder(); DefaultHandler handler = new DefaultHandler() { @@ -244,7 +275,15 @@ public class SimpleParserTest extends TestCase implements ContentHandler { "resolved external entity must be in parser character stream", text.toString().contains("test")); } - + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Doesn't verify exceptions.", + targets = { + @TestTarget( + methodName = "parse", + methodArgs = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class} + ) + }) public void testGetValue() throws Exception{ parser.parse(getClass().getResourceAsStream("/staffNS.xml"), new DefaultHandler() { |