org.castor.xmlctf

Class SchemaTestCase


public class SchemaTestCase
extends XMLTestCase

A JUnit test case for testing the Castor Schema Object Model.
Version:
$Revision: 6787 $ $Date: 2006-04-26 15:14:53 -0600 (Wed, 26 Apr 2006) $
Authors:
Keith Visco
Arnaud Blandin

Field Summary

protected String
_goldFileName
Gold file to compare a schema against.

Fields inherited from class org.castor.xmlctf.XMLTestCase

_configuration, _failure, _hasDump, _listener, _listenerGoldFile, _listenerType, _mapping, _name, _outputRootFile, _printStack, _rootClass, _rootClassName, _skip, _suiteName, _test, _unitTest, _verbose

Constructor Summary

SchemaTestCase(String name)
Default constructor
SchemaTestCase(CastorTestCase castorTc, UnitTestCase tc)
Creates a new SchemaTest with the given name

Method Summary

void
runTest()
Override this method to run the test and assert its state.
void
setSchemaName(String name)
Sets the name of the XML schema file to test.
protected void
setUp()
static Test
suite()
protected void
tearDown()
Cleans up after this unit test (nothing to do except provide output).

Methods inherited from class org.castor.xmlctf.XMLTestCase

buildObjectModel, checkExceptionWasExpected, cleanup, getTestSuiteName, getXMLContext, initializeListeners, invokeEnumeratedMethods, setTestSuiteName, setUp, setXMLContext, tearDown, testMarshal, testUnmarshal, testUnmarshal, verbose

Field Details

_goldFileName

protected final String _goldFileName
Gold file to compare a schema against. Optional. Only needed if schema changes during parsing, i.e., due to redefine element.

Constructor Details

SchemaTestCase

public SchemaTestCase(String name)
Default constructor
Parameters:
name - the name of the test

SchemaTestCase

public SchemaTestCase(CastorTestCase castorTc,
                      UnitTestCase tc)
Creates a new SchemaTest with the given name
Parameters:
castorTc - the reference to the jar/directory
tc - the UnitTestCase that wraps the configuration for this XML Test case.

Method Details

runTest

public void runTest()
            throws Throwable
Override this method to run the test and assert its state.

setSchemaName

public void setSchemaName(String name)
Sets the name of the XML schema file to test.
Parameters:
name - the name of the XML schema file to test.

setUp

protected void setUp()
            throws Exception
Overrides:
setUp in interface XMLTestCase

suite

public static Test suite()

tearDown

protected void tearDown()
            throws Exception
Cleans up after this unit test (nothing to do except provide output).
Overrides:
tearDown in interface XMLTestCase

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com