package org.apache.testlet;

/**
 */
public abstract class DecoratorTestCase
    implements TestCase
{
    private String m_name;
    private TestCase m_testCase;

    public DecoratorTestCase( final TestCase testCase )
    {
        this( null, testCase );
    }

    public DecoratorTestCase( final String name, final TestCase testCase )
    {
        m_name = name;
        m_testCase = testCase;
    }

    public String getName()
    {
        if ( null == m_name ) return m_testCase.getName();
        return m_name;
    }

    public void runTest()
        throws Throwable
    {
        m_testCase.runTest();
    }
}
