diff options
Diffstat (limited to 'OpenSim/Data/Tests')
-rw-r--r-- | OpenSim/Data/Tests/AssetTests.cs | 25 | ||||
-rw-r--r-- | OpenSim/Data/Tests/EstateTests.cs | 32 | ||||
-rw-r--r-- | OpenSim/Data/Tests/InventoryTests.cs | 41 | ||||
-rw-r--r-- | OpenSim/Data/Tests/PropertyCompareConstraint.cs | 1 | ||||
-rw-r--r-- | OpenSim/Data/Tests/PropertyScrambler.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/Tests/RegionTests.cs | 99 |
6 files changed, 112 insertions, 88 deletions
diff --git a/OpenSim/Data/Tests/AssetTests.cs b/OpenSim/Data/Tests/AssetTests.cs index 800b9bf..b5ae244 100644 --- a/OpenSim/Data/Tests/AssetTests.cs +++ b/OpenSim/Data/Tests/AssetTests.cs | |||
@@ -32,13 +32,10 @@ using NUnit.Framework; | |||
32 | using NUnit.Framework.Constraints; | 32 | using NUnit.Framework.Constraints; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Tests.Common; | ||
35 | using System.Data.Common; | 36 | using System.Data.Common; |
36 | using log4net; | 37 | using log4net; |
37 | 38 | ||
38 | #if !NUNIT25 | ||
39 | using NUnit.Framework.SyntaxHelpers; | ||
40 | #endif | ||
41 | |||
42 | // DBMS-specific: | 39 | // DBMS-specific: |
43 | using MySql.Data.MySqlClient; | 40 | using MySql.Data.MySqlClient; |
44 | using OpenSim.Data.MySQL; | 41 | using OpenSim.Data.MySQL; |
@@ -51,15 +48,6 @@ using OpenSim.Data.SQLite; | |||
51 | 48 | ||
52 | namespace OpenSim.Data.Tests | 49 | namespace OpenSim.Data.Tests |
53 | { | 50 | { |
54 | |||
55 | #if NUNIT25 | ||
56 | |||
57 | [TestFixture(typeof(MySqlConnection), typeof(MySQLAssetData), Description="Basic Asset store tests (MySQL)")] | ||
58 | [TestFixture(typeof(SqlConnection), typeof(MSSQLAssetData), Description = "Basic Asset store tests (MS SQL Server)")] | ||
59 | [TestFixture(typeof(SqliteConnection), typeof(SQLiteAssetData), Description = "Basic Asset store tests (SQLite)")] | ||
60 | |||
61 | #else | ||
62 | |||
63 | [TestFixture(Description = "Asset store tests (SQLite)")] | 51 | [TestFixture(Description = "Asset store tests (SQLite)")] |
64 | public class SQLiteAssetTests : AssetTests<SqliteConnection, SQLiteAssetData> | 52 | public class SQLiteAssetTests : AssetTests<SqliteConnection, SQLiteAssetData> |
65 | { | 53 | { |
@@ -75,9 +63,6 @@ namespace OpenSim.Data.Tests | |||
75 | { | 63 | { |
76 | } | 64 | } |
77 | 65 | ||
78 | #endif | ||
79 | |||
80 | |||
81 | public class AssetTests<TConn, TAssetData> : BasicDataServiceTest<TConn, TAssetData> | 66 | public class AssetTests<TConn, TAssetData> : BasicDataServiceTest<TConn, TAssetData> |
82 | where TConn : DbConnection, new() | 67 | where TConn : DbConnection, new() |
83 | where TAssetData : AssetDataBase, new() | 68 | where TAssetData : AssetDataBase, new() |
@@ -121,6 +106,8 @@ namespace OpenSim.Data.Tests | |||
121 | [Test] | 106 | [Test] |
122 | public void T001_LoadEmpty() | 107 | public void T001_LoadEmpty() |
123 | { | 108 | { |
109 | TestHelper.InMethod(); | ||
110 | |||
124 | Assert.That(m_db.ExistsAsset(uuid1), Is.False); | 111 | Assert.That(m_db.ExistsAsset(uuid1), Is.False); |
125 | Assert.That(m_db.ExistsAsset(uuid2), Is.False); | 112 | Assert.That(m_db.ExistsAsset(uuid2), Is.False); |
126 | Assert.That(m_db.ExistsAsset(uuid3), Is.False); | 113 | Assert.That(m_db.ExistsAsset(uuid3), Is.False); |
@@ -129,6 +116,8 @@ namespace OpenSim.Data.Tests | |||
129 | [Test] | 116 | [Test] |
130 | public void T010_StoreReadVerifyAssets() | 117 | public void T010_StoreReadVerifyAssets() |
131 | { | 118 | { |
119 | TestHelper.InMethod(); | ||
120 | |||
132 | AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); | 121 | AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); |
133 | AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); | 122 | AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); |
134 | AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); | 123 | AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); |
@@ -194,6 +183,8 @@ namespace OpenSim.Data.Tests | |||
194 | [Test] | 183 | [Test] |
195 | public void T020_CheckForWeirdCreatorID() | 184 | public void T020_CheckForWeirdCreatorID() |
196 | { | 185 | { |
186 | TestHelper.InMethod(); | ||
187 | |||
197 | // It is expected that eventually the CreatorID might be an arbitrary string (an URI) | 188 | // It is expected that eventually the CreatorID might be an arbitrary string (an URI) |
198 | // rather than a valid UUID (?). This test is to make sure that the database layer does not | 189 | // rather than a valid UUID (?). This test is to make sure that the database layer does not |
199 | // attempt to convert CreatorID to GUID, but just passes it both ways as a string. | 190 | // attempt to convert CreatorID to GUID, but just passes it both ways as a string. |
@@ -218,4 +209,4 @@ namespace OpenSim.Data.Tests | |||
218 | Assert.That(a3a, Constraints.PropertyCompareConstraint(a3)); | 209 | Assert.That(a3a, Constraints.PropertyCompareConstraint(a3)); |
219 | } | 210 | } |
220 | } | 211 | } |
221 | } | 212 | } \ No newline at end of file |
diff --git a/OpenSim/Data/Tests/EstateTests.cs b/OpenSim/Data/Tests/EstateTests.cs index fbf8ba6..8d332da 100644 --- a/OpenSim/Data/Tests/EstateTests.cs +++ b/OpenSim/Data/Tests/EstateTests.cs | |||
@@ -28,10 +28,10 @@ | |||
28 | using System; | 28 | using System; |
29 | using log4net.Config; | 29 | using log4net.Config; |
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | ||
32 | using OpenMetaverse; | 31 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Tests.Common; | ||
35 | using System.Text; | 35 | using System.Text; |
36 | using log4net; | 36 | using log4net; |
37 | using System.Reflection; | 37 | using System.Reflection; |
@@ -49,15 +49,6 @@ using OpenSim.Data.SQLite; | |||
49 | 49 | ||
50 | namespace OpenSim.Data.Tests | 50 | namespace OpenSim.Data.Tests |
51 | { | 51 | { |
52 | |||
53 | #if NUNIT25 | ||
54 | |||
55 | [TestFixture(typeof(MySqlConnection), typeof(MySQLEstateStore), Description = "Estate store tests (MySQL)")] | ||
56 | [TestFixture(typeof(SqlConnection), typeof(MSSQLEstateStore), Description = "Estate store tests (MS SQL Server)")] | ||
57 | [TestFixture(typeof(SqliteConnection), typeof(SQLiteEstateStore), Description = "Estate store tests (SQLite)")] | ||
58 | |||
59 | #else | ||
60 | |||
61 | [TestFixture(Description = "Estate store tests (SQLite)")] | 52 | [TestFixture(Description = "Estate store tests (SQLite)")] |
62 | public class SQLiteEstateTests : EstateTests<SqliteConnection, SQLiteEstateStore> | 53 | public class SQLiteEstateTests : EstateTests<SqliteConnection, SQLiteEstateStore> |
63 | { | 54 | { |
@@ -73,8 +64,6 @@ namespace OpenSim.Data.Tests | |||
73 | { | 64 | { |
74 | } | 65 | } |
75 | 66 | ||
76 | #endif | ||
77 | |||
78 | public class EstateTests<TConn, TEstateStore> : BasicDataServiceTest<TConn, TEstateStore> | 67 | public class EstateTests<TConn, TEstateStore> : BasicDataServiceTest<TConn, TEstateStore> |
79 | where TConn : DbConnection, new() | 68 | where TConn : DbConnection, new() |
80 | where TEstateStore : class, IEstateDataStore, new() | 69 | where TEstateStore : class, IEstateDataStore, new() |
@@ -118,6 +107,8 @@ namespace OpenSim.Data.Tests | |||
118 | [Test] | 107 | [Test] |
119 | public void T010_EstateSettingsSimpleStorage_MinimumParameterSet() | 108 | public void T010_EstateSettingsSimpleStorage_MinimumParameterSet() |
120 | { | 109 | { |
110 | TestHelper.InMethod(); | ||
111 | |||
121 | EstateSettingsSimpleStorage( | 112 | EstateSettingsSimpleStorage( |
122 | REGION_ID, | 113 | REGION_ID, |
123 | DataTestUtil.STRING_MIN, | 114 | DataTestUtil.STRING_MIN, |
@@ -149,6 +140,8 @@ namespace OpenSim.Data.Tests | |||
149 | [Test] | 140 | [Test] |
150 | public void T011_EstateSettingsSimpleStorage_MaximumParameterSet() | 141 | public void T011_EstateSettingsSimpleStorage_MaximumParameterSet() |
151 | { | 142 | { |
143 | TestHelper.InMethod(); | ||
144 | |||
152 | EstateSettingsSimpleStorage( | 145 | EstateSettingsSimpleStorage( |
153 | REGION_ID, | 146 | REGION_ID, |
154 | DataTestUtil.STRING_MAX(64), | 147 | DataTestUtil.STRING_MAX(64), |
@@ -180,6 +173,8 @@ namespace OpenSim.Data.Tests | |||
180 | [Test] | 173 | [Test] |
181 | public void T012_EstateSettingsSimpleStorage_AccurateParameterSet() | 174 | public void T012_EstateSettingsSimpleStorage_AccurateParameterSet() |
182 | { | 175 | { |
176 | TestHelper.InMethod(); | ||
177 | |||
183 | EstateSettingsSimpleStorage( | 178 | EstateSettingsSimpleStorage( |
184 | REGION_ID, | 179 | REGION_ID, |
185 | DataTestUtil.STRING_MAX(1), | 180 | DataTestUtil.STRING_MAX(1), |
@@ -211,6 +206,8 @@ namespace OpenSim.Data.Tests | |||
211 | [Test] | 206 | [Test] |
212 | public void T012_EstateSettingsRandomStorage() | 207 | public void T012_EstateSettingsRandomStorage() |
213 | { | 208 | { |
209 | TestHelper.InMethod(); | ||
210 | |||
214 | // Letting estate store generate rows to database for us | 211 | // Letting estate store generate rows to database for us |
215 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); | 212 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); |
216 | new PropertyScrambler<EstateSettings>() | 213 | new PropertyScrambler<EstateSettings>() |
@@ -230,6 +227,8 @@ namespace OpenSim.Data.Tests | |||
230 | [Test] | 227 | [Test] |
231 | public void T020_EstateSettingsManagerList() | 228 | public void T020_EstateSettingsManagerList() |
232 | { | 229 | { |
230 | TestHelper.InMethod(); | ||
231 | |||
233 | // Letting estate store generate rows to database for us | 232 | // Letting estate store generate rows to database for us |
234 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); | 233 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); |
235 | 234 | ||
@@ -249,6 +248,8 @@ namespace OpenSim.Data.Tests | |||
249 | [Test] | 248 | [Test] |
250 | public void T021_EstateSettingsUserList() | 249 | public void T021_EstateSettingsUserList() |
251 | { | 250 | { |
251 | TestHelper.InMethod(); | ||
252 | |||
252 | // Letting estate store generate rows to database for us | 253 | // Letting estate store generate rows to database for us |
253 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); | 254 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); |
254 | 255 | ||
@@ -268,6 +269,8 @@ namespace OpenSim.Data.Tests | |||
268 | [Test] | 269 | [Test] |
269 | public void T022_EstateSettingsGroupList() | 270 | public void T022_EstateSettingsGroupList() |
270 | { | 271 | { |
272 | TestHelper.InMethod(); | ||
273 | |||
271 | // Letting estate store generate rows to database for us | 274 | // Letting estate store generate rows to database for us |
272 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); | 275 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); |
273 | 276 | ||
@@ -287,6 +290,8 @@ namespace OpenSim.Data.Tests | |||
287 | [Test] | 290 | [Test] |
288 | public void T022_EstateSettingsBanList() | 291 | public void T022_EstateSettingsBanList() |
289 | { | 292 | { |
293 | TestHelper.InMethod(); | ||
294 | |||
290 | // Letting estate store generate rows to database for us | 295 | // Letting estate store generate rows to database for us |
291 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); | 296 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); |
292 | 297 | ||
@@ -520,6 +525,5 @@ namespace OpenSim.Data.Tests | |||
520 | } | 525 | } |
521 | 526 | ||
522 | #endregion | 527 | #endregion |
523 | |||
524 | } | 528 | } |
525 | } | 529 | } \ No newline at end of file |
diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs index 9c2a2d6..cf3bac1 100644 --- a/OpenSim/Data/Tests/InventoryTests.cs +++ b/OpenSim/Data/Tests/InventoryTests.cs | |||
@@ -25,14 +25,12 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | // #define NUNIT25 | ||
29 | |||
30 | using System; | 28 | using System; |
31 | using log4net.Config; | 29 | using log4net.Config; |
32 | using NUnit.Framework; | 30 | using NUnit.Framework; |
33 | using NUnit.Framework.SyntaxHelpers; | ||
34 | using OpenMetaverse; | 31 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Tests.Common; | ||
36 | using log4net; | 34 | using log4net; |
37 | using System.Reflection; | 35 | using System.Reflection; |
38 | using System.Data.Common; | 36 | using System.Data.Common; |
@@ -49,14 +47,6 @@ using OpenSim.Data.SQLite; | |||
49 | 47 | ||
50 | namespace OpenSim.Data.Tests | 48 | namespace OpenSim.Data.Tests |
51 | { | 49 | { |
52 | #if NUNIT25 | ||
53 | |||
54 | [TestFixture(typeof(SqliteConnection), typeof(SQLiteInventoryStore), Description = "Inventory store tests (SQLite)")] | ||
55 | [TestFixture(typeof(MySqlConnection), typeof(MySQLInventoryData), Description = "Inventory store tests (MySQL)")] | ||
56 | [TestFixture(typeof(SqlConnection), typeof(MSSQLInventoryData), Description = "Inventory store tests (MS SQL Server)")] | ||
57 | |||
58 | #else | ||
59 | |||
60 | [TestFixture(Description = "Inventory store tests (SQLite)")] | 50 | [TestFixture(Description = "Inventory store tests (SQLite)")] |
61 | public class SQLiteInventoryTests : InventoryTests<SqliteConnection, SQLiteInventoryStore> | 51 | public class SQLiteInventoryTests : InventoryTests<SqliteConnection, SQLiteInventoryStore> |
62 | { | 52 | { |
@@ -71,7 +61,6 @@ namespace OpenSim.Data.Tests | |||
71 | public class MSSQLInventoryTests : InventoryTests<SqlConnection, MSSQLInventoryData> | 61 | public class MSSQLInventoryTests : InventoryTests<SqlConnection, MSSQLInventoryData> |
72 | { | 62 | { |
73 | } | 63 | } |
74 | #endif | ||
75 | 64 | ||
76 | public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore> | 65 | public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore> |
77 | where TConn : DbConnection, new() | 66 | where TConn : DbConnection, new() |
@@ -125,6 +114,8 @@ namespace OpenSim.Data.Tests | |||
125 | [Test] | 114 | [Test] |
126 | public void T001_LoadEmpty() | 115 | public void T001_LoadEmpty() |
127 | { | 116 | { |
117 | TestHelper.InMethod(); | ||
118 | |||
128 | Assert.That(db.getInventoryFolder(zero), Is.Null); | 119 | Assert.That(db.getInventoryFolder(zero), Is.Null); |
129 | Assert.That(db.getInventoryFolder(folder1), Is.Null); | 120 | Assert.That(db.getInventoryFolder(folder1), Is.Null); |
130 | Assert.That(db.getInventoryFolder(folder2), Is.Null); | 121 | Assert.That(db.getInventoryFolder(folder2), Is.Null); |
@@ -143,6 +134,8 @@ namespace OpenSim.Data.Tests | |||
143 | [Test] | 134 | [Test] |
144 | public void T010_FolderNonParent() | 135 | public void T010_FolderNonParent() |
145 | { | 136 | { |
137 | TestHelper.InMethod(); | ||
138 | |||
146 | InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2); | 139 | InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2); |
147 | // the folder will go in | 140 | // the folder will go in |
148 | db.addInventoryFolder(f1); | 141 | db.addInventoryFolder(f1); |
@@ -153,6 +146,8 @@ namespace OpenSim.Data.Tests | |||
153 | [Test] | 146 | [Test] |
154 | public void T011_FolderCreate() | 147 | public void T011_FolderCreate() |
155 | { | 148 | { |
149 | TestHelper.InMethod(); | ||
150 | |||
156 | InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1); | 151 | InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1); |
157 | // TODO: this is probably wrong behavior, but is what we have | 152 | // TODO: this is probably wrong behavior, but is what we have |
158 | // db.updateInventoryFolder(f1); | 153 | // db.updateInventoryFolder(f1); |
@@ -165,7 +160,7 @@ namespace OpenSim.Data.Tests | |||
165 | db.addInventoryFolder(f1); | 160 | db.addInventoryFolder(f1); |
166 | InventoryFolderBase f1a = db.getUserRootFolder(owner1); | 161 | InventoryFolderBase f1a = db.getUserRootFolder(owner1); |
167 | Assert.That(folder1, Is.EqualTo(f1a.ID), "Assert.That(folder1, Is.EqualTo(f1a.ID))"); | 162 | Assert.That(folder1, Is.EqualTo(f1a.ID), "Assert.That(folder1, Is.EqualTo(f1a.ID))"); |
168 | Assert.That(name1, Text.Matches(f1a.Name), "Assert.That(name1, Text.Matches(f1a.Name))"); | 163 | Assert.That(name1, Is.StringMatching(f1a.Name), "Assert.That(name1, Text.Matches(f1a.Name))"); |
169 | } | 164 | } |
170 | 165 | ||
171 | // we now have the following tree | 166 | // we now have the following tree |
@@ -176,6 +171,8 @@ namespace OpenSim.Data.Tests | |||
176 | [Test] | 171 | [Test] |
177 | public void T012_FolderList() | 172 | public void T012_FolderList() |
178 | { | 173 | { |
174 | TestHelper.InMethod(); | ||
175 | |||
179 | InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3); | 176 | InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3); |
180 | db.addInventoryFolder(f2); | 177 | db.addInventoryFolder(f2); |
181 | 178 | ||
@@ -190,6 +187,8 @@ namespace OpenSim.Data.Tests | |||
190 | [Test] | 187 | [Test] |
191 | public void T013_FolderHierarchy() | 188 | public void T013_FolderHierarchy() |
192 | { | 189 | { |
190 | TestHelper.InMethod(); | ||
191 | |||
193 | int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned) | 192 | int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned) |
194 | Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); | 193 | Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); |
195 | n = db.getFolderHierarchy(folder1).Count; | 194 | n = db.getFolderHierarchy(folder1).Count; |
@@ -203,6 +202,8 @@ namespace OpenSim.Data.Tests | |||
203 | [Test] | 202 | [Test] |
204 | public void T014_MoveFolder() | 203 | public void T014_MoveFolder() |
205 | { | 204 | { |
205 | TestHelper.InMethod(); | ||
206 | |||
206 | InventoryFolderBase f2 = db.getInventoryFolder(folder2); | 207 | InventoryFolderBase f2 = db.getInventoryFolder(folder2); |
207 | f2.ParentID = folder3; | 208 | f2.ParentID = folder3; |
208 | db.moveInventoryFolder(f2); | 209 | db.moveInventoryFolder(f2); |
@@ -217,6 +218,8 @@ namespace OpenSim.Data.Tests | |||
217 | [Test] | 218 | [Test] |
218 | public void T015_FolderHierarchy() | 219 | public void T015_FolderHierarchy() |
219 | { | 220 | { |
221 | TestHelper.InMethod(); | ||
222 | |||
220 | Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); | 223 | Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); |
221 | Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))"); | 224 | Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))"); |
222 | Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))"); | 225 | Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))"); |
@@ -228,6 +231,8 @@ namespace OpenSim.Data.Tests | |||
228 | [Test] | 231 | [Test] |
229 | public void T100_NoItems() | 232 | public void T100_NoItems() |
230 | { | 233 | { |
234 | TestHelper.InMethod(); | ||
235 | |||
231 | Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); | 236 | Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); |
232 | Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))"); | 237 | Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))"); |
233 | Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))"); | 238 | Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))"); |
@@ -240,6 +245,8 @@ namespace OpenSim.Data.Tests | |||
240 | [Test] | 245 | [Test] |
241 | public void T101_CreatItems() | 246 | public void T101_CreatItems() |
242 | { | 247 | { |
248 | TestHelper.InMethod(); | ||
249 | |||
243 | db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); | 250 | db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); |
244 | db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2)); | 251 | db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2)); |
245 | db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); | 252 | db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); |
@@ -249,6 +256,8 @@ namespace OpenSim.Data.Tests | |||
249 | [Test] | 256 | [Test] |
250 | public void T102_CompareItems() | 257 | public void T102_CompareItems() |
251 | { | 258 | { |
259 | TestHelper.InMethod(); | ||
260 | |||
252 | InventoryItemBase i1 = db.getInventoryItem(item1); | 261 | InventoryItemBase i1 = db.getInventoryItem(item1); |
253 | InventoryItemBase i2 = db.getInventoryItem(item2); | 262 | InventoryItemBase i2 = db.getInventoryItem(item2); |
254 | InventoryItemBase i3 = db.getInventoryItem(item3); | 263 | InventoryItemBase i3 = db.getInventoryItem(item3); |
@@ -266,6 +275,8 @@ namespace OpenSim.Data.Tests | |||
266 | [Test] | 275 | [Test] |
267 | public void T103_UpdateItem() | 276 | public void T103_UpdateItem() |
268 | { | 277 | { |
278 | TestHelper.InMethod(); | ||
279 | |||
269 | // TODO: probably shouldn't have the ability to have an | 280 | // TODO: probably shouldn't have the ability to have an |
270 | // owner of an item in a folder not owned by the user | 281 | // owner of an item in a folder not owned by the user |
271 | 282 | ||
@@ -284,6 +295,8 @@ namespace OpenSim.Data.Tests | |||
284 | [Test] | 295 | [Test] |
285 | public void T104_RandomUpdateItem() | 296 | public void T104_RandomUpdateItem() |
286 | { | 297 | { |
298 | TestHelper.InMethod(); | ||
299 | |||
287 | PropertyScrambler<InventoryFolderBase> folderScrambler = | 300 | PropertyScrambler<InventoryFolderBase> folderScrambler = |
288 | new PropertyScrambler<InventoryFolderBase>() | 301 | new PropertyScrambler<InventoryFolderBase>() |
289 | .DontScramble(x => x.Owner) | 302 | .DontScramble(x => x.Owner) |
@@ -341,6 +354,8 @@ namespace OpenSim.Data.Tests | |||
341 | [Test] | 354 | [Test] |
342 | public void T999_StillNull() | 355 | public void T999_StillNull() |
343 | { | 356 | { |
357 | TestHelper.InMethod(); | ||
358 | |||
344 | // After all tests are run, these should still return no results | 359 | // After all tests are run, these should still return no results |
345 | Assert.That(db.getInventoryFolder(zero), Is.Null); | 360 | Assert.That(db.getInventoryFolder(zero), Is.Null); |
346 | Assert.That(db.getInventoryItem(zero), Is.Null); | 361 | Assert.That(db.getInventoryItem(zero), Is.Null); |
diff --git a/OpenSim/Data/Tests/PropertyCompareConstraint.cs b/OpenSim/Data/Tests/PropertyCompareConstraint.cs index f3d41df..6c79bda 100644 --- a/OpenSim/Data/Tests/PropertyCompareConstraint.cs +++ b/OpenSim/Data/Tests/PropertyCompareConstraint.cs | |||
@@ -34,7 +34,6 @@ using System.Linq.Expressions; | |||
34 | using System.Reflection; | 34 | using System.Reflection; |
35 | using NUnit.Framework; | 35 | using NUnit.Framework; |
36 | using NUnit.Framework.Constraints; | 36 | using NUnit.Framework.Constraints; |
37 | using NUnit.Framework.SyntaxHelpers; | ||
38 | using OpenMetaverse; | 37 | using OpenMetaverse; |
39 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
40 | 39 | ||
diff --git a/OpenSim/Data/Tests/PropertyScrambler.cs b/OpenSim/Data/Tests/PropertyScrambler.cs index 132294a..c5d40c2 100644 --- a/OpenSim/Data/Tests/PropertyScrambler.cs +++ b/OpenSim/Data/Tests/PropertyScrambler.cs | |||
@@ -32,13 +32,11 @@ using System.Linq.Expressions; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Text; | 33 | using System.Text; |
34 | using NUnit.Framework; | 34 | using NUnit.Framework; |
35 | using NUnit.Framework.SyntaxHelpers; | ||
36 | using OpenMetaverse; | 35 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
38 | 37 | ||
39 | namespace OpenSim.Data.Tests | 38 | namespace OpenSim.Data.Tests |
40 | { | 39 | { |
41 | |||
42 | //This is generic so that the lambda expressions will work right in IDEs. | 40 | //This is generic so that the lambda expressions will work right in IDEs. |
43 | public class PropertyScrambler<T> | 41 | public class PropertyScrambler<T> |
44 | { | 42 | { |
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs index 23d498d..44cf1ab 100644 --- a/OpenSim/Data/Tests/RegionTests.cs +++ b/OpenSim/Data/Tests/RegionTests.cs | |||
@@ -31,11 +31,11 @@ using System.Drawing; | |||
31 | using System.Text; | 31 | using System.Text; |
32 | using log4net.Config; | 32 | using log4net.Config; |
33 | using NUnit.Framework; | 33 | using NUnit.Framework; |
34 | using NUnit.Framework.SyntaxHelpers; | ||
35 | using OpenMetaverse; | 34 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
37 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Tests.Common; | ||
39 | using log4net; | 39 | using log4net; |
40 | using System.Reflection; | 40 | using System.Reflection; |
41 | using System.Data.Common; | 41 | using System.Data.Common; |
@@ -52,14 +52,6 @@ using OpenSim.Data.SQLite; | |||
52 | 52 | ||
53 | namespace OpenSim.Data.Tests | 53 | namespace OpenSim.Data.Tests |
54 | { | 54 | { |
55 | #if NUNIT25 | ||
56 | |||
57 | [TestFixture(typeof(SqliteConnection), typeof(SQLiteRegionData), Description = "Region store tests (SQLite)")] | ||
58 | [TestFixture(typeof(MySqlConnection), typeof(MySqlRegionData), Description = "Region store tests (MySQL)")] | ||
59 | [TestFixture(typeof(SqlConnection), typeof(MSSQLRegionData), Description = "Region store tests (MS SQL Server)")] | ||
60 | |||
61 | #else | ||
62 | |||
63 | [TestFixture(Description = "Region store tests (SQLite)")] | 55 | [TestFixture(Description = "Region store tests (SQLite)")] |
64 | public class SQLiteRegionTests : RegionTests<SqliteConnection, SQLiteSimulationData> | 56 | public class SQLiteRegionTests : RegionTests<SqliteConnection, SQLiteSimulationData> |
65 | { | 57 | { |
@@ -75,8 +67,6 @@ namespace OpenSim.Data.Tests | |||
75 | { | 67 | { |
76 | } | 68 | } |
77 | 69 | ||
78 | #endif | ||
79 | |||
80 | public class RegionTests<TConn, TRegStore> : BasicDataServiceTest<TConn, TRegStore> | 70 | public class RegionTests<TConn, TRegStore> : BasicDataServiceTest<TConn, TRegStore> |
81 | where TConn : DbConnection, new() | 71 | where TConn : DbConnection, new() |
82 | where TRegStore : class, ISimulationDataStore, new() | 72 | where TRegStore : class, ISimulationDataStore, new() |
@@ -131,15 +121,18 @@ namespace OpenSim.Data.Tests | |||
131 | string[] reg_tables = new string[] { | 121 | string[] reg_tables = new string[] { |
132 | "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings" | 122 | "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings" |
133 | }; | 123 | }; |
124 | |||
134 | if (m_rebuildDB) | 125 | if (m_rebuildDB) |
135 | { | 126 | { |
136 | DropTables(reg_tables); | 127 | DropTables(reg_tables); |
137 | ResetMigrations("RegionStore"); | 128 | ResetMigrations("RegionStore"); |
138 | }else | 129 | } |
130 | else | ||
131 | { | ||
139 | ClearTables(reg_tables); | 132 | ClearTables(reg_tables); |
133 | } | ||
140 | } | 134 | } |
141 | 135 | ||
142 | |||
143 | // Test Plan | 136 | // Test Plan |
144 | // Prims | 137 | // Prims |
145 | // - empty test - 001 | 138 | // - empty test - 001 |
@@ -158,6 +151,8 @@ namespace OpenSim.Data.Tests | |||
158 | [Test] | 151 | [Test] |
159 | public void T001_LoadEmpty() | 152 | public void T001_LoadEmpty() |
160 | { | 153 | { |
154 | TestHelper.InMethod(); | ||
155 | |||
161 | List<SceneObjectGroup> objs = db.LoadObjects(region1); | 156 | List<SceneObjectGroup> objs = db.LoadObjects(region1); |
162 | List<SceneObjectGroup> objs3 = db.LoadObjects(region3); | 157 | List<SceneObjectGroup> objs3 = db.LoadObjects(region3); |
163 | List<LandData> land = db.LoadLandObjects(region1); | 158 | List<LandData> land = db.LoadLandObjects(region1); |
@@ -174,6 +169,8 @@ namespace OpenSim.Data.Tests | |||
174 | [Test] | 169 | [Test] |
175 | public void T010_StoreSimpleObject() | 170 | public void T010_StoreSimpleObject() |
176 | { | 171 | { |
172 | TestHelper.InMethod(); | ||
173 | |||
177 | SceneObjectGroup sog = NewSOG("object1", prim1, region1); | 174 | SceneObjectGroup sog = NewSOG("object1", prim1, region1); |
178 | SceneObjectGroup sog2 = NewSOG("object2", prim2, region1); | 175 | SceneObjectGroup sog2 = NewSOG("object2", prim2, region1); |
179 | 176 | ||
@@ -207,6 +204,8 @@ namespace OpenSim.Data.Tests | |||
207 | [Test] | 204 | [Test] |
208 | public void T011_ObjectNames() | 205 | public void T011_ObjectNames() |
209 | { | 206 | { |
207 | TestHelper.InMethod(); | ||
208 | |||
210 | List<SceneObjectGroup> objs = db.LoadObjects(region1); | 209 | List<SceneObjectGroup> objs = db.LoadObjects(region1); |
211 | foreach (SceneObjectGroup sog in objs) | 210 | foreach (SceneObjectGroup sog in objs) |
212 | { | 211 | { |
@@ -219,6 +218,8 @@ namespace OpenSim.Data.Tests | |||
219 | [Test] | 218 | [Test] |
220 | public void T012_SceneParts() | 219 | public void T012_SceneParts() |
221 | { | 220 | { |
221 | TestHelper.InMethod(); | ||
222 | |||
222 | UUID tmp0 = UUID.Random(); | 223 | UUID tmp0 = UUID.Random(); |
223 | UUID tmp1 = UUID.Random(); | 224 | UUID tmp1 = UUID.Random(); |
224 | UUID tmp2 = UUID.Random(); | 225 | UUID tmp2 = UUID.Random(); |
@@ -252,6 +253,8 @@ namespace OpenSim.Data.Tests | |||
252 | [Test] | 253 | [Test] |
253 | public void T013_DatabasePersistency() | 254 | public void T013_DatabasePersistency() |
254 | { | 255 | { |
256 | TestHelper.InMethod(); | ||
257 | |||
255 | // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data | 258 | // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data |
256 | // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored | 259 | // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored |
257 | // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently. | 260 | // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently. |
@@ -427,6 +430,8 @@ namespace OpenSim.Data.Tests | |||
427 | [Test] | 430 | [Test] |
428 | public void T014_UpdateObject() | 431 | public void T014_UpdateObject() |
429 | { | 432 | { |
433 | TestHelper.InMethod(); | ||
434 | |||
430 | string text1 = "object1 text"; | 435 | string text1 = "object1 text"; |
431 | SceneObjectGroup sog = FindSOG("object1", region1); | 436 | SceneObjectGroup sog = FindSOG("object1", region1); |
432 | sog.RootPart.Text = text1; | 437 | sog.RootPart.Text = text1; |
@@ -528,15 +533,20 @@ namespace OpenSim.Data.Tests | |||
528 | Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))"); | 533 | Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))"); |
529 | Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))"); | 534 | Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))"); |
530 | } | 535 | } |
531 | 536 | ||
537 | /// <summary> | ||
538 | /// Test storage and retrieval of a scene object with a large number of parts. | ||
539 | /// </summary> | ||
532 | [Test] | 540 | [Test] |
533 | public void T015_LargeSceneObjects() | 541 | public void T015_LargeSceneObjects() |
534 | { | 542 | { |
543 | TestHelper.InMethod(); | ||
544 | |||
535 | UUID id = UUID.Random(); | 545 | UUID id = UUID.Random(); |
536 | Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>(); | 546 | Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>(); |
537 | SceneObjectGroup sog = NewSOG("Test SOG", id, region4); | 547 | SceneObjectGroup sog = NewSOG("Test SOG", id, region4); |
538 | mydic.Add(sog.RootPart.UUID,sog.RootPart); | 548 | mydic.Add(sog.RootPart.UUID,sog.RootPart); |
539 | for (int i=0;i<30;i++) | 549 | for (int i = 0; i < 30; i++) |
540 | { | 550 | { |
541 | UUID tmp = UUID.Random(); | 551 | UUID tmp = UUID.Random(); |
542 | SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); | 552 | SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); |
@@ -555,13 +565,14 @@ namespace OpenSim.Data.Tests | |||
555 | sop.Acceleration = accel; | 565 | sop.Acceleration = accel; |
556 | 566 | ||
557 | mydic.Add(tmp,sop); | 567 | mydic.Add(tmp,sop); |
558 | sog.AddPart(sop); | 568 | sog.AddPart(sop); |
559 | db.StoreObject(sog, region4); | ||
560 | } | 569 | } |
561 | 570 | ||
571 | db.StoreObject(sog, region4); | ||
572 | |||
562 | SceneObjectGroup retsog = FindSOG("Test SOG", region4); | 573 | SceneObjectGroup retsog = FindSOG("Test SOG", region4); |
563 | SceneObjectPart[] parts = retsog.Parts; | 574 | SceneObjectPart[] parts = retsog.Parts; |
564 | for (int i=0;i<30;i++) | 575 | for (int i = 0; i < 30; i++) |
565 | { | 576 | { |
566 | SceneObjectPart cursop = mydic[parts[i].UUID]; | 577 | SceneObjectPart cursop = mydic[parts[i].UUID]; |
567 | Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition), "Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition))"); | 578 | Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition), "Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition))"); |
@@ -576,6 +587,8 @@ namespace OpenSim.Data.Tests | |||
576 | //[Test] | 587 | //[Test] |
577 | public void T016_RandomSogWithSceneParts() | 588 | public void T016_RandomSogWithSceneParts() |
578 | { | 589 | { |
590 | TestHelper.InMethod(); | ||
591 | |||
579 | PropertyScrambler<SceneObjectPart> scrambler = | 592 | PropertyScrambler<SceneObjectPart> scrambler = |
580 | new PropertyScrambler<SceneObjectPart>() | 593 | new PropertyScrambler<SceneObjectPart>() |
581 | .DontScramble(x => x.UUID); | 594 | .DontScramble(x => x.UUID); |
@@ -642,15 +655,16 @@ namespace OpenSim.Data.Tests | |||
642 | return sog; | 655 | return sog; |
643 | } | 656 | } |
644 | 657 | ||
645 | |||
646 | // NOTE: it is a bad practice to rely on some of the previous tests having been run before. | 658 | // NOTE: it is a bad practice to rely on some of the previous tests having been run before. |
647 | // If the tests are run manually, one at a time, each starts with full class init (DB cleared). | 659 | // If the tests are run manually, one at a time, each starts with full class init (DB cleared). |
648 | // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order. | 660 | // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order. |
649 | // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*! | 661 | // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*! |
650 | 662 | ||
651 | [Test] | 663 | [Test] |
652 | public void T020_PrimInventoryEmpty() | 664 | public void T020_PrimInventoryEmpty() |
653 | { | 665 | { |
666 | TestHelper.InMethod(); | ||
667 | |||
654 | SceneObjectGroup sog = GetMySOG("object1"); | 668 | SceneObjectGroup sog = GetMySOG("object1"); |
655 | TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); | 669 | TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); |
656 | Assert.That(t, Is.Null); | 670 | Assert.That(t, Is.Null); |
@@ -670,10 +684,11 @@ namespace OpenSim.Data.Tests | |||
670 | db.StorePrimInventory(sog.RootPart.UUID, list); | 684 | db.StorePrimInventory(sog.RootPart.UUID, list); |
671 | } | 685 | } |
672 | 686 | ||
673 | |||
674 | [Test] | 687 | [Test] |
675 | public void T021_PrimInventoryBasic() | 688 | public void T021_PrimInventoryBasic() |
676 | { | 689 | { |
690 | TestHelper.InMethod(); | ||
691 | |||
677 | SceneObjectGroup sog = GetMySOG("object1"); | 692 | SceneObjectGroup sog = GetMySOG("object1"); |
678 | InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero); | 693 | InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero); |
679 | 694 | ||
@@ -701,20 +716,19 @@ namespace OpenSim.Data.Tests | |||
701 | Assert.That(t2.Name, Is.EqualTo("My New Name"), "Assert.That(t.Name, Is.EqualTo(\"My New Name\"))"); | 716 | Assert.That(t2.Name, Is.EqualTo("My New Name"), "Assert.That(t.Name, Is.EqualTo(\"My New Name\"))"); |
702 | 717 | ||
703 | // Removing inventory | 718 | // Removing inventory |
704 | |||
705 | List<TaskInventoryItem> list = new List<TaskInventoryItem>(); | 719 | List<TaskInventoryItem> list = new List<TaskInventoryItem>(); |
706 | db.StorePrimInventory(prim1, list); | 720 | db.StorePrimInventory(prim1, list); |
707 | 721 | ||
708 | sog = FindSOG("object1", region1); | 722 | sog = FindSOG("object1", region1); |
709 | t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); | 723 | t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); |
710 | Assert.That(t, Is.Null); | 724 | Assert.That(t, Is.Null); |
711 | |||
712 | } | 725 | } |
713 | |||
714 | 726 | ||
715 | [Test] | 727 | [Test] |
716 | public void T025_PrimInventoryPersistency() | 728 | public void T025_PrimInventoryPersistency() |
717 | { | 729 | { |
730 | TestHelper.InMethod(); | ||
731 | |||
718 | InventoryItemBase i = new InventoryItemBase(); | 732 | InventoryItemBase i = new InventoryItemBase(); |
719 | UUID id = UUID.Random(); | 733 | UUID id = UUID.Random(); |
720 | i.ID = id; | 734 | i.ID = id; |
@@ -786,6 +800,8 @@ namespace OpenSim.Data.Tests | |||
786 | [ExpectedException(typeof(ArgumentException))] | 800 | [ExpectedException(typeof(ArgumentException))] |
787 | public void T026_PrimInventoryMany() | 801 | public void T026_PrimInventoryMany() |
788 | { | 802 | { |
803 | TestHelper.InMethod(); | ||
804 | |||
789 | UUID i1,i2,i3,i4; | 805 | UUID i1,i2,i3,i4; |
790 | i1 = UUID.Random(); | 806 | i1 = UUID.Random(); |
791 | i2 = UUID.Random(); | 807 | i2 = UUID.Random(); |
@@ -816,15 +832,18 @@ namespace OpenSim.Data.Tests | |||
816 | [Test] | 832 | [Test] |
817 | public void T052_RemoveObject() | 833 | public void T052_RemoveObject() |
818 | { | 834 | { |
835 | TestHelper.InMethod(); | ||
836 | |||
819 | db.RemoveObject(prim1, region1); | 837 | db.RemoveObject(prim1, region1); |
820 | SceneObjectGroup sog = FindSOG("object1", region1); | 838 | SceneObjectGroup sog = FindSOG("object1", region1); |
821 | Assert.That(sog, Is.Null); | 839 | Assert.That(sog, Is.Null); |
822 | } | 840 | } |
823 | 841 | ||
824 | |||
825 | [Test] | 842 | [Test] |
826 | public void T100_DefaultRegionInfo() | 843 | public void T100_DefaultRegionInfo() |
827 | { | 844 | { |
845 | TestHelper.InMethod(); | ||
846 | |||
828 | RegionSettings r1 = db.LoadRegionSettings(region1); | 847 | RegionSettings r1 = db.LoadRegionSettings(region1); |
829 | Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))"); | 848 | Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))"); |
830 | 849 | ||
@@ -835,6 +854,8 @@ namespace OpenSim.Data.Tests | |||
835 | [Test] | 854 | [Test] |
836 | public void T101_UpdateRegionInfo() | 855 | public void T101_UpdateRegionInfo() |
837 | { | 856 | { |
857 | TestHelper.InMethod(); | ||
858 | |||
838 | int agentlimit = random.Next(); | 859 | int agentlimit = random.Next(); |
839 | double objectbonus = random.Next(); | 860 | double objectbonus = random.Next(); |
840 | int maturity = random.Next(); | 861 | int maturity = random.Next(); |
@@ -933,13 +954,14 @@ namespace OpenSim.Data.Tests | |||
933 | //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))"); | 954 | //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))"); |
934 | Assert.That(r1a.FixedSun,Is.True); | 955 | Assert.That(r1a.FixedSun,Is.True); |
935 | Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))"); | 956 | Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))"); |
936 | Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))"); | 957 | Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))"); |
937 | |||
938 | } | 958 | } |
939 | 959 | ||
940 | [Test] | 960 | [Test] |
941 | public void T300_NoTerrain() | 961 | public void T300_NoTerrain() |
942 | { | 962 | { |
963 | TestHelper.InMethod(); | ||
964 | |||
943 | Assert.That(db.LoadTerrain(zero), Is.Null); | 965 | Assert.That(db.LoadTerrain(zero), Is.Null); |
944 | Assert.That(db.LoadTerrain(region1), Is.Null); | 966 | Assert.That(db.LoadTerrain(region1), Is.Null); |
945 | Assert.That(db.LoadTerrain(region2), Is.Null); | 967 | Assert.That(db.LoadTerrain(region2), Is.Null); |
@@ -949,6 +971,8 @@ namespace OpenSim.Data.Tests | |||
949 | [Test] | 971 | [Test] |
950 | public void T301_CreateTerrain() | 972 | public void T301_CreateTerrain() |
951 | { | 973 | { |
974 | TestHelper.InMethod(); | ||
975 | |||
952 | double[,] t1 = GenTerrain(height1); | 976 | double[,] t1 = GenTerrain(height1); |
953 | db.StoreTerrain(t1, region1); | 977 | db.StoreTerrain(t1, region1); |
954 | 978 | ||
@@ -961,6 +985,8 @@ namespace OpenSim.Data.Tests | |||
961 | [Test] | 985 | [Test] |
962 | public void T302_FetchTerrain() | 986 | public void T302_FetchTerrain() |
963 | { | 987 | { |
988 | TestHelper.InMethod(); | ||
989 | |||
964 | double[,] baseterrain1 = GenTerrain(height1); | 990 | double[,] baseterrain1 = GenTerrain(height1); |
965 | double[,] baseterrain2 = GenTerrain(height2); | 991 | double[,] baseterrain2 = GenTerrain(height2); |
966 | double[,] t1 = db.LoadTerrain(region1); | 992 | double[,] t1 = db.LoadTerrain(region1); |
@@ -971,6 +997,8 @@ namespace OpenSim.Data.Tests | |||
971 | [Test] | 997 | [Test] |
972 | public void T303_UpdateTerrain() | 998 | public void T303_UpdateTerrain() |
973 | { | 999 | { |
1000 | TestHelper.InMethod(); | ||
1001 | |||
974 | double[,] baseterrain1 = GenTerrain(height1); | 1002 | double[,] baseterrain1 = GenTerrain(height1); |
975 | double[,] baseterrain2 = GenTerrain(height2); | 1003 | double[,] baseterrain2 = GenTerrain(height2); |
976 | db.StoreTerrain(baseterrain2, region1); | 1004 | db.StoreTerrain(baseterrain2, region1); |
@@ -983,6 +1011,8 @@ namespace OpenSim.Data.Tests | |||
983 | [Test] | 1011 | [Test] |
984 | public void T400_EmptyLand() | 1012 | public void T400_EmptyLand() |
985 | { | 1013 | { |
1014 | TestHelper.InMethod(); | ||
1015 | |||
986 | Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))"); | 1016 | Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))"); |
987 | Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))"); | 1017 | Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))"); |
988 | Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))"); | 1018 | Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))"); |
@@ -1018,25 +1048,12 @@ namespace OpenSim.Data.Tests | |||
1018 | return true; | 1048 | return true; |
1019 | } | 1049 | } |
1020 | 1050 | ||
1021 | |||
1022 | private SceneObjectGroup FindSOG(string name, UUID r) | 1051 | private SceneObjectGroup FindSOG(string name, UUID r) |
1023 | { | 1052 | { |
1024 | List<SceneObjectGroup> objs = db.LoadObjects(r); | 1053 | List<SceneObjectGroup> objs = db.LoadObjects(r); |
1025 | foreach (SceneObjectGroup sog in objs) | 1054 | foreach (SceneObjectGroup sog in objs) |
1026 | { | 1055 | if (sog.Name == name) |
1027 | SceneObjectPart p = sog.RootPart; | ||
1028 | if (p.Name == name) { | ||
1029 | RegionInfo regionInfo = new RegionInfo(); | ||
1030 | regionInfo.RegionID = r; | ||
1031 | regionInfo.RegionLocX = 0; | ||
1032 | regionInfo.RegionLocY = 0; | ||
1033 | |||
1034 | Scene scene = new Scene(regionInfo); | ||
1035 | sog.SetScene(scene); | ||
1036 | |||
1037 | return sog; | 1056 | return sog; |
1038 | } | ||
1039 | } | ||
1040 | 1057 | ||
1041 | return null; | 1058 | return null; |
1042 | } | 1059 | } |