OpenSim
|
This is a base class for testing any Data service for any DBMS. Requires NUnit 2.5 or better (to support the generics). More...
Public Member Functions | |
BasicDataServiceTest () | |
BasicDataServiceTest (string conn) | |
void | Init () |
void | Cleanup () |
Protected Member Functions | |
virtual void | InitService (object service) |
To be overridden in derived classes. Do whatever init with the m_service, like setting the conn string to it. You'd probably want to to cast the 'service' to a more specific type and store it in a member var. This framework takes care of disposing it, if it's disposable. More... | |
virtual DbConnection | Connect () |
virtual void | ExecuteSql (string sql) |
delegate bool | ProcessRow (IDataReader reader) |
virtual int | ExecQuery (string sql, bool bSingleRow, ProcessRow action) |
virtual void | DropTables (params string[] tables) |
Drop tables (listed as parameters). There is no "DROP IF EXISTS" syntax common for all databases, so we just DROP and ignore an exception. More... | |
virtual void | ResetMigrations (params string[] stores) |
Clear tables listed as parameters (without dropping them). More... | |
virtual void | ClearTables (params string[] tables) |
Clear tables listed as parameters (without dropping them). More... | |
Protected Attributes | |
string | m_connStr |
ILog | m_log |
This is a base class for testing any Data service for any DBMS. Requires NUnit 2.5 or better (to support the generics).
FIXME: Should extend OpenSimTestCase but compile on mono 2.4.3 currently fails with AssetTests2 : System.MemberAccessException : Cannot create an instance of OpenSim.Data.Tests.AssetTests
2[TConn,TAssetData] because Type.ContainsGenericParameters is true. and similar on EstateTests, InventoryTests and RegionTests. Runs fine with mono 2.10.8.1, so easiest thing is to wait until min Mono version uplifts.
TConn | |
TService |
TConn | : | DbConnection | |
TConn | : | new() | |
TService | : | class | |
TService | : | new() |
Definition at line 55 of file BasicDataServiceTest.cs.
|
inline |
Definition at line 69 of file BasicDataServiceTest.cs.
|
inline |
Definition at line 74 of file BasicDataServiceTest.cs.
|
inline |
Definition at line 154 of file BasicDataServiceTest.cs.
|
inlineprotectedvirtual |
Clear tables listed as parameters (without dropping them).
tables |
Definition at line 257 of file BasicDataServiceTest.cs.
|
inlineprotectedvirtual |
Definition at line 167 of file BasicDataServiceTest.cs.
|
inlineprotectedvirtual |
Drop tables (listed as parameters). There is no "DROP IF EXISTS" syntax common for all databases, so we just DROP and ignore an exception.
tables |
Definition at line 216 of file BasicDataServiceTest.cs.
|
inlineprotectedvirtual |
Definition at line 189 of file BasicDataServiceTest.cs.
|
inlineprotectedvirtual |
Definition at line 175 of file BasicDataServiceTest.cs.
|
inline |
Definition at line 93 of file BasicDataServiceTest.cs.
|
inlineprotectedvirtual |
To be overridden in derived classes. Do whatever init with the m_service, like setting the conn string to it. You'd probably want to to cast the 'service' to a more specific type and store it in a member var. This framework takes care of disposing it, if it's disposable.
service | The service being tested |
Reimplemented in OpenSim.Data.Tests.RegionTests< TConn, TRegStore >, OpenSim.Data.Tests.InventoryTests< TConn, TInvStore >, OpenSim.Data.Tests.AssetTests< TConn, TAssetData >, and OpenSim.Data.Tests.EstateTests< TConn, TEstateStore >.
Definition at line 88 of file BasicDataServiceTest.cs.
|
protected |
|
inlineprotectedvirtual |
Clear tables listed as parameters (without dropping them).
tables |
Definition at line 232 of file BasicDataServiceTest.cs.
|
protected |
Definition at line 59 of file BasicDataServiceTest.cs.
|
protected |
Definition at line 67 of file BasicDataServiceTest.cs.