diff options
author | AlexRa | 2010-05-17 15:54:43 +0300 |
---|---|---|
committer | AlexRa | 2010-05-23 11:47:39 +0300 |
commit | 7f70ae0ebd686507bc15ac6fc7eeb75ed0b9b64a (patch) | |
tree | 8e9893cf02218f72888d5cdb12f8bb8a21cc5698 /OpenSim/Data/Tests/EstateTests.cs | |
parent | Added generic base classes for testing database services (diff) | |
download | opensim-SC-7f70ae0ebd686507bc15ac6fc7eeb75ed0b9b64a.zip opensim-SC-7f70ae0ebd686507bc15ac6fc7eeb75ed0b9b64a.tar.gz opensim-SC-7f70ae0ebd686507bc15ac6fc7eeb75ed0b9b64a.tar.bz2 opensim-SC-7f70ae0ebd686507bc15ac6fc7eeb75ed0b9b64a.tar.xz |
All data tests made DBMS-independent
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/Tests/EstateTests.cs (renamed from OpenSim/Data/Tests/BasicEstateTest.cs) | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/OpenSim/Data/Tests/BasicEstateTest.cs b/OpenSim/Data/Tests/EstateTests.cs index d14d405..7f13925 100644 --- a/OpenSim/Data/Tests/BasicEstateTest.cs +++ b/OpenSim/Data/Tests/EstateTests.cs | |||
@@ -35,13 +35,31 @@ using OpenSim.Region.Framework.Interfaces; | |||
35 | using System.Text; | 35 | using System.Text; |
36 | using log4net; | 36 | using log4net; |
37 | using System.Reflection; | 37 | using System.Reflection; |
38 | using System.Data.Common; | ||
39 | |||
40 | |||
41 | // DBMS-specific: | ||
42 | using MySql.Data.MySqlClient; | ||
43 | using OpenSim.Data.MySQL; | ||
44 | |||
45 | using System.Data.SqlClient; | ||
46 | using OpenSim.Data.MSSQL; | ||
47 | |||
48 | using Mono.Data.Sqlite; | ||
49 | using OpenSim.Data.SQLite; | ||
50 | |||
38 | 51 | ||
39 | namespace OpenSim.Data.Tests | 52 | namespace OpenSim.Data.Tests |
40 | { | 53 | { |
41 | public class BasicEstateTest | 54 | [TestFixture(typeof(MySqlConnection), typeof(MySQLEstateStore), Description = "Estate store tests (MySQL)")] |
55 | [TestFixture(typeof(SqlConnection), typeof(MSSQLEstateStore), Description = "Estate store tests (MS SQL Server)")] | ||
56 | [TestFixture(typeof(SqliteConnection), typeof(SQLiteEstateStore), Description = "Estate store tests (SQLite)")] | ||
57 | |||
58 | public class EstateTests<TConn, TEstateStore> : BasicDataServiceTest<TConn, TEstateStore> | ||
59 | where TConn : DbConnection, new() | ||
60 | where TEstateStore : class, IEstateDataStore, new() | ||
42 | { | 61 | { |
43 | public IEstateDataStore db; | 62 | public IEstateDataStore db; |
44 | public IRegionDataStore regionDb; | ||
45 | 63 | ||
46 | public static UUID REGION_ID = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed7"); | 64 | public static UUID REGION_ID = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed7"); |
47 | 65 | ||
@@ -54,9 +72,34 @@ namespace OpenSim.Data.Tests | |||
54 | public static UUID GROUP_ID_1 = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed5"); | 72 | public static UUID GROUP_ID_1 = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed5"); |
55 | public static UUID GROUP_ID_2 = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed6"); | 73 | public static UUID GROUP_ID_2 = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed6"); |
56 | 74 | ||
57 | public void SuperInit() | 75 | protected override void InitService(object service) |
76 | { | ||
77 | db = (IEstateDataStore)service; | ||
78 | db.Initialise(m_connStr); | ||
79 | ClearDB(); | ||
80 | } | ||
81 | |||
82 | private void ClearDB() | ||
58 | { | 83 | { |
59 | OpenSim.Tests.Common.TestLogging.LogToConsole(); | 84 | // if a new table is added, it has to be dropped here |
85 | ExecuteSql("delete from migrations where name='EstateStore';"); | ||
86 | |||
87 | DropTables( | ||
88 | "prims", | ||
89 | "primshapes", | ||
90 | "primitems", | ||
91 | "terrain", | ||
92 | "land", | ||
93 | "landaccesslist", | ||
94 | "regionban", | ||
95 | "regionsettings", | ||
96 | "estate_managers", | ||
97 | "estate_groups", | ||
98 | "estate_users", | ||
99 | "estateban", | ||
100 | "estate_settings", | ||
101 | "estate_map" | ||
102 | ); | ||
60 | } | 103 | } |
61 | 104 | ||
62 | #region 0Tests | 105 | #region 0Tests |