aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests/InventoryTests.cs
diff options
context:
space:
mode:
authorAlexRa2010-05-17 15:54:43 +0300
committerAlexRa2010-05-23 11:47:39 +0300
commit7f70ae0ebd686507bc15ac6fc7eeb75ed0b9b64a (patch)
tree8e9893cf02218f72888d5cdb12f8bb8a21cc5698 /OpenSim/Data/Tests/InventoryTests.cs
parentAdded generic base classes for testing database services (diff)
downloadopensim-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/InventoryTests.cs (renamed from OpenSim/Data/Tests/BasicInventoryTest.cs)94
1 files changed, 51 insertions, 43 deletions
diff --git a/OpenSim/Data/Tests/BasicInventoryTest.cs b/OpenSim/Data/Tests/InventoryTests.cs
index 900186b..876dcf9 100644
--- a/OpenSim/Data/Tests/BasicInventoryTest.cs
+++ b/OpenSim/Data/Tests/InventoryTests.cs
@@ -33,62 +33,70 @@ using OpenMetaverse;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using log4net; 34using log4net;
35using System.Reflection; 35using System.Reflection;
36using System.Data.Common;
37
38// DBMS-specific:
39using MySql.Data.MySqlClient;
40using OpenSim.Data.MySQL;
41
42using System.Data.SqlClient;
43using OpenSim.Data.MSSQL;
44
45using Mono.Data.Sqlite;
46using OpenSim.Data.SQLite;
36 47
37namespace OpenSim.Data.Tests 48namespace OpenSim.Data.Tests
38{ 49{
39 public class BasicInventoryTest 50 [TestFixture(typeof(MySqlConnection), typeof(MySQLInventoryData), Description = "Inventory store tests (MySQL)")]
51 [TestFixture(typeof(SqlConnection), typeof(MSSQLInventoryData), Description = "Inventory store tests (MS SQL Server)")]
52 [TestFixture(typeof(SqliteConnection), typeof(SQLiteInventoryStore), Description = "Inventory store tests (SQLite)")]
53
54 public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore>
55 where TConn : DbConnection, new()
56 where TInvStore : class, IInventoryDataPlugin, new()
40 { 57 {
41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 public IInventoryDataPlugin db; 58 public IInventoryDataPlugin db;
59
43 public UUID zero = UUID.Zero; 60 public UUID zero = UUID.Zero;
44 61
45 public UUID folder1; 62 public UUID folder1 = UUID.Random();
46 public UUID folder2; 63 public UUID folder2 = UUID.Random();
47 public UUID folder3; 64 public UUID folder3 = UUID.Random();
48 public UUID owner1; 65 public UUID owner1 = UUID.Random();
49 public UUID owner2; 66 public UUID owner2 = UUID.Random();
50 public UUID owner3; 67 public UUID owner3 = UUID.Random();
51 68
52 public UUID item1; 69 public UUID item1 = UUID.Random();
53 public UUID item2; 70 public UUID item2 = UUID.Random();
54 public UUID item3; 71 public UUID item3 = UUID.Random();
55 public UUID asset1; 72 public UUID asset1 = UUID.Random();
56 public UUID asset2; 73 public UUID asset2 = UUID.Random();
57 public UUID asset3; 74 public UUID asset3 = UUID.Random();
58 75
59 public string name1; 76 public string name1;
60 public string name2; 77 public string name2 = "First Level folder";
61 public string name3; 78 public string name3 = "First Level folder 2";
62 public string niname1; 79 public string niname1 = "My Shirt";
63 public string iname1; 80 public string iname1 = "Shirt";
64 public string iname2; 81 public string iname2 = "Text Board";
65 public string iname3; 82 public string iname3 = "No Pants Barrel";
66 83
67 public void SuperInit() 84 public InventoryTests(string conn) : base(conn)
68 { 85 {
69 OpenSim.Tests.Common.TestLogging.LogToConsole();
70
71 folder1 = UUID.Random();
72 folder2 = UUID.Random();
73 folder3 = UUID.Random();
74 owner1 = UUID.Random();
75 owner2 = UUID.Random();
76 owner3 = UUID.Random();
77 item1 = UUID.Random();
78 item2 = UUID.Random();
79 item3 = UUID.Random();
80 asset1 = UUID.Random();
81 asset2 = UUID.Random();
82 asset3 = UUID.Random();
83
84 name1 = "Root Folder for " + owner1.ToString(); 86 name1 = "Root Folder for " + owner1.ToString();
85 name2 = "First Level folder"; 87 }
86 name3 = "First Level folder 2";
87 niname1 = "My Shirt";
88 iname1 = "Shirt";
89 iname2 = "Text Board";
90 iname3 = "No Pants Barrel";
91 88
89 protected override void InitService(object service)
90 {
91 db = (IInventoryDataPlugin)service;
92 db.Initialise(m_connStr);
93 ClearDB();
94 }
95
96 private void ClearDB()
97 {
98 DropTables("inventoryitems", "inventoryfolders");
99 ExecuteSql("delete from migrations where name='Inventory'");
92 } 100 }
93 101
94 [Test] 102 [Test]