Permalink
Browse files

Add regression test for teleporting an agent between separated region…

…s on the same simulator.

This involves a large amount of change in test scene setup code to allow test scenes to share shared modules
SetupScene is now an instance method that requires an instantiation of SceneHelpers, though other SceneHelpers methods are still static
May split these out into separate classes in the future.
  • Loading branch information...
justincc committed Apr 26, 2012
1 parent 8a65f5a commit 07e62df5582e28675275b3f5143ec37e5697d283
Showing with 268 additions and 307 deletions.
  1. +1 −1 OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
  2. +1 −1 OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
  3. +1 −1 OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
  4. +1 −1 OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
  5. +1 −1 OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
  6. +1 −1 OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
  7. +2 −2 OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
  8. +1 −1 OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
  9. +1 −1 OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
  10. +1 −1 OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
  11. +7 −7 OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
  12. +2 −1 OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
  13. +1 −1 OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
  14. +3 −3 OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
  15. +1 −1 OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
  16. +1 −1 OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
  17. +1 −1 OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
  18. +6 −2 OpenSim/Region/Framework/Scenes/Scene.cs
  19. +1 −1 OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
  20. +1 −1 OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
  21. +5 −5 OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
  22. +2 −2 OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
  23. +5 −5 OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
  24. +2 −2 OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
  25. +1 −1 OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
  26. +1 −1 OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
  27. +1 −1 OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
  28. +1 −1 OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
  29. +10 −8 OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
  30. +1 −1 OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
  31. +1 −1 OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
  32. +1 −1 OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
  33. +45 −132 OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
  34. +1 −1 OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
  35. +4 −4 OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
  36. +2 −2 OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
  37. +1 −1 OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
  38. +1 −1 OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
  39. +1 −1 OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
  40. +1 −1 OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
  41. +2 −2 OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
  42. +1 −1 OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
  43. +1 −1 OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
  44. +1 −1 OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
  45. +128 −90 OpenSim/Tests/Common/Helpers/SceneHelpers.cs
  46. +10 −7 OpenSim/Tests/Common/Mock/TestLandChannel.cs
  47. +1 −1 OpenSim/Tests/Torture/NPCTortureTests.cs
  48. +1 −1 OpenSim/Tests/Torture/ObjectTortureTests.cs
  49. +1 −1 OpenSim/Tests/Torture/ScriptTortureTests.cs
@@ -50,7 +50,7 @@ public void TestTextureNotFound()
TestHelpers.InMethod();
// Overkill - we only really need the asset service, not a whole scene.
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService);
TestOSHttpRequest req = new TestOSHttpRequest();
@@ -60,7 +60,7 @@ public void SetUp()
CapabilitiesModule capsModule = new CapabilitiesModule();
EventQueueGetModule eqgModule = new EventQueueGetModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
}
@@ -158,7 +158,7 @@ public void TestAddClient()
TestHelpers.InMethod();
// XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
uint myCircuitCode = 123456;
UUID myAgentUuid = TestHelpers.ParseTail(0x1);
UUID mySessionUuid = TestHelpers.ParseTail(0x2);
@@ -79,7 +79,7 @@ public void SetUp()
J2KDecoderModule j2kdm = new J2KDecoderModule();
- scene = SceneHelpers.SetupScene();
+ scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, j2kdm);
tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene);
@@ -65,7 +65,7 @@ public void SetUp()
config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true");
m_cache = new FlotsamAssetCache();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, m_cache);
}
@@ -72,7 +72,7 @@ public void Init()
config.AddConfig("Modules");
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
- scene = SceneHelpers.SetupScene();
+ scene = new SceneHelpers().SetupScene();
m_attMod = new AttachmentsModule();
SceneHelpers.SetupSceneModules(scene, config, m_attMod, new BasicInventoryAccessModule());
}
@@ -53,7 +53,7 @@ public void TestSetAppearance()
UUID userId = TestHelpers.ParseTail(0x1);
AvatarFactoryModule afm = new AvatarFactoryModule();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, afm);
ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
@@ -81,7 +81,7 @@ public void TestSaveBakedTextures()
CoreAssetCache assetCache = new CoreAssetCache();
AvatarFactoryModule afm = new AvatarFactoryModule();
- TestScene scene = SceneHelpers.SetupScene(assetCache);
+ TestScene scene = new SceneHelpers(assetCache).SetupScene();
SceneHelpers.SetupSceneModules(scene, afm);
ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
@@ -78,7 +78,7 @@ public void Init()
config.AddConfig("FriendsService");
config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
m_fm = new FriendsModule();
SceneHelpers.SetupSceneModules(m_scene, config, m_fm);
}
@@ -100,7 +100,7 @@ protected void ConstructDefaultIarBytesForTestLoad()
// log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule);
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
@@ -61,7 +61,7 @@ public override void SetUp()
SerialiserModule serialiserModule = new SerialiserModule();
m_archiverModule = new InventoryArchiverModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
}
@@ -62,7 +62,7 @@ public void TestSavePathToIarV0_1()
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule);
// Create user
@@ -179,7 +179,7 @@ public void TestLoadIarToInventoryPaths()
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@@ -222,7 +222,7 @@ public void TestLoadIarPathStartsWithSlash()
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
@@ -247,7 +247,7 @@ public void TestLoadIarPathWithEscapedChars()
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule);
// Create user
@@ -326,7 +326,7 @@ public void TestNewIarPath()
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
@@ -393,7 +393,7 @@ public void TestPartExistingIarPath()
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
string folder1ExistingName = "a";
@@ -444,7 +444,7 @@ public void TestMergeIarPath()
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
string folder1ExistingName = "a";
@@ -597,7 +597,8 @@ protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
{
- sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true);
+ if (sp.Scene.AttachmentsModule != null)
+ sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true);
}
protected void KillEntity(Scene scene, uint localID)
@@ -65,7 +65,7 @@ public void SetUp()
config.AddConfig("Modules");
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, m_iam);
// Create user
@@ -68,7 +68,7 @@ public void SetUp()
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
}
@@ -463,7 +463,7 @@ TaskInventoryItem ncItem
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
- TestScene scene2 = SceneHelpers.SetupScene();
+ TestScene scene2 = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule);
// Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is
@@ -607,7 +607,7 @@ public void TestMergeOar()
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
@@ -64,7 +64,7 @@ public void SetUp()
{
m_pcm = new PrimCountModule();
LandManagementModule lmm = new LandManagementModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm);
int xParcelDivider = (int)Constants.RegionSize - 1;
@@ -53,7 +53,7 @@ public class MoapTests
public void SetUp()
{
m_module = new MoapModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, m_module);
}
@@ -343,7 +343,7 @@ public class SerialiserTests
public void Init()
{
m_serialiserModule = new SerialiserModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule);
}
@@ -437,6 +437,7 @@ public ISimulationService SimulationService
{
if (m_simulationService == null)
m_simulationService = RequestModuleInterface<ISimulationService>();
+
return m_simulationService;
}
}
@@ -3217,7 +3218,7 @@ public override void RemoveClient(UUID agentID, bool closeChildAgents)
try
{
m_log.DebugFormat(
- "[SCENE]: Removing {0} agent {1} {2} from region {2}",
+ "[SCENE]: Removing {0} agent {1} {2} from region {3}",
(isChildAgent ? "child" : "root"), avatar.Name, agentID, RegionInfo.RegionName);
m_sceneGraph.removeUserCount(!isChildAgent);
@@ -3879,7 +3880,10 @@ public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData)
ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2);
if (nearestParcel == null)
{
- m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: no allowed parcel", cAgentData.AgentID);
+ m_log.DebugFormat(
+ "[SCENE]: Denying root agent entry to {0} in {1}: no allowed parcel",
+ cAgentData.AgentID, RegionInfo.RegionName);
+
return false;
}
@@ -45,7 +45,7 @@ public class EntityManagerTests
{
static public Random random;
SceneObjectGroup found;
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
[Test]
public void T010_AddObjects()
@@ -44,7 +44,7 @@ public class SceneGraphTests
public void TestDuplicateObject()
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
string part1Name = "part1";
@@ -88,7 +88,7 @@ public void TestAddSceneObject()
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
int partsToTestCount = 3;
SceneObjectGroup so
@@ -118,7 +118,7 @@ public void TestAddExistingSceneObjectUuid()
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
string obj1Name = "Alfred";
string obj2Name = "Betty";
@@ -152,7 +152,7 @@ public void TestGetSceneObjectByPartLocalId()
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
int partsToTestCount = 3;
SceneObjectGroup so
@@ -185,7 +185,7 @@ public void TestDeleteSceneObject()
{
TestHelpers.InMethod();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
scene.DeleteSceneObject(part.ParentGroup, false);
@@ -204,7 +204,7 @@ public void TestDeleteSceneObjectAsync()
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
@@ -61,7 +61,7 @@ public void TestDeRezSceneObject()
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Startup");
config.Set("serverside_object_permissions", true);
@@ -100,7 +100,7 @@ public void TestDeRezSceneObjectNotOwner()
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Startup");
config.Set("serverside_object_permissions", true);
@@ -55,7 +55,7 @@ public void TestLinkToSelf()
UUID ownerId = TestHelpers.ParseTail(0x1);
int nParts = 3;
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
scene.AddSceneObject(sog1);
scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId });
@@ -71,7 +71,7 @@ public void TestLinkDelink2SceneObjects()
bool debugtest = false;
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
SceneObjectGroup grp1 = part1.ParentGroup;
SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -153,7 +153,7 @@ public void TestLinkDelink2groups4SceneObjects()
bool debugtest = false;
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
SceneObjectGroup grp1 = part1.ParentGroup;
SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -286,7 +286,7 @@ public void TestNewSceneObjectLinkPersistence()
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
@@ -325,7 +325,7 @@ public void TestDelinkPersistence()
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
Oops, something went wrong.

0 comments on commit 07e62df

Please sign in to comment.