XBRLAPI

A Java API for XBRL


org.xbrlapi.utilities
Class BaseTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.xbrlapi.utilities.BaseTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
BaseTestCase, DOMLoadingTestCase

public abstract class BaseTestCase
extends junit.framework.TestCase

Provides a base test case for all tests in the XBRL API test suite. This package provides some base testcase classes that extend in useful ways on the JUnit base test case. Te XMLBase subclass helps with tests related to XML.

Author:
Geoffrey Shuetrim (geoff@galexy.net)

Field Summary
protected  String baseURI
          Base URI for test data
protected  String cachePath
          Absolute path to the local document cache
protected  Properties configuration
           
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
BaseTestCase(String arg0)
          Base test case constructor loads the test suite configuration properties.
 
Method Summary
 void assessCustomEquality(Object object, Object copy)
          Tests if the object and the copy are equal and have the same hash code.
protected  Object getDeepCopy(Object object)
           
 URI getURI(String property)
           
 void serialize(Node what)
          Serializes an XML fragment to the output stream.
protected  void setUp()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, 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
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

configuration

protected Properties configuration

cachePath

protected String cachePath
Absolute path to the local document cache


baseURI

protected String baseURI
Base URI for test data

Constructor Detail

BaseTestCase

public BaseTestCase(String arg0)
Base test case constructor loads the test suite configuration properties. The test configuration information must be available in a properties file. If the System property "xbrlapi.test.configuration" is set equal to the location of a test configuration properties file, then that file will be used. Otherwise the constructor will attempt to locate a file called test.configuration.properties in the working directory that the tests are being executed from.

Parameters:
arg0 -
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

getURI

public URI getURI(String property)
Parameters:
property - determining the URI of the test data
Returns:
the absolute URI of the test data

serialize

public void serialize(Node what)
               throws IOException,
                      XBRLException
Serializes an XML fragment to the output stream.

Parameters:
what - The DOM Document or Element node to use as the root for the XML fragment to serialize.
Throws:
XBRLException - if the node is not a document or element node.
IOException - if the serialization IO operation fails.

getDeepCopy

protected Object getDeepCopy(Object object)
                      throws IOException,
                             ClassNotFoundException
Parameters:
object - The object to create a deep copy of.
Returns:
the deep copy of the object, obtained via serialization.
Throws:
IOException
ClassNotFoundException

assessCustomEquality

public final void assessCustomEquality(Object object,
                                       Object copy)
                                throws Exception
Tests if the object and the copy are equal and have the same hash code.

Parameters:
object - The object to use.
copy - The supposed deep copy of the object.
Throws:
Exception

Get Java XBRL API implementation at SourceForge.net. Fast, secure and Free Open Source software downloads