Extension SDK

oracle.jdeveloper.junit
Interface TestCase

All Known Subinterfaces:
ClassTestCase, SuiteTestCase

public interface TestCase

The TestCase interface defines the common set of functions that a Jdeveloper TestCase generator will implement. A TestCase generater gets added to a Testsuite. It's responsible for installing itself into the TestSuite. The common operation for installing itself is to generate the proper lines into the TestSuite's suite() method. The TestCase also need to make sure that it invokes the installToTestCase() method for each test fixture .


Method Summary
 void addTestFixture(TestFixture newFixture)
          Adds a TestFixture to this TestCase.
 void addTestMethod(JotMethod method)
          Adds a method to be tested.
 void addToSuiteMethod(TestCaseContainer suite, JotMethod method)
          This method is called by the TestSuite to give the TestCase the opportunity to install itself into the TestSuite's suite() method.
 void commitChanges()
          This method cause all the code generation to be committed to the source file.
 JotClass getJotClass()
          Returns the JotClass that has been generated for this TestCase.
 java.lang.String getName()
          Name to be used for the TestCase.
 JProject getProject()
          Returns the JProject that will contain the newly generated TestCase.
 

Method Detail

addToSuiteMethod

public void addToSuiteMethod(TestCaseContainer suite,
                             JotMethod method)
This method is called by the TestSuite to give the TestCase the opportunity to install itself into the TestSuite's suite() method. The 'method' parameter is already initialized to the TestSuite's suite() method.


getName

public java.lang.String getName()
Name to be used for the TestCase. In most cases this will be the TestCase's class name.


addTestFixture

public void addTestFixture(TestFixture newFixture)
Adds a TestFixture to this TestCase. The TestCase should collect all the TestFixtures and then call installToTestCase() during the TestCase's commitChanges() method.


getProject

public JProject getProject()
Returns the JProject that will contain the newly generated TestCase.


getJotClass

public JotClass getJotClass()
Returns the JotClass that has been generated for this TestCase. API users can use this to further specialize the TestCase by adding imports, generating methods,...


commitChanges

public void commitChanges()
This method cause all the code generation to be committed to the source file.


addTestMethod

public void addTestMethod(JotMethod method)
Adds a method to be tested. This means that a test_ method will be added to the JotClass for each method that is added to the TestCase.


Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.