org.castor.xmlctf

Class TestWithRandomObject


(package private) class TestWithRandomObject
extends TestCase

Implements a test case that tests code written by the XML source generator. This class uses the generated source to write a randomly generated XML element to a file.

The test follows this sequence:

  1. Instantiates a random object model using the randomize function.
  2. Marshals it to a file.
  3. Unmarshals the created file.
  4. Check that the result object is equal to the start object.
Version:
$Revision: 0000 $ $Date: $
Authors:
Sebastien Gignoux
Arnaud Blandin
Edward Kuns

Field Summary

protected FailureType
_failure
The failure object that is not null is the test intends to fail.
protected String
_outputName
File name of our marshaled output.

Constructor Summary

TestWithRandomObject(String name)
Blank constructor for this test case.
TestWithRandomObject(String name, XMLTestCase tc)
Constructs a test case that when invoked will delegate to the provided test case.

Method Summary

void
runTest()
Runs our test case using our delegate object where necessary.
protected void
setUp()
Provides setup for our delegated test case, depending on the type of test case we are delegating for.
protected void
tearDown()
Provides tear down for our delegated test case, depending on the type of test case we are delegating for.

Field Details

_failure

protected final FailureType _failure
The failure object that is not null is the test intends to fail.

_outputName

protected final String _outputName
File name of our marshaled output.

Constructor Details

TestWithRandomObject

(package private)  TestWithRandomObject(String name)
Blank constructor for this test case. This contructor is not useful, since no delegate test case is provided
Parameters:
name - Name of our delegate test case

TestWithRandomObject

(package private)  TestWithRandomObject(String name,
                                        XMLTestCase tc)
Constructs a test case that when invoked will delegate to the provided test case.
Parameters:
name - Name of our delegate test case
tc -

Method Details

runTest

public void runTest()
            throws Exception
Runs our test case using our delegate object where necessary.

setUp

protected void setUp()
            throws Exception
Provides setup for our delegated test case, depending on the type of test case we are delegating for.

tearDown

protected void tearDown()
            throws Exception
Provides tear down for our delegated test case, depending on the type of test case we are delegating for.

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