diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
5 files changed, 12 insertions, 193 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index 52ad538..9557cd0 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
67 | IConfigSource configSource = new IniConfigSource(); | 67 | IConfigSource configSource = new IniConfigSource(); |
68 | IConfig config = configSource.AddConfig("Startup"); | 68 | IConfig config = configSource.AddConfig("Startup"); |
69 | config.Set("serverside_object_permissions", true); | 69 | config.Set("serverside_object_permissions", true); |
70 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); | 70 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); |
71 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 71 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; |
72 | 72 | ||
73 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 73 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
112 | IConfigSource configSource = new IniConfigSource(); | 112 | IConfigSource configSource = new IniConfigSource(); |
113 | IConfig config = configSource.AddConfig("Startup"); | 113 | IConfig config = configSource.AddConfig("Startup"); |
114 | config.Set("serverside_object_permissions", true); | 114 | config.Set("serverside_object_permissions", true); |
115 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); | 115 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); |
116 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 116 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; |
117 | 117 | ||
118 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 118 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
@@ -195,4 +195,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
195 | // Assert.That(retrievedPart, Is.Null); | 195 | // Assert.That(retrievedPart, Is.Null); |
196 | } | 196 | } |
197 | } | 197 | } |
198 | } \ No newline at end of file | 198 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs index c264433..1182c96 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs | |||
@@ -62,6 +62,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
62 | Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2)); | 62 | Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2)); |
63 | Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3)); | 63 | Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3)); |
64 | Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4)); | 64 | Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4)); |
65 | |||
66 | Assert.That(g1Post.RootPart.UndoCount, Is.EqualTo(1)); | ||
65 | } | 67 | } |
66 | 68 | ||
67 | /// <summary> | 69 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs deleted file mode 100644 index 4883ae7..0000000 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs +++ /dev/null | |||
@@ -1,184 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using NUnit.Framework; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Framework.Communications; | ||
34 | using OpenSim.Region.Framework.Scenes; | ||
35 | using OpenSim.Tests.Common; | ||
36 | using OpenSim.Tests.Common.Mock; | ||
37 | |||
38 | namespace OpenSim.Region.Framework.Scenes.Tests | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// Tests for undo/redo | ||
42 | /// </summary> | ||
43 | public class SceneObjectUndoRedoTests : OpenSimTestCase | ||
44 | { | ||
45 | [Test] | ||
46 | public void TestUndoRedoResizeSceneObject() | ||
47 | { | ||
48 | TestHelpers.InMethod(); | ||
49 | // TestHelpers.EnableLogging(); | ||
50 | |||
51 | Vector3 firstSize = new Vector3(2, 3, 4); | ||
52 | Vector3 secondSize = new Vector3(5, 6, 7); | ||
53 | |||
54 | Scene scene = new SceneHelpers().SetupScene(); | ||
55 | scene.MaxUndoCount = 20; | ||
56 | SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); | ||
57 | |||
58 | // TODO: It happens to be the case that we are not storing undo states for SOPs which are not yet in a SOG, | ||
59 | // which is the way that AddSceneObject() sets up the object (i.e. it creates the SOP first). However, | ||
60 | // this is somewhat by chance. Really, we shouldn't be storing undo states at all if the object is not | ||
61 | // in a scene. | ||
62 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); | ||
63 | |||
64 | g1.GroupResize(firstSize); | ||
65 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(1)); | ||
66 | |||
67 | g1.GroupResize(secondSize); | ||
68 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(2)); | ||
69 | |||
70 | g1.RootPart.Undo(); | ||
71 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(1)); | ||
72 | Assert.That(g1.GroupScale, Is.EqualTo(firstSize)); | ||
73 | |||
74 | g1.RootPart.Redo(); | ||
75 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(2)); | ||
76 | Assert.That(g1.GroupScale, Is.EqualTo(secondSize)); | ||
77 | } | ||
78 | |||
79 | [Test] | ||
80 | public void TestUndoLimit() | ||
81 | { | ||
82 | TestHelpers.InMethod(); | ||
83 | |||
84 | Vector3 firstSize = new Vector3(2, 3, 4); | ||
85 | Vector3 secondSize = new Vector3(5, 6, 7); | ||
86 | Vector3 thirdSize = new Vector3(8, 9, 10); | ||
87 | Vector3 fourthSize = new Vector3(11, 12, 13); | ||
88 | |||
89 | Scene scene = new SceneHelpers().SetupScene(); | ||
90 | scene.MaxUndoCount = 2; | ||
91 | SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); | ||
92 | |||
93 | g1.GroupResize(firstSize); | ||
94 | g1.GroupResize(secondSize); | ||
95 | g1.GroupResize(thirdSize); | ||
96 | g1.GroupResize(fourthSize); | ||
97 | |||
98 | g1.RootPart.Undo(); | ||
99 | g1.RootPart.Undo(); | ||
100 | g1.RootPart.Undo(); | ||
101 | |||
102 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); | ||
103 | Assert.That(g1.GroupScale, Is.EqualTo(secondSize)); | ||
104 | } | ||
105 | |||
106 | [Test] | ||
107 | public void TestNoUndoOnObjectsNotInScene() | ||
108 | { | ||
109 | TestHelpers.InMethod(); | ||
110 | |||
111 | Vector3 firstSize = new Vector3(2, 3, 4); | ||
112 | Vector3 secondSize = new Vector3(5, 6, 7); | ||
113 | // Vector3 thirdSize = new Vector3(8, 9, 10); | ||
114 | // Vector3 fourthSize = new Vector3(11, 12, 13); | ||
115 | |||
116 | Scene scene = new SceneHelpers().SetupScene(); | ||
117 | scene.MaxUndoCount = 20; | ||
118 | SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1)); | ||
119 | |||
120 | g1.GroupResize(firstSize); | ||
121 | g1.GroupResize(secondSize); | ||
122 | |||
123 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); | ||
124 | |||
125 | g1.RootPart.Undo(); | ||
126 | |||
127 | Assert.That(g1.GroupScale, Is.EqualTo(secondSize)); | ||
128 | } | ||
129 | |||
130 | [Test] | ||
131 | public void TestUndoBeyondAvailable() | ||
132 | { | ||
133 | TestHelpers.InMethod(); | ||
134 | |||
135 | Vector3 newSize = new Vector3(2, 3, 4); | ||
136 | |||
137 | Scene scene = new SceneHelpers().SetupScene(); | ||
138 | scene.MaxUndoCount = 20; | ||
139 | SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); | ||
140 | Vector3 originalSize = g1.GroupScale; | ||
141 | |||
142 | g1.RootPart.Undo(); | ||
143 | |||
144 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); | ||
145 | Assert.That(g1.GroupScale, Is.EqualTo(originalSize)); | ||
146 | |||
147 | g1.GroupResize(newSize); | ||
148 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(1)); | ||
149 | Assert.That(g1.GroupScale, Is.EqualTo(newSize)); | ||
150 | |||
151 | g1.RootPart.Undo(); | ||
152 | g1.RootPart.Undo(); | ||
153 | |||
154 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); | ||
155 | Assert.That(g1.GroupScale, Is.EqualTo(originalSize)); | ||
156 | } | ||
157 | |||
158 | [Test] | ||
159 | public void TestRedoBeyondAvailable() | ||
160 | { | ||
161 | TestHelpers.InMethod(); | ||
162 | |||
163 | Vector3 newSize = new Vector3(2, 3, 4); | ||
164 | |||
165 | Scene scene = new SceneHelpers().SetupScene(); | ||
166 | scene.MaxUndoCount = 20; | ||
167 | SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); | ||
168 | Vector3 originalSize = g1.GroupScale; | ||
169 | |||
170 | g1.RootPart.Redo(); | ||
171 | |||
172 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); | ||
173 | Assert.That(g1.GroupScale, Is.EqualTo(originalSize)); | ||
174 | |||
175 | g1.GroupResize(newSize); | ||
176 | g1.RootPart.Undo(); | ||
177 | g1.RootPart.Redo(); | ||
178 | g1.RootPart.Redo(); | ||
179 | |||
180 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(1)); | ||
181 | Assert.That(g1.GroupScale, Is.EqualTo(newSize)); | ||
182 | } | ||
183 | } | ||
184 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index 2b79271..e7a1fe0 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | |||
@@ -44,7 +44,7 @@ using OpenSim.Tests.Common.Mock; | |||
44 | namespace OpenSim.Region.Framework.Scenes.Tests | 44 | namespace OpenSim.Region.Framework.Scenes.Tests |
45 | { | 45 | { |
46 | [TestFixture] | 46 | [TestFixture] |
47 | public class SceneObjectUserGroupTests : OpenSimTestCase | 47 | public class SceneObjectUserGroupTests |
48 | { | 48 | { |
49 | /// <summary> | 49 | /// <summary> |
50 | /// Test share with group object functionality | 50 | /// Test share with group object functionality |
@@ -54,6 +54,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
54 | public void TestShareWithGroup() | 54 | public void TestShareWithGroup() |
55 | { | 55 | { |
56 | TestHelpers.InMethod(); | 56 | TestHelpers.InMethod(); |
57 | // log4net.Config.XmlConfigurator.Configure(); | ||
57 | 58 | ||
58 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); | 59 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); |
59 | 60 | ||
@@ -70,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
70 | 71 | ||
71 | SceneHelpers.SetupSceneModules( | 72 | SceneHelpers.SetupSceneModules( |
72 | scene, configSource, new object[] | 73 | scene, configSource, new object[] |
73 | { new PermissionsModule(), | 74 | { new DefaultPermissionsModule(), |
74 | new GroupsModule(), | 75 | new GroupsModule(), |
75 | new MockGroupsServicesConnector() }); | 76 | new MockGroupsServicesConnector() }); |
76 | 77 | ||
@@ -81,4 +82,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
81 | groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); | 82 | groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); |
82 | } | 83 | } |
83 | } | 84 | } |
84 | } \ No newline at end of file | 85 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index de4458d..8d94d29 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | |||
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
216 | // We need to set up the permisions module on scene B so that our later use of agent limit to deny | 216 | // We need to set up the permisions module on scene B so that our later use of agent limit to deny |
217 | // QueryAccess won't succeed anyway because administrators are always allowed in and the default | 217 | // QueryAccess won't succeed anyway because administrators are always allowed in and the default |
218 | // IsAdministrator if no permissions module is present is true. | 218 | // IsAdministrator if no permissions module is present is true. |
219 | SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB }); | 219 | SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new DefaultPermissionsModule(), etmB }); |
220 | 220 | ||
221 | // Shared scene modules | 221 | // Shared scene modules |
222 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); | 222 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); |
@@ -381,7 +381,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
381 | // We need to set up the permisions module on scene B so that our later use of agent limit to deny | 381 | // We need to set up the permisions module on scene B so that our later use of agent limit to deny |
382 | // QueryAccess won't succeed anyway because administrators are always allowed in and the default | 382 | // QueryAccess won't succeed anyway because administrators are always allowed in and the default |
383 | // IsAdministrator if no permissions module is present is true. | 383 | // IsAdministrator if no permissions module is present is true. |
384 | SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB }); | 384 | SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new DefaultPermissionsModule(), etmB }); |
385 | 385 | ||
386 | // Shared scene modules | 386 | // Shared scene modules |
387 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); | 387 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); |
@@ -507,4 +507,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
507 | // TestHelpers.DisableLogging(); | 507 | // TestHelpers.DisableLogging(); |
508 | } | 508 | } |
509 | } | 509 | } |
510 | } \ No newline at end of file | 510 | } |