org.apache.ojb.broker.sqlcount
Class AbstractCountTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.ojb.broker.sqlcount.AbstractCountTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
CollectionCountTest, EmptyCacheCountTest, SimpleCountTest, TwoLevelSimpleTest

public abstract class AbstractCountTest
extends junit.framework.TestCase

provides methods to count the number statements.

Version:
$Id: AbstractCountTest.java,v 1.3 2003/11/10 12:55:40 oliverm Exp $
Author:
Oliver Matz

Field Summary
protected  Logger logger
           
 
Constructor Summary
AbstractCountTest()
           
 
Method Summary
protected  void assertStmtCount(java.lang.String msg, int expected)
          assert that the number of statements issued since the last call of resetStmtCount().
protected  void assertStmtCount(java.lang.String msg, int minExpected, int maxExpected)
          assert that the number of statements issued since the last call of resetStmtCount().
protected  void checkP6spyEnabled(PBKey pbKey)
          fail ifF the specified PersistenceBroker does not use P6Spy.
protected  void logStmtCount(java.lang.String msg)
           
protected  void resetStmtCount()
          start count SQL statements
protected  void setUp()
          sets the spy.properties file name.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final Logger logger
Constructor Detail

AbstractCountTest

public AbstractCountTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
sets the spy.properties file name.

Throws:
java.lang.Exception

resetStmtCount

protected final void resetStmtCount()
start count SQL statements


assertStmtCount

protected final void assertStmtCount(java.lang.String msg,
                                     int minExpected,
                                     int maxExpected)
assert that the number of statements issued since the last call of resetStmtCount(). is between two specified numbers.

Parameters:
msg - short description of the actions since the last call of resetStmtCount().

assertStmtCount

protected final void assertStmtCount(java.lang.String msg,
                                     int expected)
assert that the number of statements issued since the last call of resetStmtCount(). is equal to a specified number.

Parameters:
msg - short description of the actions since the last call of resetStmtCount().

logStmtCount

protected final void logStmtCount(java.lang.String msg)

checkP6spyEnabled

protected final void checkP6spyEnabled(PBKey pbKey)
fail ifF the specified PersistenceBroker does not use P6Spy.



Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14