Jetif v1.8.0

jetif
Class Suite

java.lang.Object
  extended byjetif.Suite
Direct Known Subclasses:
BasicSuite

public abstract class Suite
extends Object

This class Suite allows users to setup and cleanup environment for the whole suite, and provides information and reference of the test object. A user defined suite class should extends this class and implements the createTestCase(String, String) at least.

Author:
Vicky Wang
See Also:
BasicSuite

Field Summary
protected  Logger logger
          The logger object of this suite.
protected  String name
          The name of this suite.
protected  Properties props
          The properties of this suite.
 
Constructor Summary
Suite()
          A custom suite class should implements a default constructor without any parameter.
 
Method Summary
protected  void cleanup(boolean flag)
          Clean up the testing environment for this suite.
protected  TestCase createTestCase(String name, String uid)
          Create a test case for testing.
protected  List createTestCases(String name, String uid)
          Create test cases for testing.
 String getName()
          Returns the name of this suite.
static Suite newSuite(String className)
          Create a new suite instance from specified class name.
protected  boolean setup()
          Set up the testing environment for this suite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name
The name of this suite. This member variable is not available during construction.


props

protected Properties props
The properties of this suite. Be careful to modify this properties because other parts may refer to this properties. This member variable is not available during construction.


logger

protected Logger logger
The logger object of this suite. This memeber variable allows custom code use the logging mechanism.

Constructor Detail

Suite

public Suite()
A custom suite class should implements a default constructor without any parameter. The framework will call only the default constructor to create suite instance.

Method Detail

newSuite

public static Suite newSuite(String className)
                      throws CreateSuiteException
Create a new suite instance from specified class name. The class should be inherited from jetif.Suite.

Parameters:
className - the name of the class.
Returns:
the suite instance.
Throws:
CreateSuiteException - if error occurs when create the suite instance.

getName

public String getName()
Returns the name of this suite.

Returns:
the name

setup

protected boolean setup()
Set up the testing environment for this suite. The framework will skip the whole suite if the return value is false.

Returns:
true if setup is completed successfully.

createTestCase

protected TestCase createTestCase(String name,
                                  String uid)
                           throws FrameworkException
Create a test case for testing. The implementation should provides a test case object to run the test case.

Parameters:
name - the name of the test case.
uid - the UID of the test case.
Returns:
a test case object.
Throws:
FrameworkException

createTestCases

protected List createTestCases(String name,
                               String uid)
                        throws FrameworkException
Create test cases for testing. The implementation should provides at least one test case instance in the list to run testing.

Parameters:
name - the name of the test case from spec.
uid - the UID of the test case from spec.
Returns:
a list of test cases (each element should be of type TestCase);
Throws:
FrameworkException

cleanup

protected void cleanup(boolean flag)
Clean up the testing environment for this suite.

Parameters:
flag - the return value of setup() method.

Jetif v1.8.0

Copyright © 2004,2005 Vicky Wang - All Rights Reserved.