org.jdom.test.cases
Class TestElement

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jdom.test.cases.TestElement
All Implemented Interfaces:
junit.framework.Test

public final class TestElement
extends junit.framework.TestCase


Constructor Summary
TestElement(java.lang.String name)
          Construct a new instance.
 
Method Summary
static void main(java.lang.String[] args)
          The main method runs all the tests in the text ui
 void setUp()
          This method is called before a test is executed.
static junit.framework.Test suite()
          The suite method runs all the tests
 void tearDown()
          This method is called after a test is executed.
 void test_AddingString()
           
 void test_setAttribute_String_String__attributeTypes()
          Test addAttribute with a supplied name and value
 void test_setAttribute_String_String_String__attributeTypes()
          Test addAttribute with a supplied name and value
 void test_TCC___String_OrgJdomNamespace()
          Test the Element constructor with an name and namespace
 void test_TCC___String_String_String()
          Test the Element constructor with a namespace uri and prefix
 void test_TCC___String_String()
          Test the Element constructor with a string default namespace
 void test_TCC___String()
          Test the constructor for an empty element
 void test_TCM__boolean_equals_Object()
          Test the equals compares only object instances
 void test_TCM__boolean_hasMixedContent()
          Test that hasMixedContent works for varying types of possible child and other content
 void test_TCM__boolean_isRootElement()
          Test that an Element can determine if it is a root element
 void test_TCM__boolean_removeAttribute_String_OrgJdomNamespace()
          Test removeAttribute with a namespace
 void test_TCM__boolean_removeAttribute_String_String()
          Test removeAtttribute with a namespace uri.
 void test_TCM__boolean_removeAttribute_String()
          Test than an Element can remove an Attribute by name
 void test_TCM__boolean_removeChild_String_OrgJdomNamespace()
          Test removeChild by name and namespace
 void test_TCM__boolean_removeChild_String()
          Test removeChild by name
 void test_TCM__boolean_removeContent_OrgJdomComment()
          Test removeContent for a Comment
 void test_TCM__boolean_removeContent_OrgJdomElement()
          Test removeContent for an Element.
 void test_TCM__boolean_removeContent_OrgJdomEntity()
          Test removeContent for entities.
 void test_TCM__boolean_removeContent_OrgJdomProcessingInstruction()
          Test removeContent for processing instructions.
 void test_TCM__int_hashCode()
          Test hashcode functions.
 void test_TCM__List_getAdditionalNamespaces()
          Test that additionalNamespaces are returned.
 void test_TCM__List_getAttributes()
          Test that getAttribute returns all attributes of this element.
 void test_TCM__List_getChildren_String_OrgJdomNamespace()
          Test that Element returns a List of children by name and namespace
 void test_TCM__List_getChildren_String()
          Test that Element returns a List of children by name
 void test_TCM__List_getChildren()
          Test getChildren to return all children from all namespaces.
 void test_TCM__List_getContent()
          Test that getContent returns all the content for the element
 void test_TCM__Object_clone()
          Test that clone returns a disconnected copy of the original element.
 void test_TCM__OrgJdomAttribute_getAttribute_String_OrgJdomNamespace()
          Test getAttribute by name and namespace
 void test_TCM__OrgJdomAttribute_getAttribute_String()
          Test getAttribute by name
 void test_TCM__OrgJdomDocument_getDocument()
          Test that an element returns the reference to it's enclosing document
 void test_TCM__OrgJdomElement_addContent_OrgJdomCDATA()
          Test addContent for CDATA.
 void test_TCM__OrgJdomElement_addContent_OrgJdomComment()
          Test adding comment content.
 void test_TCM__OrgJdomElement_addContent_OrgJdomElement()
          Test addContent for Element.
 void test_TCM__OrgJdomElement_addContent_OrgJdomEntityRef()
          Test addContent for Entity
 void test_TCM__OrgJdomElement_addContent_OrgJdomProcessingInstruction()
          Test addContent for ProcessingInstruction.
 void test_TCM__OrgJdomElement_addContent_String()
          Test that string based content is added correctly to an Element.
 void test_TCM__OrgJdomElement_getChild_String_OrgJdomNamespace()
          Test getContent by child name and namespace.
 void test_TCM__OrgJdomElement_getChild_String()
          Test getContent by child name.
 void test_TCM__OrgJdomElement_getCopy_String_OrgJdomNamespace()
          Test getCopy with the name and namespace arguments.
 void test_TCM__OrgJdomElement_getCopy_String()
          Test getCopy with only the name argument.
 void test_TCM__OrgJdomElement_getParent()
          Test test that a child element can return it's parent.
 void test_TCM__OrgJdomElement_setAttribute_OrgJdomAttribute()
          Test addAttribute with an Attribute
 void test_TCM__OrgJdomElement_setAttribute_String_String__invalidCharacters()
          Test addAttribute with a supplied name and value
 void test_TCM__OrgJdomElement_setAttributes_List()
          Test that attributes are added correctly as a list
 void test_TCM__OrgJdomElement_setContent_List()
          Test adding mixed content in a List
 void test_TCM__OrgJdomElement_setText_String()
          Test setting the content of the Element with just a string This should wipe out all other content the element has
 void test_TCM__OrgJdomNamespace_getNamespace_String()
          Test that Element can return a namespace given a uri
 void test_TCM__OrgJdomNamespace_getNamespace()
          Test that the Element returns it's primary namespace
 void test_TCM__String_getAttributeValue_String_OrgJdomNamespace()
          Test getAttributeValue with name and namespace
 void test_TCM__String_getAttributeValue_String()
          Test getAttributeValue by attribute name.
 void test_TCM__String_getChildText_String_OrgJdomNamespace()
          Test the convience method for retrieving child text for a child retrieved by name and namespace
 void test_TCM__String_getChildText_String()
          Test the convience method for retrieving child text.
 void test_TCM__String_getChildTextTrim_String_OrgJdomNamespace()
          Test the convience method for retrieving trimmed child text for the child in the given namespace
 void test_TCM__String_getChildTextTrim_String()
          Test the convience method for retrieving trimmed child text.
 void test_TCM__String_getName()
          Test getName.
 void test_TCM__String_getNamespacePrefix()
          Test getNamespacePrefix.
 void test_TCM__String_getNamespaceURI()
          Test code goes here.
 void test_TCM__String_getQualifiedName()
          Test that Element returns the correct qualified name.
 void test_TCM__String_getSerializedForm()
          Test getSerializedForm
 void test_TCM__String_getText()
          Test getText returns that full text of the element
 void test_TCM__String_getTextTrim()
          Test getTextTrim.
 void test_TCM__String_toString()
          Test the toString method which should return a useful string for debugging purposes only
 void test_TCM__void_addNamespaceDeclaration_OrgJdomNamespace()
          Test addNamespaceDeclaration for prefix and uri.
 void test_TCU__testAttributeNamespaces()
          Test that attributes will be added and retrieved according to specs.
 void test_TCU__testDefaultNamespaces()
          Test that an Element properly handles default namespaces
 void test_TCU__testSerialization()
          Test that Element serialization works, including with namespaces
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestElement

public TestElement(java.lang.String name)
Construct a new instance.

Method Detail

main

public static void main(java.lang.String[] args)
The main method runs all the tests in the text ui


setUp

public void setUp()
This method is called before a test is executed.

Overrides:
setUp in class junit.framework.TestCase

suite

public static junit.framework.Test suite()
The suite method runs all the tests


tearDown

public void tearDown()
This method is called after a test is executed.

Overrides:
tearDown in class junit.framework.TestCase

test_TCC___String

public void test_TCC___String()
Test the constructor for an empty element


test_TCC___String_OrgJdomNamespace

public void test_TCC___String_OrgJdomNamespace()
Test the Element constructor with an name and namespace


test_TCC___String_String

public void test_TCC___String_String()
Test the Element constructor with a string default namespace


test_TCC___String_String_String

public void test_TCC___String_String_String()
Test the Element constructor with a namespace uri and prefix


test_TCM__boolean_equals_Object

public void test_TCM__boolean_equals_Object()
Test the equals compares only object instances


test_TCM__boolean_hasMixedContent

public void test_TCM__boolean_hasMixedContent()
Test that hasMixedContent works for varying types of possible child and other content


test_TCM__boolean_isRootElement

public void test_TCM__boolean_isRootElement()
Test that an Element can determine if it is a root element


test_TCM__boolean_removeAttribute_String

public void test_TCM__boolean_removeAttribute_String()
Test than an Element can remove an Attribute by name


test_TCM__boolean_removeAttribute_String_OrgJdomNamespace

public void test_TCM__boolean_removeAttribute_String_OrgJdomNamespace()
Test removeAttribute with a namespace


test_TCM__boolean_removeAttribute_String_String

public void test_TCM__boolean_removeAttribute_String_String()
Test removeAtttribute with a namespace uri.


test_TCM__boolean_removeChild_String

public void test_TCM__boolean_removeChild_String()
Test removeChild by name


test_TCM__boolean_removeChild_String_OrgJdomNamespace

public void test_TCM__boolean_removeChild_String_OrgJdomNamespace()
Test removeChild by name and namespace


test_TCM__boolean_removeContent_OrgJdomComment

public void test_TCM__boolean_removeContent_OrgJdomComment()
Test removeContent for a Comment


test_TCM__boolean_removeContent_OrgJdomElement

public void test_TCM__boolean_removeContent_OrgJdomElement()
Test removeContent for an Element.


test_TCM__boolean_removeContent_OrgJdomEntity

public void test_TCM__boolean_removeContent_OrgJdomEntity()
Test removeContent for entities.


test_TCM__boolean_removeContent_OrgJdomProcessingInstruction

public void test_TCM__boolean_removeContent_OrgJdomProcessingInstruction()
Test removeContent for processing instructions.


test_TCM__int_hashCode

public void test_TCM__int_hashCode()
Test hashcode functions.


test_TCM__List_getAdditionalNamespaces

public void test_TCM__List_getAdditionalNamespaces()
Test that additionalNamespaces are returned.


test_TCM__List_getAttributes

public void test_TCM__List_getAttributes()
Test that getAttribute returns all attributes of this element.


test_TCM__List_getChildren

public void test_TCM__List_getChildren()
Test getChildren to return all children from all namespaces.


test_TCM__List_getChildren_String

public void test_TCM__List_getChildren_String()
Test that Element returns a List of children by name


test_TCM__List_getChildren_String_OrgJdomNamespace

public void test_TCM__List_getChildren_String_OrgJdomNamespace()
Test that Element returns a List of children by name and namespace


test_TCM__List_getContent

public void test_TCM__List_getContent()
Test that getContent returns all the content for the element


test_TCM__Object_clone

public void test_TCM__Object_clone()
Test that clone returns a disconnected copy of the original element. Since clone is a deep copy, that must be tested also


test_TCM__OrgJdomAttribute_getAttribute_String

public void test_TCM__OrgJdomAttribute_getAttribute_String()
Test getAttribute by name


test_TCM__OrgJdomAttribute_getAttribute_String_OrgJdomNamespace

public void test_TCM__OrgJdomAttribute_getAttribute_String_OrgJdomNamespace()
Test getAttribute by name and namespace


test_TCM__OrgJdomDocument_getDocument

public void test_TCM__OrgJdomDocument_getDocument()
Test that an element returns the reference to it's enclosing document


test_TCM__OrgJdomElement_addContent_OrgJdomCDATA

public void test_TCM__OrgJdomElement_addContent_OrgJdomCDATA()
Test addContent for CDATA.


test_TCM__OrgJdomElement_addContent_OrgJdomComment

public void test_TCM__OrgJdomElement_addContent_OrgJdomComment()
Test adding comment content.


test_TCM__OrgJdomElement_addContent_OrgJdomElement

public void test_TCM__OrgJdomElement_addContent_OrgJdomElement()
Test addContent for Element.


test_TCM__OrgJdomElement_addContent_OrgJdomEntityRef

public void test_TCM__OrgJdomElement_addContent_OrgJdomEntityRef()
Test addContent for Entity


test_TCM__OrgJdomElement_addContent_OrgJdomProcessingInstruction

public void test_TCM__OrgJdomElement_addContent_OrgJdomProcessingInstruction()
Test addContent for ProcessingInstruction.


test_TCM__OrgJdomElement_addContent_String

public void test_TCM__OrgJdomElement_addContent_String()
Test that string based content is added correctly to an Element.


test_TCM__OrgJdomElement_getChild_String

public void test_TCM__OrgJdomElement_getChild_String()
Test getContent by child name.


test_TCM__OrgJdomElement_getChild_String_OrgJdomNamespace

public void test_TCM__OrgJdomElement_getChild_String_OrgJdomNamespace()
Test getContent by child name and namespace.


test_TCM__OrgJdomElement_getCopy_String

public void test_TCM__OrgJdomElement_getCopy_String()
Test getCopy with only the name argument. Since the copy is just a clone, the clone test covers most of the testing.


test_TCM__OrgJdomElement_getCopy_String_OrgJdomNamespace

public void test_TCM__OrgJdomElement_getCopy_String_OrgJdomNamespace()
Test getCopy with the name and namespace arguments. Since the copy is just a clone, the clone test covers most of the testing.


test_TCM__OrgJdomElement_getParent

public void test_TCM__OrgJdomElement_getParent()
Test test that a child element can return it's parent.


test_TCM__OrgJdomElement_setAttribute_OrgJdomAttribute

public void test_TCM__OrgJdomElement_setAttribute_OrgJdomAttribute()
Test addAttribute with an Attribute


test_TCM__OrgJdomElement_setAttribute_String_String__invalidCharacters

public void test_TCM__OrgJdomElement_setAttribute_String_String__invalidCharacters()
Test addAttribute with a supplied name and value


test_setAttribute_String_String__attributeTypes

public void test_setAttribute_String_String__attributeTypes()
Test addAttribute with a supplied name and value


test_setAttribute_String_String_String__attributeTypes

public void test_setAttribute_String_String_String__attributeTypes()
Test addAttribute with a supplied name and value


test_TCM__OrgJdomElement_setAttributes_List

public void test_TCM__OrgJdomElement_setAttributes_List()
Test that attributes are added correctly as a list


test_TCM__OrgJdomElement_setContent_List

public void test_TCM__OrgJdomElement_setContent_List()
Test adding mixed content in a List


test_TCM__OrgJdomElement_setText_String

public void test_TCM__OrgJdomElement_setText_String()
Test setting the content of the Element with just a string This should wipe out all other content the element has


test_TCM__OrgJdomNamespace_getNamespace

public void test_TCM__OrgJdomNamespace_getNamespace()
Test that the Element returns it's primary namespace


test_TCM__OrgJdomNamespace_getNamespace_String

public void test_TCM__OrgJdomNamespace_getNamespace_String()
Test that Element can return a namespace given a uri


test_TCM__String_getAttributeValue_String

public void test_TCM__String_getAttributeValue_String()
Test getAttributeValue by attribute name.


test_TCM__String_getAttributeValue_String_OrgJdomNamespace

public void test_TCM__String_getAttributeValue_String_OrgJdomNamespace()
Test getAttributeValue with name and namespace


test_TCM__String_getChildText_String

public void test_TCM__String_getChildText_String()
Test the convience method for retrieving child text.


test_TCM__String_getChildText_String_OrgJdomNamespace

public void test_TCM__String_getChildText_String_OrgJdomNamespace()
Test the convience method for retrieving child text for a child retrieved by name and namespace


test_TCM__String_getChildTextTrim_String

public void test_TCM__String_getChildTextTrim_String()
Test the convience method for retrieving trimmed child text.


test_TCM__String_getChildTextTrim_String_OrgJdomNamespace

public void test_TCM__String_getChildTextTrim_String_OrgJdomNamespace()
Test the convience method for retrieving trimmed child text for the child in the given namespace


test_TCM__String_getName

public void test_TCM__String_getName()
Test getName.


test_TCM__String_getNamespacePrefix

public void test_TCM__String_getNamespacePrefix()
Test getNamespacePrefix.


test_TCM__String_getNamespaceURI

public void test_TCM__String_getNamespaceURI()
Test code goes here. Replace this comment.


test_TCM__String_getQualifiedName

public void test_TCM__String_getQualifiedName()
Test that Element returns the correct qualified name.


test_TCM__String_getSerializedForm

public void test_TCM__String_getSerializedForm()
Test getSerializedForm


test_TCM__String_getText

public void test_TCM__String_getText()
Test getText returns that full text of the element


test_TCM__String_getTextTrim

public void test_TCM__String_getTextTrim()
Test getTextTrim.


test_TCM__String_toString

public void test_TCM__String_toString()
Test the toString method which should return a useful string for debugging purposes only


test_TCM__void_addNamespaceDeclaration_OrgJdomNamespace

public void test_TCM__void_addNamespaceDeclaration_OrgJdomNamespace()
Test addNamespaceDeclaration for prefix and uri.


test_TCU__testAttributeNamespaces

public void test_TCU__testAttributeNamespaces()
Test that attributes will be added and retrieved according to specs. with namespaces and prefixes intact


test_TCU__testDefaultNamespaces

public void test_TCU__testDefaultNamespaces()
                                     throws java.io.IOException
Test that an Element properly handles default namespaces

Throws:
java.io.IOException

test_TCU__testSerialization

public void test_TCU__testSerialization()
                                 throws java.io.IOException,
                                        java.lang.ClassNotFoundException
Test that Element serialization works, including with namespaces

Throws:
java.io.IOException
java.lang.ClassNotFoundException

test_AddingString

public void test_AddingString()


Copyright © 2007 Brett McLaughlin, Jason Hunter. All Rights Reserved.