ozone core API

org.ozoneDB.test
Class OzoneTestRunner

java.lang.Object
  |
  +--junit.runner.BaseTestRunner
        |
        +--org.ozoneDB.test.OzoneTestRunner
All Implemented Interfaces:
junit.framework.TestListener

public class OzoneTestRunner
extends junit.runner.BaseTestRunner

OzoneTestRunner is the JUnit test runner for Ozone environment.

Version:
$Revision: 1.2 $Date: 2001/12/30 16:57:49 $
Author:
SMB
, David Li

Field Summary
private  org.ozoneDB.ExternalDatabase fDatabase
          The database
private  java.lang.String fDBHost
          database server hostname
private  int fDBPort
          database server port
private  boolean fDebug
          whether to do debugging print out.
private  boolean fIsLocal
          whether to use local database
private  boolean fIsRemote
          whether to use remote database
private  java.io.File fLocalTestDir
          default dir to create test database
private static org.apache.log4j.Category fLog
          log4j logger
private  java.lang.String fTestSuite
          name of the test suite to run
private static junit.runner.TestSuiteLoader fTestSuiteLoader
          The test class loader for the runner.
 
Fields inherited from class junit.runner.BaseTestRunner
SUITE_METHODNAME
 
Constructor Summary
private OzoneTestRunner(java.lang.String[] args)
          Constructor
 
Method Summary
 void addError(junit.framework.Test test, java.lang.Throwable t)
           
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
           
private  junit.framework.TestResult doRun()
          run the test suite
 void endTest(junit.framework.Test test)
           
 junit.runner.TestSuiteLoader getLoader()
          overrideing this method from BaseTestRunner is necessary because of the default behavior of getLoader creates new classloader everytime it's called.
private  void initDB(java.lang.String dbURL)
          initialize the database
private  void initLocalDB()
          initialize a local database if one doesn't exists, create it.
private  void initRemoteDB(java.lang.String host, int port)
          Initialize a remote database.
static void main(java.lang.String[] args)
          main
private static void printUsage()
          Print the usage of the program
protected  void runFailed(java.lang.String message)
           
private  void setUpDatabase()
          set up the database
 void startTest(junit.framework.Test test)
           
 
Methods inherited from class junit.runner.BaseTestRunner
clearStatus, elapsedTimeAsString, extractClassName, filterStack, getFilteredTrace, getPreference, getPreference, getTest, inVAJava, loadSuiteClass, processArguments, setLoading, truncate, useReloadingTestSuiteLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fLog

private static org.apache.log4j.Category fLog
log4j logger


fDatabase

private org.ozoneDB.ExternalDatabase fDatabase
The database


fIsRemote

private boolean fIsRemote
whether to use remote database


fIsLocal

private boolean fIsLocal
whether to use local database


fDebug

private boolean fDebug
whether to do debugging print out.


fDBHost

private java.lang.String fDBHost
database server hostname


fDBPort

private int fDBPort
database server port


fLocalTestDir

private java.io.File fLocalTestDir
default dir to create test database


fTestSuite

private java.lang.String fTestSuite
name of the test suite to run


fTestSuiteLoader

private static junit.runner.TestSuiteLoader fTestSuiteLoader
The test class loader for the runner.

Constructor Detail

OzoneTestRunner

private OzoneTestRunner(java.lang.String[] args)
Constructor

Method Detail

printUsage

private static void printUsage()
Print the usage of the program


initDB

private void initDB(java.lang.String dbURL)
             throws java.lang.Exception
initialize the database

Parameters:
dbURL - the database url
java.lang.Exception

initRemoteDB

private void initRemoteDB(java.lang.String host,
                          int port)
                   throws java.lang.Exception
Initialize a remote database.

Parameters:
host - hostname of the database machine
port - port number of the db server
java.lang.Exception

getLoader

public junit.runner.TestSuiteLoader getLoader()
overrideing this method from BaseTestRunner is necessary because of the default behavior of getLoader creates new classloader everytime it's called. This cause problem with Ozone.

Overrides:
getLoader in class junit.runner.BaseTestRunner

initLocalDB

private void initLocalDB()
                  throws java.lang.Exception
initialize a local database if one doesn't exists, create it.

java.lang.Exception

setUpDatabase

private void setUpDatabase()
                    throws java.lang.Exception
set up the database

java.lang.Exception

doRun

private junit.framework.TestResult doRun()
                                  throws java.lang.Exception
run the test suite

java.lang.Exception

main

public static void main(java.lang.String[] args)
main


runFailed

protected void runFailed(java.lang.String message)
Specified by:
runFailed in class junit.runner.BaseTestRunner

addError

public void addError(junit.framework.Test test,
                     java.lang.Throwable t)
Specified by:
addError in interface junit.framework.TestListener
Specified by:
addError in class junit.runner.BaseTestRunner

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
Specified by:
addFailure in interface junit.framework.TestListener
Specified by:
addFailure in class junit.runner.BaseTestRunner

endTest

public void endTest(junit.framework.Test test)
Specified by:
endTest in interface junit.framework.TestListener
Specified by:
endTest in class junit.runner.BaseTestRunner

startTest

public void startTest(junit.framework.Test test)
Specified by:
startTest in interface junit.framework.TestListener
Specified by:
startTest in class junit.runner.BaseTestRunner

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.