Jetif v1.8.0

jetif
Class Framework

java.lang.Object
  extended byjetif.Framework

public class Framework
extends Object

This Framework class contains several methods to access the environment properties of the Jetif framework and the logger object.

Author:
Vicky Wang

Field Summary
static String LOGGER_TYPE
          The property name of the log type: jetif.log.
static String OUTPUT_DIRECTORY
          The property name of the output directory: jetif.output.dir.
static String PROXY_AGENT_URI
          The property name of proxy agent URI.
static String TEST_CLASS_PATH
          The property name of extra class path for Jetif: jetif.class.path.
 
Method Summary
static void cleanup()
          Cleanup the Jetif framework environment.
static SpecLoader createSpecLoader(String type)
          Create a spec loader instance according specified type.
static ClassLoader getClassLoader()
          Returns the class loader for testing.
static Logger getLogger()
          Returns the logger of this framework.
static String getMessage(String id)
          Get a localized message from resource bundle.
static Properties getProperties()
          Returns Jetif framework properties.
static String getProperty(String key)
          Returns a property of Jetif framework
static String getProperty(String key, String defaultValue)
          Returns a property of Jetif framework.
static void init(Properties props)
          Initialize the Jetif framework object with a properties object.
static void setProperty(String key, String value)
          Set property of Jetif framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER_TYPE

public static final String LOGGER_TYPE
The property name of the log type: jetif.log.

See Also:
Constant Field Values

OUTPUT_DIRECTORY

public static final String OUTPUT_DIRECTORY
The property name of the output directory: jetif.output.dir.
All results and log will be generated under this directory by default.

See Also:
Constant Field Values

TEST_CLASS_PATH

public static final String TEST_CLASS_PATH
The property name of extra class path for Jetif: jetif.class.path.
The Jetif will try to load suite, case and test classes from this class path when the class can't be find in default class path.

See Also:
Constant Field Values

PROXY_AGENT_URI

public static final String PROXY_AGENT_URI
The property name of proxy agent URI. The proxy agent URI may be various since it will be interpreted by proxy implementation.
For Socket proxy, the URI will be IP address and port number of proxy agent. e.g.
jetif.proxy.agent.uri = localhost:8000
For EJB proxy, the URI will be the JNDI name of the proxy agent. e.g.
jetif.proxy.agent.uri = jetif/proxy/EJBProxyAgent
For IDL proxy, the URI should be the CORBA object name of the proxy agent. e.g.
jetif.proxy.agent.uri = _jetif_proxyAgent.

See Also:
Constant Field Values
Method Detail

init

public static void init(Properties props)
                 throws FrameworkException
Initialize the Jetif framework object with a properties object. The properties object may contains following property values:
 jetif.log           The logger type, can be "none", "text" or "log4j".
 jetif.output.dir    The output directory of results, logs.
 jetif.class.path    The classpath used to load test classes.
 jetif.listener.type  The result listener type, can be "text", "xml" or "html".
 jetif.listener.date.format    The date format for test listener recording.
 
Below properties will be applicable if the jetif.log is set to "text".
 jetif.log.file      The log file name.
 jetif.log.encoding  The log encoding.
 
Below property will be applicable if the jetif.log is set to "log4j".
 log4j.configuration The configuration file for Log4J.
 

Parameters:
props - the environment properties of the framework.
Throws:
FrameworkException

cleanup

public static void cleanup()
Cleanup the Jetif framework environment. Close logger, and do other necessary clean up works.


setProperty

public static void setProperty(String key,
                               String value)
Set property of Jetif framework.

Parameters:
key - the key of the property
value - the value of the property

getProperty

public static String getProperty(String key)
Returns a property of Jetif framework

Parameters:
key - the key of the property
Returns:
the value of the property, null if the specified property not found.

getProperty

public static String getProperty(String key,
                                 String defaultValue)
Returns a property of Jetif framework.

Parameters:
key - the key of the property
defaultValue - the default value of the property
Returns:
the value of the property, default value if the specified property not found.

getProperties

public static Properties getProperties()
Returns Jetif framework properties.

Returns:
the properties of the framework.

getLogger

public static Logger getLogger()
Returns the logger of this framework.

Returns:
the logger instance.

createSpecLoader

public static SpecLoader createSpecLoader(String type)
Create a spec loader instance according specified type.

Parameters:
type - the spec loader type
Returns:
A spec loader instance.

getClassLoader

public static ClassLoader getClassLoader()
Returns the class loader for testing.

Returns:
the test class loader.

getMessage

public static String getMessage(String id)
Get a localized message from resource bundle.

Parameters:
id - the message id.
Returns:
the message.

Jetif v1.8.0

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