aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-23 17:32:38 +0000
committerJustin Clarke Casey2009-01-23 17:32:38 +0000
commitee3c61247e61d03ee252f373144d5c6bfecb9d6f (patch)
tree2ef31475b79dcfdcf034e3ff3404425ac8aecb15 /OpenSim
parent* minor: remove serialization and deserializationg sog log messages for now (diff)
downloadopensim-SC-ee3c61247e61d03ee252f373144d5c6bfecb9d6f.zip
opensim-SC-ee3c61247e61d03ee252f373144d5c6bfecb9d6f.tar.gz
opensim-SC-ee3c61247e61d03ee252f373144d5c6bfecb9d6f.tar.bz2
opensim-SC-ee3c61247e61d03ee252f373144d5c6bfecb9d6f.tar.xz
* refactor: move scene setup code into common test code assembly
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs39
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs7
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs (renamed from OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs)6
5 files changed, 33 insertions, 32 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs
index cc9cc03..0155966 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/EntityManagerTests.cs
@@ -36,18 +36,16 @@ using OpenMetaverse;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Communications; 37using OpenSim.Framework.Communications;
38using OpenSim.Region.Environment.Scenes; 38using OpenSim.Region.Environment.Scenes;
39using OpenSim.Tests.Common.Setup;
39 40
40namespace OpenSim.Region.Environment.Scenes.Tests 41namespace OpenSim.Region.Environment.Scenes.Tests
41{ 42{
42 /// <summary>
43 /// Scene oriented tests
44 /// </summary>
45 [TestFixture] 43 [TestFixture]
46 public class EntityManagerTests 44 public class EntityManagerTests
47 { 45 {
48 static public Random random; 46 static public Random random;
49 SceneObjectGroup found; 47 SceneObjectGroup found;
50 Scene scene = SceneTestUtils.SetupScene(); 48 Scene scene = SceneSetupHelpers.SetupScene();
51 49
52 [Test] 50 [Test]
53 public void T010_AddObjects() 51 public void T010_AddObjects()
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
index e347e67..ae879bb 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework.Communications.Cache;
35using OpenSim.Region.Communications.Local; 35using OpenSim.Region.Communications.Local;
36using OpenSim.Region.Environment.Scenes; 36using OpenSim.Region.Environment.Scenes;
37using OpenSim.Tests.Common.Mock; 37using OpenSim.Tests.Common.Mock;
38using OpenSim.Tests.Common.Setup;
38 39
39namespace OpenSim.Region.Environment.Scenes.Tests 40namespace OpenSim.Region.Environment.Scenes.Tests
40{ 41{
@@ -50,8 +51,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests
50 [Test] 51 [Test]
51 public void TestAddSceneObject() 52 public void TestAddSceneObject()
52 { 53 {
53 Scene scene = SceneTestUtils.SetupScene(); 54 Scene scene = SceneSetupHelpers.SetupScene();
54 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); 55 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
55 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 56 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
56 57
57 //System.Console.WriteLine("retrievedPart : {0}", retrievedPart); 58 //System.Console.WriteLine("retrievedPart : {0}", retrievedPart);
@@ -65,8 +66,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests
65 [Test] 66 [Test]
66 public void TestDeleteSceneObject() 67 public void TestDeleteSceneObject()
67 { 68 {
68 TestScene scene = SceneTestUtils.SetupScene(); 69 TestScene scene = SceneSetupHelpers.SetupScene();
69 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); 70 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
70 scene.DeleteSceneObject(part.ParentGroup, false); 71 scene.DeleteSceneObject(part.ParentGroup, false);
71 72
72 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 73 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
@@ -81,15 +82,15 @@ namespace OpenSim.Region.Environment.Scenes.Tests
81 { 82 {
82 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 83 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
83 84
84 TestScene scene = SceneTestUtils.SetupScene(); 85 TestScene scene = SceneSetupHelpers.SetupScene();
85 86
86 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 87 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
87 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 88 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
88 sogd.Enabled = false; 89 sogd.Enabled = false;
89 90
90 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); 91 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
91 92
92 IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); 93 IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
93 scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); 94 scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero);
94 95
95 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 96 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
@@ -105,10 +106,10 @@ namespace OpenSim.Region.Environment.Scenes.Tests
105 { 106 {
106 bool debugtest = false; 107 bool debugtest = false;
107 108
108 Scene scene = SceneTestUtils.SetupScene(); 109 Scene scene = SceneSetupHelpers.SetupScene();
109 SceneObjectPart part1 = SceneTestUtils.AddSceneObject(scene); 110 SceneObjectPart part1 = SceneSetupHelpers.AddSceneObject(scene);
110 SceneObjectGroup grp1 = part1.ParentGroup; 111 SceneObjectGroup grp1 = part1.ParentGroup;
111 SceneObjectPart part2 = SceneTestUtils.AddSceneObject(scene); 112 SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
112 SceneObjectGroup grp2 = part2.ParentGroup; 113 SceneObjectGroup grp2 = part2.ParentGroup;
113 114
114 115
@@ -178,14 +179,14 @@ namespace OpenSim.Region.Environment.Scenes.Tests
178 { 179 {
179 bool debugtest = false; 180 bool debugtest = false;
180 181
181 Scene scene = SceneTestUtils.SetupScene(); 182 Scene scene = SceneSetupHelpers.SetupScene();
182 SceneObjectPart part1 = SceneTestUtils.AddSceneObject(scene); 183 SceneObjectPart part1 = SceneSetupHelpers.AddSceneObject(scene);
183 SceneObjectGroup grp1 = part1.ParentGroup; 184 SceneObjectGroup grp1 = part1.ParentGroup;
184 SceneObjectPart part2 = SceneTestUtils.AddSceneObject(scene); 185 SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
185 SceneObjectGroup grp2 = part2.ParentGroup; 186 SceneObjectGroup grp2 = part2.ParentGroup;
186 SceneObjectPart part3 = SceneTestUtils.AddSceneObject(scene); 187 SceneObjectPart part3 = SceneSetupHelpers.AddSceneObject(scene);
187 SceneObjectGroup grp3 = part3.ParentGroup; 188 SceneObjectGroup grp3 = part3.ParentGroup;
188 SceneObjectPart part4 = SceneTestUtils.AddSceneObject(scene); 189 SceneObjectPart part4 = SceneSetupHelpers.AddSceneObject(scene);
189 SceneObjectGroup grp4 = part4.ParentGroup; 190 SceneObjectGroup grp4 = part4.ParentGroup;
190 191
191 192
@@ -310,21 +311,21 @@ namespace OpenSim.Region.Environment.Scenes.Tests
310 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 311 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
311 string myObjectName = "Fred"; 312 string myObjectName = "Fred";
312 313
313 TestScene scene = SceneTestUtils.SetupScene(); 314 TestScene scene = SceneSetupHelpers.SetupScene();
314 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene, myObjectName); 315 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName);
315 316
316 Assert.That( 317 Assert.That(
317 scene.CommsManager.UserAdminService.AddUser( 318 scene.CommsManager.UserAdminService.AddUser(
318 "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), 319 "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId),
319 Is.EqualTo(agentId)); 320 Is.EqualTo(agentId));
320 321
321 IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); 322 IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
322 323
323 CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentId); 324 CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentId);
324 Assert.That(userInfo, Is.Not.Null); 325 Assert.That(userInfo, Is.Not.Null);
325 Assert.That(userInfo.RootFolder, Is.Not.Null); 326 Assert.That(userInfo.RootFolder, Is.Not.Null);
326 327
327 SceneTestUtils.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); 328 SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client);
328 329
329 // Check that we now have the taken part in our inventory 330 // Check that we now have the taken part in our inventory
330 Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name)); 331 Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name));
diff --git a/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs
index 5ce78a3..5649b16 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs
@@ -31,6 +31,7 @@ using OpenMetaverse;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Environment.Scenes; 32using OpenSim.Region.Environment.Scenes;
33using OpenSim.Tests.Common.Mock; 33using OpenSim.Tests.Common.Mock;
34using OpenSim.Tests.Common.Setup;
34 35
35namespace OpenSim.Region.Environment.Scenes.Tests 36namespace OpenSim.Region.Environment.Scenes.Tests
36{ 37{
@@ -46,7 +47,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
46 [Test] 47 [Test]
47 public void TestAddRootAgent() 48 public void TestAddRootAgent()
48 { 49 {
49 Scene scene = SceneTestUtils.SetupScene(); 50 Scene scene = SceneSetupHelpers.SetupScene();
50 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 51 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
51 string firstName = "testfirstname"; 52 string firstName = "testfirstname";
52 53
@@ -77,10 +78,10 @@ namespace OpenSim.Region.Environment.Scenes.Tests
77 [Test] 78 [Test]
78 public void TestRemoveRootAgent() 79 public void TestRemoveRootAgent()
79 { 80 {
80 Scene scene = SceneTestUtils.SetupScene(); 81 Scene scene = SceneSetupHelpers.SetupScene();
81 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 82 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
82 83
83 SceneTestUtils.AddRootAgent(scene, agentId); 84 SceneSetupHelpers.AddRootAgent(scene, agentId);
84 85
85 scene.RemoveClient(agentId); 86 scene.RemoveClient(agentId);
86 87
diff --git a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
index 3bc8467..f1ad508 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
@@ -35,6 +35,7 @@ using OpenSim.Region.Environment;
35using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
36using OpenSim.Region.Environment.Modules.Communications.REST; 36using OpenSim.Region.Environment.Modules.Communications.REST;
37using OpenSim.Tests.Common.Mock; 37using OpenSim.Tests.Common.Mock;
38using OpenSim.Tests.Common.Setup;
38 39
39namespace OpenSim.Region.Environment.Scenes.Tests 40namespace OpenSim.Region.Environment.Scenes.Tests
40{ 41{
@@ -61,21 +62,21 @@ namespace OpenSim.Region.Environment.Scenes.Tests
61 IRegionModule interregionComms = new RESTInterregionComms(); 62 IRegionModule interregionComms = new RESTInterregionComms();
62 63
63 // TODO: Clean this up 64 // TODO: Clean this up
64 Scene sceneA = SceneTestUtils.SetupScene("sceneA", sceneAId, 1000, 1000, cm); 65 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
65 interregionComms.Initialise(sceneA, new IniConfigSource()); 66 interregionComms.Initialise(sceneA, new IniConfigSource());
66 sceneA.AddModule(interregionComms.Name, interregionComms); 67 sceneA.AddModule(interregionComms.Name, interregionComms);
67 sceneA.SetModuleInterfaces(); 68 sceneA.SetModuleInterfaces();
68 sceneA.RegisterRegionWithGrid(); 69 sceneA.RegisterRegionWithGrid();
69 70
70 // TODO: Clean this up 71 // TODO: Clean this up
71 Scene sceneB = SceneTestUtils.SetupScene("sceneB", sceneBId, 1010, 1010, cm); 72 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm);
72 interregionComms.Initialise(sceneB, new IniConfigSource()); 73 interregionComms.Initialise(sceneB, new IniConfigSource());
73 sceneB.AddModule(interregionComms.Name, interregionComms); 74 sceneB.AddModule(interregionComms.Name, interregionComms);
74 sceneB.SetModuleInterfaces(); 75 sceneB.SetModuleInterfaces();
75 sceneB.RegisterRegionWithGrid(); 76 sceneB.RegisterRegionWithGrid();
76 77
77 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); 78 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
78 TestClient client = SceneTestUtils.AddRootAgent(sceneA, agentId); 79 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId);
79 80
80 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>(); 81 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
81 82
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 6fa918a..11ebc86 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -39,12 +39,12 @@ using OpenSim.Region.Environment.Modules.Agent.Capabilities;
39using OpenSim.Region.Environment.Scenes; 39using OpenSim.Region.Environment.Scenes;
40using OpenSim.Tests.Common.Mock; 40using OpenSim.Tests.Common.Mock;
41 41
42namespace OpenSim.Region.Environment.Scenes.Tests 42namespace OpenSim.Tests.Common.Setup
43{ 43{
44 /// <summary> 44 /// <summary>
45 /// Utilities for constructing and performing operations upon scenes. 45 /// Helpers for setting up scenes.
46 /// </summary> 46 /// </summary>
47 public class SceneTestUtils 47 public class SceneSetupHelpers
48 { 48 {
49 /// <summary> 49 /// <summary>
50 /// Set up a test scene 50 /// Set up a test scene