public void TestDelinkPersistence() { TestHelpers.InMethod(); //log4net.Config.XmlConfigurator.Configure(); TestScene scene = SceneHelpers.SetupScene(); string rootPartName = "rootpart"; UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); string linkPartName = "linkpart"; UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); SceneObjectPart rootPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = rootPartName, UUID = rootPartUuid }; SceneObjectPart linkPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = linkPartName, UUID = linkPartUuid }; SceneObjectGroup sog = new SceneObjectGroup(rootPart); sog.AddPart(linkPart); scene.AddNewSceneObject(sog, true); // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked // scene backup thread. scene.Backup(true); // These changes should occur immediately without waiting for a backup pass SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True); scene.DeleteSceneObject(groupToDelete, false); Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False); List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); Assert.That(storedObjects.Count, Is.EqualTo(1)); Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(1)); Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); }
public void TestDelinkPersistence() { TestHelpers.InMethod(); //log4net.Config.XmlConfigurator.Configure(); TestScene scene = new SceneHelpers().SetupScene(); string rootPartName = "rootpart"; UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); string linkPartName = "linkpart"; UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); SceneObjectPart rootPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = rootPartName, UUID = rootPartUuid }; SceneObjectPart linkPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = linkPartName, UUID = linkPartUuid }; SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart); scene.AddNewSceneObject(linkGroup, true); SceneObjectGroup sog = new SceneObjectGroup(rootPart); scene.AddNewSceneObject(sog, true); Assert.IsFalse(sog.GroupContainsForeignPrims); sog.LinkToGroup(linkGroup); Assert.IsTrue(sog.GroupContainsForeignPrims); scene.Backup(true); Assert.AreEqual(1, scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID).Count); // These changes should occur immediately without waiting for a backup pass SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); Assert.IsFalse(groupToDelete.GroupContainsForeignPrims); /* backup is async scene.DeleteSceneObject(groupToDelete, false); List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); Assert.AreEqual(1, storedObjects.Count); Assert.AreEqual(1, storedObjects[0].Parts.Length); Assert.IsTrue(storedObjects[0].ContainsPart(rootPartUuid)); */ }