pl.kernelpanic.dbmonster
Class DBMonster

java.lang.Object
  extended by pl.kernelpanic.dbmonster.DBMonster

public class DBMonster
extends Object

DBMonster is a test data generation tool for SQL databases.

Version:
$Id: DBMonster.java,v 1.8 2006/01/05 16:29:37 majek Exp $
Author:
Piotr Maj <pm@jcake.com>

Field Summary
static String CONNECTION_PROVIDER_KEY
          A key under which the connection provider is stored in the DBMonsterContext.
static String DICTIONARY_MANAGER_KEY
          A key under which the dictionaries manager is stored in context.
static String LOGGER_KEY
          A key under which the logger is stored in DBMonsterContext.
static String PROGRESS_MONITOR_KEY
          A key under which progress monitor (if any) is stored in the context.
static String RANDOM_KEY
          A key under which the random number generator is stored in context.
static String TRANSACTION_SIZE_KEY
          A key under which transaction size is stored.
static String VERSION
          DBMonster's version.
 
Constructor Summary
DBMonster()
           
 
Method Summary
 void addSchema(Schema schema)
          Adds a schema.
 void doTheJob()
          Does the job. ;) Before calling this method ensure that: Connection provider is set.
 ConnectionProvider getConnectionProvider()
          Returns a connection provider used by this instance.
 Log getLogger()
          Returns logger.
 ProgressMonitor getProgressMonitor()
          Returns the progress monitor.
static String getVersion()
          Returns the version.
 void setConnectionProvider(ConnectionProvider cp)
          Sets a connection provider.
 void setLogger(Log log)
          Sets a logger for this DBMonster instance.
 void setPostScript(File postScript)
           
 void setPreScript(File preScript)
           
 void setProgressMonitor(ProgressMonitor monitor)
          Sets the progress monitor.
 void setProperties(Properties props)
          Sets the properties.
 void setTransactionSize(int transactionSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
DBMonster's version.

See Also:
Constant Field Values

LOGGER_KEY

public static final String LOGGER_KEY
A key under which the logger is stored in DBMonsterContext.

See Also:
Constant Field Values

CONNECTION_PROVIDER_KEY

public static final String CONNECTION_PROVIDER_KEY
A key under which the connection provider is stored in the DBMonsterContext.

See Also:
Constant Field Values

DICTIONARY_MANAGER_KEY

public static final String DICTIONARY_MANAGER_KEY
A key under which the dictionaries manager is stored in context.

See Also:
Constant Field Values

RANDOM_KEY

public static final String RANDOM_KEY
A key under which the random number generator is stored in context.

See Also:
Constant Field Values

PROGRESS_MONITOR_KEY

public static final String PROGRESS_MONITOR_KEY
A key under which progress monitor (if any) is stored in the context.

See Also:
Constant Field Values

TRANSACTION_SIZE_KEY

public static final String TRANSACTION_SIZE_KEY
A key under which transaction size is stored.

See Also:
Constant Field Values
Constructor Detail

DBMonster

public DBMonster()
Method Detail

getConnectionProvider

public ConnectionProvider getConnectionProvider()
Returns a connection provider used by this instance.

Returns:
connection provider

setConnectionProvider

public void setConnectionProvider(ConnectionProvider cp)
Sets a connection provider.

Parameters:
cp - a connection provider

addSchema

public void addSchema(Schema schema)
               throws Exception
Adds a schema.

Parameters:
schema - a schema to add.
Throws:
Exception - if schema with the same name already exists

setLogger

public void setLogger(Log log)
Sets a logger for this DBMonster instance.

Parameters:
log - a logger

getLogger

public Log getLogger()
Returns logger.

Returns:
a logger.

setProperties

public void setProperties(Properties props)
Sets the properties.

Parameters:
props - the properties

doTheJob

public void doTheJob()
              throws Exception
Does the job. ;) Before calling this method ensure that:
  1. Connection provider is set.
  2. Progress monitor (if any) is set.
  3. Valid schemas are added.

Throws:
Exception - on errors.

getVersion

public static final String getVersion()
Returns the version.

Returns:
version

getProgressMonitor

public ProgressMonitor getProgressMonitor()
Returns the progress monitor.

Returns:
progress monitor.

setProgressMonitor

public void setProgressMonitor(ProgressMonitor monitor)
Sets the progress monitor.

Parameters:
monitor - progress monitor.

setPostScript

public void setPostScript(File postScript)

setPreScript

public void setPreScript(File preScript)

setTransactionSize

public void setTransactionSize(int transactionSize)


Copyright © 2003-2006 .:. kernelpanic.pl .:.. All Rights Reserved.