org.apache.ddlutils.util
Class DatabaseTestHelper

java.lang.Object
  extended by junit.framework.Assert
      extended by org.apache.ddlutils.util.DatabaseTestHelper

public class DatabaseTestHelper
extends junit.framework.Assert

Class that provides utility stuff for cpmaring data in databases.

Version:
$Revision: 264616 $

Constructor Summary
DatabaseTestHelper()
           
 
Method Summary
 void assertHasSameData(Database model, Platform origDbPlatform, Platform testedDbPlatform)
          Asserts that the data in the tables described by the given model is the same in the database accessed by the second platform as is in the database accessed by the first platform.
 void assertHasSameData(String failureMsg, Database model, Platform origDbPlatform, Platform testedDbPlatform)
          Asserts that the data in the tables described by the given model is the same in the database accessed by the second platform as is in the database accessed by the first platform.
 
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, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseTestHelper

public DatabaseTestHelper()
Method Detail

assertHasSameData

public void assertHasSameData(Database model,
                              Platform origDbPlatform,
                              Platform testedDbPlatform)
Asserts that the data in the tables described by the given model is the same in the database accessed by the second platform as is in the database accessed by the first platform. Note that it is not tested whether the second database has more data.
All differences will be printed via logging in DEBUG level.

Parameters:
model - The database model to check
origDbPlatform - The first platform
testedDbPlatform - The second platform

assertHasSameData

public void assertHasSameData(String failureMsg,
                              Database model,
                              Platform origDbPlatform,
                              Platform testedDbPlatform)
Asserts that the data in the tables described by the given model is the same in the database accessed by the second platform as is in the database accessed by the first platform. Note that it is not tested whether the second database has more data.
All differences will be printed via logging in DEBUG level.

Parameters:
failureMsg - The failure message to issue if the data is not the same
model - The database model to check
origDbPlatform - The first platform
testedDbPlatform - The second platform


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.