|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.contrib.dbwriter.DbWatcherTester
public class DbWatcherTester
This application writes into the 'replitems' table (which is the table used for replication) in an own thread. Everytime a commit (or a rollback) is done, it waits until the dbwatcher part has become the new entries. It then compares the sent entries with the entries which the DBWatcher has detected. It compares number of messages and sequence of them.
You can edit this file and change the configuration settings.
Simple usage example:
java org.xmlBlaster.contrib.dbwriter.Example -db.password secret
java -Djava.util.logging.config.file=testlog.properties org.xmlBlaster.contrib.dbwriter.Example -db.password secret
Field Summary | |
---|---|
private boolean |
commitCheck
|
private int |
compareCount
|
private int |
compareNmax
|
private I_DbPool |
dbPool
|
private boolean |
exceptionOccured
|
private I_Info |
info
|
private static java.util.logging.Logger |
log
|
private int |
nmax
|
private java.util.List |
operations
|
private java.util.Random |
random
|
private long |
seed
|
private long |
sleep
|
Constructor Summary | |
---|---|
DbWatcherTester(I_Info info)
|
Method Summary | |
---|---|
private void |
assertEquals(java.lang.String msg,
int val1,
int val2)
|
private void |
assertEquals(java.lang.String msg,
java.lang.String val1,
java.lang.String val2)
|
private void |
checkConsistency(java.sql.Connection conn,
java.lang.String tableName,
long timeToSleep)
|
private void |
checkReplItems(java.sql.Connection conn)
|
private void |
commit(java.sql.Connection conn)
|
private int |
doDelete(java.sql.Connection conn)
|
private int |
doInsert(java.sql.Connection conn)
|
private int |
doUpdate(java.sql.Connection conn)
|
private java.lang.String |
getEmail()
|
private java.lang.String |
getName()
|
private java.lang.String |
getPhoto()
|
private java.lang.String |
getSurname()
|
private java.lang.String |
getTable()
|
private int |
getUniqueId()
|
private java.lang.String |
getWhere()
|
static java.util.prefs.Preferences |
loadArgs(java.lang.String[] args)
Parse command line arguments |
static void |
main(java.lang.String[] args)
Example code. |
void |
run()
|
private int |
update(java.sql.Connection conn,
java.lang.String sql)
|
static void |
usage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.logging.Logger log
private I_DbPool dbPool
private I_Info info
private java.util.Random random
private int nmax
private long sleep
private int compareNmax
private int compareCount
private long seed
private java.util.List operations
private boolean commitCheck
private boolean exceptionOccured
Constructor Detail |
---|
public DbWatcherTester(I_Info info) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public static void usage()
private int getUniqueId()
private java.lang.String getName()
private java.lang.String getSurname()
private java.lang.String getEmail()
private java.lang.String getPhoto()
private java.lang.String getTable()
private java.lang.String getWhere()
private int update(java.sql.Connection conn, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
private int doInsert(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private int doDelete(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private int doUpdate(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private void assertEquals(java.lang.String msg, java.lang.String val1, java.lang.String val2) throws java.lang.Exception
java.lang.Exception
private void assertEquals(java.lang.String msg, int val1, int val2) throws java.lang.Exception
java.lang.Exception
private void checkConsistency(java.sql.Connection conn, java.lang.String tableName, long timeToSleep) throws java.lang.Exception
java.lang.Exception
private void checkReplItems(java.sql.Connection conn) throws java.lang.Exception
java.lang.Exception
private void commit(java.sql.Connection conn)
public void run()
public static void main(java.lang.String[] args)
args
- Command linepublic static java.util.prefs.Preferences loadArgs(java.lang.String[] args)
args
- Command line
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |