positron.harness
Class DatabaseFixture

java.lang.Object
  extended by positron.harness.DatabaseFixture

public class DatabaseFixture
extends Object


Constructor Summary
DatabaseFixture(Instrumentation instrumentation)
           
 
Method Summary
 void backup()
          Backup all databases in the target context.
 void backup(String database)
          Back up the given database by copying its defining file out of the way.
 void execSql(String database, int... scriptsAsRawResources)
          Execute Sql scripts loaded from a raw resources.
 void restore()
          Restore all databases that have backups in the target context.
 void restore(String database)
          Restore the given database by copying the backup file back in place.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseFixture

public DatabaseFixture(Instrumentation instrumentation)
Method Detail

backup

public void backup()
Backup all databases in the target context.


restore

public void restore()
Restore all databases that have backups in the target context.


backup

public void backup(String database)
Back up the given database by copying its defining file out of the way. This blows away any previous backup.

Parameters:
database - The database to back up.

restore

public void restore(String database)
Restore the given database by copying the backup file back in place.

Parameters:
database - The database to restore.

execSql

public void execSql(String database,
                    int... scriptsAsRawResources)
Execute Sql scripts loaded from a raw resources.

Parameters:
database - The database to execute the sql.
scriptsAsRawResources - A varargs of R.raw.XXX resource ids of scripts to execute.