org.jdom.test.cases
Class TestAttribute

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

public final class TestAttribute
extends junit.framework.TestCase

Test the expected behavior of the Attribute class.

Version:
0.1
Author:
unascribed

Constructor Summary
TestAttribute(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_TCC___String_String_OrgJdomNamespace()
          Test the constructor with name, value and namespace
 void test_TCC___String_String()
          Test the simple case of constructing an attribute without namespace or prefix
 void test_TCC()
          Test the simple case of constructing an attribute without name, value, namespace or prefix
 void test_TCM___detach()
          Test that the detach() function works according to the JDOM spec.
 void test_TCM__Attribute_setAttributeType_int()
          Test possible attribute values
 void test_TCM__boolean_equals_Object()
          Test a simple object comparison
 void test_TCM__boolean_getBooleanValue()
          test the convienience method getBooleanValue();
 void test_TCM__double_getDoubleValue()
          Test convience method for getting doubles from an Attribute
 void test_TCM__float_getFloatValue()
          Test floats returned from Attribute values.
 void test_TCM__int_getIntValue()
          Tests that Attribute can convert value strings to ints and that is raises DataConversionException if it is not an int.
 void test_TCM__int_hashCode()
          Test that Attribute returns a valid hashcode.
 void test_TCM__long_getLongValue()
          Test the convienience method for returning a long from an Attribute
 void test_TCM__Object_clone()
          Test that an Attribute can clone itself correctly.
 void test_TCM__OrgJdomAttribute_setValue_String()
          Test that setting an Attribute's value works correctly.
 void test_TCM__OrgJdomDocument_getDocument()
          check that the attribute can return the correct document
 void test_TCM__OrgJdomElement_getParent()
          check that the attribute can return the correct parent element
 void test_TCM__OrgJdomNamespace_getNamespace()
          Test that an independantly created Namespace and one retrieved from an Attribute create with the same namespace parameters are the same namespace.
 void test_TCM__String_getName()
          Test that an Attribute returns it's correct name.
 void test_TCM__String_getNamespacePrefix()
          Test that an Attribute returns the correct Namespace prefix.
 void test_TCM__String_getNamespaceURI()
          Test that an Attribute returns the correct Namespace URI.
 void test_TCM__String_getQualifiedName()
          Tests that an Attribute returns the correct Qualified Name.
 void test_TCM__String_getSerializedForm()
          Test that Attribute returns the correct serialized form.
 void test_TCM__String_getValue()
          Test that an Attribute returns the correct value.
 void test_TCM__String_toString()
          Test that the toString function works according to the JDOM spec.
 void testInfinity()
           
 void testSerialization()
           
 
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

TestAttribute

public TestAttribute(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

public void test_TCC()
Test the simple case of constructing an attribute without name, value, namespace or prefix


test_TCC___String_String

public void test_TCC___String_String()
Test the simple case of constructing an attribute without namespace or prefix


test_TCC___String_String_OrgJdomNamespace

public void test_TCC___String_String_OrgJdomNamespace()
Test the constructor with name, value and namespace


test_TCM__Attribute_setAttributeType_int

public void test_TCM__Attribute_setAttributeType_int()
Test possible attribute values


test_TCM__boolean_equals_Object

public void test_TCM__boolean_equals_Object()
Test a simple object comparison


test_TCM__boolean_getBooleanValue

public void test_TCM__boolean_getBooleanValue()
test the convienience method getBooleanValue();


test_TCM__double_getDoubleValue

public void test_TCM__double_getDoubleValue()
Test convience method for getting doubles from an Attribute


test_TCM__float_getFloatValue

public void test_TCM__float_getFloatValue()
Test floats returned from Attribute values. Checks that both correctly formatted (java style) and incorrectly formatted float strings are returned or raise a DataConversionException


test_TCM__int_getIntValue

public void test_TCM__int_getIntValue()
Tests that Attribute can convert value strings to ints and that is raises DataConversionException if it is not an int.


test_TCM__int_hashCode

public void test_TCM__int_hashCode()
Test that Attribute returns a valid hashcode.


test_TCM__long_getLongValue

public void test_TCM__long_getLongValue()
Test the convienience method for returning a long from an Attribute


test_TCM__Object_clone

public void test_TCM__Object_clone()
Test that an Attribute can clone itself correctly. The test covers the simple case and with the attribute using a namespace and prefix.


test_TCM__OrgJdomAttribute_setValue_String

public void test_TCM__OrgJdomAttribute_setValue_String()
Test that setting an Attribute's value works correctly.


test_TCM__OrgJdomElement_getParent

public void test_TCM__OrgJdomElement_getParent()
check that the attribute can return the correct parent element


test_TCM__OrgJdomDocument_getDocument

public void test_TCM__OrgJdomDocument_getDocument()
check that the attribute can return the correct document


test_TCM__OrgJdomNamespace_getNamespace

public void test_TCM__OrgJdomNamespace_getNamespace()
Test that an independantly created Namespace and one retrieved from an Attribute create with the same namespace parameters are the same namespace.


test_TCM__String_getName

public void test_TCM__String_getName()
Test that an Attribute returns it's correct name.


test_TCM__String_getNamespacePrefix

public void test_TCM__String_getNamespacePrefix()
Test that an Attribute returns the correct Namespace prefix.


test_TCM__String_getNamespaceURI

public void test_TCM__String_getNamespaceURI()
Test that an Attribute returns the correct Namespace URI.


test_TCM__String_getQualifiedName

public void test_TCM__String_getQualifiedName()
Tests that an Attribute returns the correct Qualified Name.


test_TCM__String_getSerializedForm

public void test_TCM__String_getSerializedForm()
Test that Attribute returns the correct serialized form.


test_TCM__String_getValue

public void test_TCM__String_getValue()
Test that an Attribute returns the correct value.


test_TCM__String_toString

public void test_TCM__String_toString()
Test that the toString function works according to the JDOM spec.


test_TCM___detach

public void test_TCM___detach()
Test that the detach() function works according to the JDOM spec.

See Also:
Attribute.detach()

testSerialization

public void testSerialization()

testInfinity

public void testInfinity()
                  throws org.jdom.DataConversionException
Throws:
org.jdom.DataConversionException


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