diff options
author | Justin Clark-Casey (justincc) | 2010-09-06 23:28:52 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-09-06 23:28:52 +0100 |
commit | e55f6d47e91556b7778744877eb7bbdb949d3dba (patch) | |
tree | 3e348f35cc4ccd9ad132207610d206344c6ef003 /OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |
parent | Make console backup command do a forced backup rather than non-forced (diff) | |
download | opensim-SC-e55f6d47e91556b7778744877eb7bbdb949d3dba.zip opensim-SC-e55f6d47e91556b7778744877eb7bbdb949d3dba.tar.gz opensim-SC-e55f6d47e91556b7778744877eb7bbdb949d3dba.tar.bz2 opensim-SC-e55f6d47e91556b7778744877eb7bbdb949d3dba.tar.xz |
Add test that checks correct persistence when an unlink is quickly followed by deletion of a linked part
This test is temporarily not running since it currently fails due to a bug in this area
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index bddb285..93409fa 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -268,7 +268,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
268 | public void TestNewSceneObjectLinkPersistence() | 268 | public void TestNewSceneObjectLinkPersistence() |
269 | { | 269 | { |
270 | TestHelper.InMethod(); | 270 | TestHelper.InMethod(); |
271 | log4net.Config.XmlConfigurator.Configure(); | 271 | //log4net.Config.XmlConfigurator.Configure(); |
272 | 272 | ||
273 | TestScene scene = SceneSetupHelpers.SetupScene(); | 273 | TestScene scene = SceneSetupHelpers.SetupScene(); |
274 | 274 | ||
@@ -301,14 +301,45 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
301 | } | 301 | } |
302 | 302 | ||
303 | /// <summary> | 303 | /// <summary> |
304 | /// Test that a delink is correctly persisted to the database | 304 | /// Test that a delink of a previously linked object is correctly persisted to the database |
305 | /// </summary> | 305 | /// </summary> |
306 | // [Test] | 306 | //[Test] |
307 | // public void TestDelinkPersistence() | 307 | public void TestDelinkPersistence() |
308 | // { | 308 | { |
309 | // TestHelper.InMethod(); | 309 | TestHelper.InMethod(); |
310 | // | 310 | //log4net.Config.XmlConfigurator.Configure(); |
311 | // Scene scene = SceneSetupHelpers.SetupScene(); | 311 | |
312 | // } | 312 | TestScene scene = SceneSetupHelpers.SetupScene(); |
313 | |||
314 | string rootPartName = "rootpart"; | ||
315 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); | ||
316 | string linkPartName = "linkpart"; | ||
317 | UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); | ||
318 | |||
319 | SceneObjectPart rootPart | ||
320 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
321 | { Name = rootPartName, UUID = rootPartUuid }; | ||
322 | SceneObjectPart linkPart | ||
323 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
324 | { Name = linkPartName, UUID = linkPartUuid }; | ||
325 | |||
326 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); | ||
327 | sog.AddPart(linkPart); | ||
328 | scene.AddNewSceneObject(sog, true); | ||
329 | |||
330 | // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked | ||
331 | // scene backup thread. | ||
332 | scene.Backup(true); | ||
333 | |||
334 | // These changes should occur immediately without waiting for a backup pass | ||
335 | SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); | ||
336 | scene.DeleteSceneObject(groupToDelete, false); | ||
337 | |||
338 | List<SceneObjectGroup> storedObjects = scene.StorageManager.DataStore.LoadObjects(scene.RegionInfo.RegionID); | ||
339 | |||
340 | Assert.That(storedObjects.Count, Is.EqualTo(1)); | ||
341 | Assert.That(storedObjects[0].Children.Count, Is.EqualTo(1)); | ||
342 | Assert.That(storedObjects[0].Children.ContainsKey(rootPartUuid)); | ||
343 | } | ||
313 | } | 344 | } |
314 | } \ No newline at end of file | 345 | } \ No newline at end of file |