com.sun.jini.compat.harness
Class Config

java.lang.Object
  extended bycom.sun.jini.compat.harness.Config

public class Config
extends java.lang.Object

This class processes and holds the configuration information for all the tests being run. The Runner generates a single Config and passes it to each test using the setConfig method on Test. This class provides the InstrumentedClassServer, the SysConfig and the BasicAdmin for the current run of the LDJ Kit. It also sets up the codebase and the security manager when it is constructed.


Field Summary
static int ALL
          Debug Level that prints extra information throughout the run.
static int ERROR
          Debug Level that prints extra information when something unexpected happens.
static int NONE
          Debug Level that prints no extra information.
 
Constructor Summary
Config(java.lang.String pfn, InstrumentedClassServer classServer, java.io.PrintWriter log)
          Constructor for the Config class.
Config(java.lang.String pfn, java.io.PrintWriter log)
          Constructor for the Config class.
 
Method Summary
 BasicAdmin getAdmin()
          Method returns the admin for this run of the LDJ Kit.
 InstrumentedClassServer getClassServer()
          Method returns the class server for this run of the LDJ Kit.
 int getDebugLevel()
          Returns the current debug level of the LDJ Kit.
 int getFailureTime()
          Returns the Failure Time value from SysConfig.
 java.io.PrintWriter getLog()
          Returns the log PrintWriter for this run of the LDJ Kit.
 int getQuietTime()
          Returns the Quiet Time value.
 SysConfig getSysConfig()
          Method returns the SysConfig for this run of the LDJ Kit.
 boolean isOfficial()
          Returns whether this is an official run or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Debug Level that prints no extra information.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Debug Level that prints extra information when something unexpected happens.

See Also:
Constant Field Values

ALL

public static final int ALL
Debug Level that prints extra information throughout the run.

See Also:
Constant Field Values
Constructor Detail

Config

public Config(java.lang.String pfn,
              InstrumentedClassServer classServer,
              java.io.PrintWriter log)
       throws java.lang.Exception
Constructor for the Config class. It does all the precalculations necessary to provide configuration information.

Parameters:
pfn - the path/filename of the config property file
classServer - a reference to a currently running InstrumentedClassServer
log - an instance of java.io.PrintWriter through which all test output is written

Config

public Config(java.lang.String pfn,
              java.io.PrintWriter log)
       throws java.lang.Exception
Constructor for the Config class. It does precalculations necessary to provide configuration information but does not specify a class server nor does it set the Quiet Time needed by the LDJ Kit.

Parameters:
pfn - the path/filename of the config property file
log - an instance of java.io.PrintWriter through which all test output is written
Method Detail

getClassServer

public InstrumentedClassServer getClassServer()
Method returns the class server for this run of the LDJ Kit.

Returns:
the class server

getSysConfig

public SysConfig getSysConfig()
Method returns the SysConfig for this run of the LDJ Kit. It is used by tests to get access to the LDJ Kit property file.

Returns:
the SysConfig

getAdmin

public BasicAdmin getAdmin()
Method returns the admin for this run of the LDJ Kit. Depending on the program being tested this method will return different subclasses of BasicAdmin.

Returns:
the admin

getQuietTime

public int getQuietTime()
Returns the Quiet Time value. This is the value used for "negative" tests (when nothing should happen in a time interval). If the property com.sun.jini.compat.unofficialQuietTime is set, then its value is used. If this value is less than the official Quiet Time, then the run of the LDJ Kit is unofficial (used for testing/debugging purposes only).

Returns:
the Quite Time duration in milliseconds

getFailureTime

public int getFailureTime()
Returns the Failure Time value from SysConfig. This value is used to limit the time it takes for something to fail. It indicated the length of time you are willing to wait before you accept that the action is not going to happen.

Returns:
the Failure Time duration in milliseconds

getLog

public java.io.PrintWriter getLog()
Returns the log PrintWriter for this run of the LDJ Kit.

Returns:
the log PrintWriter

getDebugLevel

public int getDebugLevel()
Returns the current debug level of the LDJ Kit. Currently there are three debug levels:

The debug level is obtained from the property: com.sun.jini.compat.debugLevel

Returns:
the debug level

isOfficial

public boolean isOfficial()
Returns whether this is an official run or not.

Returns:
true if this is an official run


Copyright 2005, Sun Microsystems, Inc.
Licensed under the Apache License, Version 2.0.