diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
18 files changed, 159 insertions, 159 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index da18941..fa698a9 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
50 | public void T010_AddObjects() | 50 | public void T010_AddObjects() |
51 | { | 51 | { |
52 | TestHelpers.InMethod(); | 52 | TestHelpers.InMethod(); |
53 | 53 | ||
54 | random = new Random(); | 54 | random = new Random(); |
55 | SceneObjectGroup found; | 55 | SceneObjectGroup found; |
56 | EntityManager entman = new EntityManager(); | 56 | EntityManager entman = new EntityManager(); |
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
62 | UUID obj2 = sog.UUID; | 62 | UUID obj2 = sog.UUID; |
63 | uint li2 = sog.LocalId; | 63 | uint li2 = sog.LocalId; |
64 | entman.Add(sog); | 64 | entman.Add(sog); |
65 | 65 | ||
66 | found = (SceneObjectGroup)entman[obj1]; | 66 | found = (SceneObjectGroup)entman[obj1]; |
67 | Assert.That(found.UUID ,Is.EqualTo(obj1)); | 67 | Assert.That(found.UUID ,Is.EqualTo(obj1)); |
68 | found = (SceneObjectGroup)entman[li1]; | 68 | found = (SceneObjectGroup)entman[li1]; |
@@ -85,15 +85,15 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
85 | public void T011_ThreadAddRemoveTest() | 85 | public void T011_ThreadAddRemoveTest() |
86 | { | 86 | { |
87 | TestHelpers.InMethod(); | 87 | TestHelpers.InMethod(); |
88 | 88 | ||
89 | // This test adds and removes with mutiple threads, attempting to break the | 89 | // This test adds and removes with mutiple threads, attempting to break the |
90 | // uuid and localid dictionary coherence. | 90 | // uuid and localid dictionary coherence. |
91 | EntityManager entman = new EntityManager(); | 91 | EntityManager entman = new EntityManager(); |
92 | SceneObjectGroup sog = NewSOG(); | 92 | SceneObjectGroup sog = NewSOG(); |
93 | for (int j=0; j<20; j++) | 93 | for (int j=0; j<20; j++) |
94 | { | 94 | { |
95 | List<Thread> trdlist = new List<Thread>(); | 95 | List<Thread> trdlist = new List<Thread>(); |
96 | 96 | ||
97 | for (int i=0; i<4; i++) | 97 | for (int i=0; i<4; i++) |
98 | { | 98 | { |
99 | // Adds scene object | 99 | // Adds scene object |
@@ -101,14 +101,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
101 | Thread start = new Thread(new ThreadStart(test.TestAddSceneObject)); | 101 | Thread start = new Thread(new ThreadStart(test.TestAddSceneObject)); |
102 | start.Start(); | 102 | start.Start(); |
103 | trdlist.Add(start); | 103 | trdlist.Add(start); |
104 | 104 | ||
105 | // Removes it | 105 | // Removes it |
106 | test = new NewTestThreads(entman,sog); | 106 | test = new NewTestThreads(entman,sog); |
107 | start = new Thread(new ThreadStart(test.TestRemoveSceneObject)); | 107 | start = new Thread(new ThreadStart(test.TestRemoveSceneObject)); |
108 | start.Start(); | 108 | start.Start(); |
109 | trdlist.Add(start); | 109 | trdlist.Add(start); |
110 | } | 110 | } |
111 | foreach (Thread thread in trdlist) | 111 | foreach (Thread thread in trdlist) |
112 | { | 112 | { |
113 | thread.Join(); | 113 | thread.Join(); |
114 | } | 114 | } |
@@ -133,14 +133,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
133 | 133 | ||
134 | SceneObjectGroup sog = new SceneObjectGroup(sop); | 134 | SceneObjectGroup sog = new SceneObjectGroup(sop); |
135 | scene.AddNewSceneObject(sog, false); | 135 | scene.AddNewSceneObject(sog, false); |
136 | 136 | ||
137 | return sog; | 137 | return sog; |
138 | } | 138 | } |
139 | 139 | ||
140 | private static string RandomName() | 140 | private static string RandomName() |
141 | { | 141 | { |
142 | StringBuilder name = new StringBuilder(); | 142 | StringBuilder name = new StringBuilder(); |
143 | int size = random.Next(40,80); | 143 | int size = random.Next(40,80); |
144 | char ch ; | 144 | char ch ; |
145 | for (int i=0; i<size; i++) | 145 | for (int i=0; i<size; i++) |
146 | { | 146 | { |
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
156 | private EntityManager entman; | 156 | private EntityManager entman; |
157 | private SceneObjectGroup sog; | 157 | private SceneObjectGroup sog; |
158 | private Random random; | 158 | private Random random; |
159 | 159 | ||
160 | public NewTestThreads(EntityManager entman, SceneObjectGroup sog) | 160 | public NewTestThreads(EntityManager entman, SceneObjectGroup sog) |
161 | { | 161 | { |
162 | this.entman = entman; | 162 | this.entman = entman; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index ee7c8a9..56723bf 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | |||
@@ -55,29 +55,29 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
55 | UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002"); | 55 | UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002"); |
56 | 56 | ||
57 | SceneObjectPart part1 | 57 | SceneObjectPart part1 |
58 | = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 58 | = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
59 | { Name = part1Name, UUID = part1Id }; | 59 | { Name = part1Name, UUID = part1Id }; |
60 | SceneObjectGroup so = new SceneObjectGroup(part1); | 60 | SceneObjectGroup so = new SceneObjectGroup(part1); |
61 | SceneObjectPart part2 | 61 | SceneObjectPart part2 |
62 | = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 62 | = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
63 | { Name = part2Name, UUID = part2Id }; | 63 | { Name = part2Name, UUID = part2Id }; |
64 | so.AddPart(part2); | 64 | so.AddPart(part2); |
65 | 65 | ||
66 | scene.AddNewSceneObject(so, false); | 66 | scene.AddNewSceneObject(so, false); |
67 | 67 | ||
68 | SceneObjectGroup dupeSo | 68 | SceneObjectGroup dupeSo |
69 | = scene.SceneGraph.DuplicateObject( | 69 | = scene.SceneGraph.DuplicateObject( |
70 | part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); | 70 | part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); |
71 | Assert.That(dupeSo.Parts.Length, Is.EqualTo(2)); | 71 | Assert.That(dupeSo.Parts.Length, Is.EqualTo(2)); |
72 | 72 | ||
73 | SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1); | 73 | SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1); |
74 | SceneObjectPart dupePart2 = dupeSo.GetLinkNumPart(2); | 74 | SceneObjectPart dupePart2 = dupeSo.GetLinkNumPart(2); |
75 | Assert.That(dupePart1.LocalId, Is.Not.EqualTo(part1.LocalId)); | 75 | Assert.That(dupePart1.LocalId, Is.Not.EqualTo(part1.LocalId)); |
76 | Assert.That(dupePart2.LocalId, Is.Not.EqualTo(part2.LocalId)); | 76 | Assert.That(dupePart2.LocalId, Is.Not.EqualTo(part2.LocalId)); |
77 | 77 | ||
78 | Assert.That(dupePart1.Flags, Is.EqualTo(part1.Flags)); | 78 | Assert.That(dupePart1.Flags, Is.EqualTo(part1.Flags)); |
79 | Assert.That(dupePart2.Flags, Is.EqualTo(part2.Flags)); | 79 | Assert.That(dupePart2.Flags, Is.EqualTo(part2.Flags)); |
80 | 80 | ||
81 | /* | 81 | /* |
82 | Assert.That(part1.PhysActor, Is.Not.Null); | 82 | Assert.That(part1.PhysActor, Is.Not.Null); |
83 | Assert.That(part2.PhysActor, Is.Not.Null); | 83 | Assert.That(part2.PhysActor, Is.Not.Null); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index ac8c32d..8961a26 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
99 | Assert.That(scene.AddNewSceneObject(so, false), Is.True); | 99 | Assert.That(scene.AddNewSceneObject(so, false), Is.True); |
100 | SceneObjectGroup retrievedSo = scene.GetSceneObjectGroup(so.UUID); | 100 | SceneObjectGroup retrievedSo = scene.GetSceneObjectGroup(so.UUID); |
101 | SceneObjectPart[] retrievedParts = retrievedSo.Parts; | 101 | SceneObjectPart[] retrievedParts = retrievedSo.Parts; |
102 | 102 | ||
103 | //m_log.Debug("retrievedPart : {0}", retrievedPart); | 103 | //m_log.Debug("retrievedPart : {0}", retrievedPart); |
104 | // If the parts have the same UUID then we will consider them as one and the same | 104 | // If the parts have the same UUID then we will consider them as one and the same |
105 | Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); | 105 | Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); |
@@ -126,19 +126,19 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
126 | UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); | 126 | UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); |
127 | 127 | ||
128 | SceneObjectPart part1 | 128 | SceneObjectPart part1 |
129 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 129 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
130 | { Name = obj1Name, UUID = objUuid }; | 130 | { Name = obj1Name, UUID = objUuid }; |
131 | 131 | ||
132 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True); | 132 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True); |
133 | 133 | ||
134 | SceneObjectPart part2 | 134 | SceneObjectPart part2 |
135 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 135 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
136 | { Name = obj2Name, UUID = objUuid }; | 136 | { Name = obj2Name, UUID = objUuid }; |
137 | 137 | ||
138 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part2), false), Is.False); | 138 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part2), false), Is.False); |
139 | 139 | ||
140 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); | 140 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); |
141 | 141 | ||
142 | //m_log.Debug("retrievedPart : {0}", retrievedPart); | 142 | //m_log.Debug("retrievedPart : {0}", retrievedPart); |
143 | // If the parts have the same UUID then we will consider them as one and the same | 143 | // If the parts have the same UUID then we will consider them as one and the same |
144 | Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name)); | 144 | Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name)); |
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
180 | Assert.That(scene.GetGroupByPrim(soid), Is.Null); | 180 | Assert.That(scene.GetGroupByPrim(soid), Is.Null); |
181 | Assert.That(scene.GetGroupByPrim(spid), Is.Null); | 181 | Assert.That(scene.GetGroupByPrim(spid), Is.Null); |
182 | } | 182 | } |
183 | 183 | ||
184 | /// <summary> | 184 | /// <summary> |
185 | /// Test deleting an object from a scene. | 185 | /// Test deleting an object from a scene. |
186 | /// </summary> | 186 | /// </summary> |
@@ -205,10 +205,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
205 | 205 | ||
206 | Assert.That(retrievedPart, Is.Null); | 206 | Assert.That(retrievedPart, Is.Null); |
207 | } | 207 | } |
208 | 208 | ||
209 | /// <summary> | 209 | /// <summary> |
210 | /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not | 210 | /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not |
211 | /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by | 211 | /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by |
212 | /// OpenSim. | 212 | /// OpenSim. |
213 | /// </summary> | 213 | /// </summary> |
214 | [Test] | 214 | [Test] |
@@ -218,24 +218,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
218 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); | 218 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); |
219 | string childPartName = "childPart"; | 219 | string childPartName = "childPart"; |
220 | UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); | 220 | UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); |
221 | 221 | ||
222 | SceneObjectPart rootPart | 222 | SceneObjectPart rootPart |
223 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 223 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
224 | { Name = rootPartName, UUID = rootPartUuid }; | 224 | { Name = rootPartName, UUID = rootPartUuid }; |
225 | SceneObjectPart linkPart | 225 | SceneObjectPart linkPart |
226 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 226 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
227 | { Name = childPartName, UUID = childPartUuid }; | 227 | { Name = childPartName, UUID = childPartUuid }; |
228 | 228 | ||
229 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); | 229 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); |
230 | sog.AddPart(linkPart); | 230 | sog.AddPart(linkPart); |
231 | 231 | ||
232 | Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); | 232 | Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); |
233 | Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid)); | 233 | Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid)); |
234 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); | 234 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); |
235 | 235 | ||
236 | UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002"); | 236 | UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002"); |
237 | sog.UUID = newRootPartUuid; | 237 | sog.UUID = newRootPartUuid; |
238 | 238 | ||
239 | Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); | 239 | Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); |
240 | Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); | 240 | Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); |
241 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); | 241 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs index dc3b717..c27bc1a 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
87 | 87 | ||
88 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 88 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
89 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | 89 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; |
90 | sogd.Enabled = false; | 90 | sogd.Enabled = false; |
91 | 91 | ||
92 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); | 92 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); |
93 | uint soLocalId = so.LocalId; | 93 | uint soLocalId = so.LocalId; |
@@ -119,11 +119,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
119 | 119 | ||
120 | // Check that object is still there. | 120 | // Check that object is still there. |
121 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | 121 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
122 | Assert.That(retrievedPart2, Is.Not.Null); | 122 | Assert.That(retrievedPart2, Is.Not.Null); |
123 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); | 123 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); |
124 | 124 | ||
125 | // Check that we have a copy in inventory | 125 | // Check that we have a copy in inventory |
126 | InventoryItemBase item | 126 | InventoryItemBase item |
127 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); | 127 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); |
128 | Assert.That(item, Is.Not.Null); | 128 | Assert.That(item, Is.Not.Null); |
129 | } | 129 | } |
@@ -145,7 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
145 | 145 | ||
146 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 146 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
147 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | 147 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; |
148 | sogd.Enabled = false; | 148 | sogd.Enabled = false; |
149 | 149 | ||
150 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); | 150 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", ua.PrincipalID); |
151 | uint soLocalId = so.LocalId; | 151 | uint soLocalId = so.LocalId; |
@@ -168,11 +168,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
168 | 168 | ||
169 | // Check that object is still there. | 169 | // Check that object is still there. |
170 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | 170 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
171 | Assert.That(retrievedPart2, Is.Not.Null); | 171 | Assert.That(retrievedPart2, Is.Not.Null); |
172 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); | 172 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); |
173 | 173 | ||
174 | // Check that we do not have a copy in inventory | 174 | // Check that we do not have a copy in inventory |
175 | InventoryItemBase item | 175 | InventoryItemBase item |
176 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); | 176 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Lost And Found/so1"); |
177 | Assert.That(item, Is.Null); | 177 | Assert.That(item, Is.Null); |
178 | } | 178 | } |
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
194 | 194 | ||
195 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 195 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
196 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | 196 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; |
197 | sogd.Enabled = false; | 197 | sogd.Enabled = false; |
198 | 198 | ||
199 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); | 199 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); |
200 | uint soLocalId = so.LocalId; | 200 | uint soLocalId = so.LocalId; |
@@ -219,11 +219,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
219 | 219 | ||
220 | // Check that object is still there. | 220 | // Check that object is still there. |
221 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | 221 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
222 | Assert.That(retrievedPart2, Is.Not.Null); | 222 | Assert.That(retrievedPart2, Is.Not.Null); |
223 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); | 223 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); |
224 | 224 | ||
225 | // Check that we have a copy in inventory | 225 | // Check that we have a copy in inventory |
226 | InventoryItemBase item | 226 | InventoryItemBase item |
227 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); | 227 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); |
228 | Assert.That(item, Is.Not.Null); | 228 | Assert.That(item, Is.Not.Null); |
229 | } | 229 | } |
@@ -245,7 +245,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
245 | 245 | ||
246 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 246 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
247 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | 247 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; |
248 | sogd.Enabled = false; | 248 | sogd.Enabled = false; |
249 | 249 | ||
250 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); | 250 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", TestHelpers.ParseTail(0x2)); |
251 | uint soLocalId = so.LocalId; | 251 | uint soLocalId = so.LocalId; |
@@ -272,11 +272,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
272 | sogd.InventoryDeQueueAndDelete(); | 272 | sogd.InventoryDeQueueAndDelete(); |
273 | // Check that object is still there. | 273 | // Check that object is still there. |
274 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | 274 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
275 | Assert.That(retrievedPart2, Is.Not.Null); | 275 | Assert.That(retrievedPart2, Is.Not.Null); |
276 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); | 276 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); |
277 | 277 | ||
278 | // Check that we have a copy in inventory | 278 | // Check that we have a copy in inventory |
279 | InventoryItemBase item | 279 | InventoryItemBase item |
280 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); | 280 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); |
281 | Assert.That(item, Is.Null); | 281 | Assert.That(item, Is.Null); |
282 | } | 282 | } |
@@ -303,11 +303,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
303 | sogd.InventoryDeQueueAndDelete(); | 303 | sogd.InventoryDeQueueAndDelete(); |
304 | // Check that object is still there. | 304 | // Check that object is still there. |
305 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | 305 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
306 | Assert.That(retrievedPart2, Is.Not.Null); | 306 | Assert.That(retrievedPart2, Is.Not.Null); |
307 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); | 307 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); |
308 | 308 | ||
309 | // Check that we have a copy in inventory | 309 | // Check that we have a copy in inventory |
310 | InventoryItemBase item | 310 | InventoryItemBase item |
311 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); | 311 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); |
312 | Assert.That(item, Is.Null); | 312 | Assert.That(item, Is.Null); |
313 | } | 313 | } |
@@ -334,11 +334,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
334 | sogd.InventoryDeQueueAndDelete(); | 334 | sogd.InventoryDeQueueAndDelete(); |
335 | // Check that object is still there. | 335 | // Check that object is still there. |
336 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | 336 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
337 | Assert.That(retrievedPart2, Is.Not.Null); | 337 | Assert.That(retrievedPart2, Is.Not.Null); |
338 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); | 338 | Assert.That(client.ReceivedKills.Count, Is.EqualTo(0)); |
339 | 339 | ||
340 | // Check that we have a copy in inventory | 340 | // Check that we have a copy in inventory |
341 | InventoryItemBase item | 341 | InventoryItemBase item |
342 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); | 342 | = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, ua.PrincipalID, "Objects/so1"); |
343 | Assert.That(item, Is.Null); | 343 | Assert.That(item, Is.Null); |
344 | } | 344 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs index 4a98746..e1e973c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs | |||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
98 | 98 | ||
99 | // crossing is async | 99 | // crossing is async |
100 | Thread.Sleep(500); | 100 | Thread.Sleep(500); |
101 | 101 | ||
102 | Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id)); | 102 | Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id)); |
103 | Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id)); | 103 | Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id)); |
104 | } | 104 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index f0debd0..b84ecac 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | |||
@@ -77,19 +77,19 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
77 | public void TestDeRezSceneObject() | 77 | public void TestDeRezSceneObject() |
78 | { | 78 | { |
79 | TestHelpers.InMethod(); | 79 | TestHelpers.InMethod(); |
80 | 80 | ||
81 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); | 81 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); |
82 | 82 | ||
83 | TestScene scene = new SceneHelpers().SetupScene(); | 83 | TestScene scene = new SceneHelpers().SetupScene(); |
84 | IConfigSource configSource = new IniConfigSource(); | 84 | IConfigSource configSource = new IniConfigSource(); |
85 | IConfig config = configSource.AddConfig("Startup"); | 85 | IConfig config = configSource.AddConfig("Startup"); |
86 | config.Set("serverside_object_permissions", true); | 86 | config.Set("serverside_object_permissions", true); |
87 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); | 87 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); |
88 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 88 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; |
89 | 89 | ||
90 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 90 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
91 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | 91 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; |
92 | sogd.Enabled = false; | 92 | sogd.Enabled = false; |
93 | 93 | ||
94 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", userId); | 94 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", userId); |
95 | uint soLocalId = so.LocalId; | 95 | uint soLocalId = so.LocalId; |
@@ -104,9 +104,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
104 | // Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); | 104 | // Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); |
105 | 105 | ||
106 | sogd.InventoryDeQueueAndDelete(); | 106 | sogd.InventoryDeQueueAndDelete(); |
107 | 107 | ||
108 | // SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); | 108 | // SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); |
109 | Assert.That(retrievedPart, Is.Null); | 109 | Assert.That(retrievedPart, Is.Null); |
110 | } | 110 | } |
111 | 111 | ||
112 | /// <summary> | 112 | /// <summary> |
@@ -154,48 +154,48 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
154 | 154 | ||
155 | sceneA.DeleteSceneObject(so, false); | 155 | sceneA.DeleteSceneObject(so, false); |
156 | } | 156 | } |
157 | 157 | ||
158 | /// <summary> | 158 | /// <summary> |
159 | /// Test deleting an object from a scene where the deleter is not the owner | 159 | /// Test deleting an object from a scene where the deleter is not the owner |
160 | /// </summary> | 160 | /// </summary> |
161 | /// <remarks> | 161 | /// <remarks> |
162 | /// This test assumes that the deleter is not a god. | 162 | /// This test assumes that the deleter is not a god. |
163 | /// </remarks> | 163 | /// </remarks> |
164 | [Test] | 164 | [Test] |
165 | public void TestDeRezSceneObjectNotOwner() | 165 | public void TestDeRezSceneObjectNotOwner() |
166 | { | 166 | { |
167 | TestHelpers.InMethod(); | 167 | TestHelpers.InMethod(); |
168 | // log4net.Config.XmlConfigurator.Configure(); | 168 | // log4net.Config.XmlConfigurator.Configure(); |
169 | 169 | ||
170 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); | 170 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); |
171 | UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); | 171 | UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); |
172 | 172 | ||
173 | TestScene scene = new SceneHelpers().SetupScene(); | 173 | TestScene scene = new SceneHelpers().SetupScene(); |
174 | IConfigSource configSource = new IniConfigSource(); | 174 | IConfigSource configSource = new IniConfigSource(); |
175 | IConfig config = configSource.AddConfig("Startup"); | 175 | IConfig config = configSource.AddConfig("Startup"); |
176 | config.Set("serverside_object_permissions", true); | 176 | config.Set("serverside_object_permissions", true); |
177 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); | 177 | SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new DefaultPermissionsModule() }); |
178 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 178 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; |
179 | 179 | ||
180 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | 180 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. |
181 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | 181 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; |
182 | sogd.Enabled = false; | 182 | sogd.Enabled = false; |
183 | 183 | ||
184 | SceneObjectPart part | 184 | SceneObjectPart part |
185 | = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); | 185 | = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); |
186 | part.Name = "obj1"; | 186 | part.Name = "obj1"; |
187 | scene.AddNewSceneObject(new SceneObjectGroup(part), false); | 187 | scene.AddNewSceneObject(new SceneObjectGroup(part), false); |
188 | List<uint> localIds = new List<uint>(); | 188 | List<uint> localIds = new List<uint>(); |
189 | localIds.Add(part.LocalId); | 189 | localIds.Add(part.LocalId); |
190 | 190 | ||
191 | scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); | 191 | scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); |
192 | sogd.InventoryDeQueueAndDelete(); | 192 | sogd.InventoryDeQueueAndDelete(); |
193 | 193 | ||
194 | // Object should still be in the scene. | 194 | // Object should still be in the scene. |
195 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 195 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); |
196 | Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); | 196 | Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); |
197 | } | 197 | } |
198 | 198 | ||
199 | /// <summary> | 199 | /// <summary> |
200 | /// Test deleting an object asynchronously to user inventory. | 200 | /// Test deleting an object asynchronously to user inventory. |
201 | /// </summary> | 201 | /// </summary> |
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
211 | TestScene scene = new SceneHelpers().SetupScene(); | 211 | TestScene scene = new SceneHelpers().SetupScene(); |
212 | 212 | ||
213 | IConfigSource configSource = new IniConfigSource(); | 213 | IConfigSource configSource = new IniConfigSource(); |
214 | IConfig config = configSource.AddConfig("Modules"); | 214 | IConfig config = configSource.AddConfig("Modules"); |
215 | config.Set("InventoryAccessModule", "BasicInventoryAccessModule"); | 215 | config.Set("InventoryAccessModule", "BasicInventoryAccessModule"); |
216 | SceneHelpers.SetupSceneModules( | 216 | SceneHelpers.SetupSceneModules( |
217 | scene, configSource, new object[] { new BasicInventoryAccessModule() }); | 217 | scene, configSource, new object[] { new BasicInventoryAccessModule() }); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 1718734..41f61ac 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -66,8 +66,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
66 | public void TestLinkDelink2SceneObjects() | 66 | public void TestLinkDelink2SceneObjects() |
67 | { | 67 | { |
68 | TestHelpers.InMethod(); | 68 | TestHelpers.InMethod(); |
69 | 69 | ||
70 | bool debugtest = false; | 70 | bool debugtest = false; |
71 | 71 | ||
72 | Scene scene = new SceneHelpers().SetupScene(); | 72 | Scene scene = new SceneHelpers().SetupScene(); |
73 | SceneObjectGroup grp1 = SceneHelpers.AddSceneObject(scene); | 73 | SceneObjectGroup grp1 = SceneHelpers.AddSceneObject(scene); |
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
83 | 83 | ||
84 | // <180,0,0> | 84 | // <180,0,0> |
85 | grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0)); | 85 | grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0)); |
86 | 86 | ||
87 | // Required for linking | 87 | // Required for linking |
88 | grp1.RootPart.ClearUpdateSchedule(); | 88 | grp1.RootPart.ClearUpdateSchedule(); |
89 | grp2.RootPart.ClearUpdateSchedule(); | 89 | grp2.RootPart.ClearUpdateSchedule(); |
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
111 | } | 111 | } |
112 | 112 | ||
113 | // root part should have no offset position or rotation | 113 | // root part should have no offset position or rotation |
114 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, | 114 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, |
115 | "root part should have no offset position or rotation"); | 115 | "root part should have no offset position or rotation"); |
116 | 116 | ||
117 | // offset position should be root part position - part2.absolute position. | 117 | // offset position should be root part position - part2.absolute position. |
@@ -125,13 +125,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
125 | // There's a euler anomoly at 180, 0, 0 so expect 180 to turn into -180. | 125 | // There's a euler anomoly at 180, 0, 0 so expect 180 to turn into -180. |
126 | part1.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); | 126 | part1.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); |
127 | Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); | 127 | Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); |
128 | 128 | ||
129 | if (debugtest) | 129 | if (debugtest) |
130 | m_log.Debug(rotEuler1); | 130 | m_log.Debug(rotEuler1); |
131 | 131 | ||
132 | part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); | 132 | part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); |
133 | Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); | 133 | Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); |
134 | 134 | ||
135 | if (debugtest) | 135 | if (debugtest) |
136 | m_log.Debug(rotEuler2); | 136 | m_log.Debug(rotEuler2); |
137 | 137 | ||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
153 | public void TestLinkDelink2groups4SceneObjects() | 153 | public void TestLinkDelink2groups4SceneObjects() |
154 | { | 154 | { |
155 | TestHelpers.InMethod(); | 155 | TestHelpers.InMethod(); |
156 | 156 | ||
157 | bool debugtest = false; | 157 | bool debugtest = false; |
158 | 158 | ||
159 | Scene scene = new SceneHelpers().SetupScene(); | 159 | Scene scene = new SceneHelpers().SetupScene(); |
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
194 | 194 | ||
195 | // Link grp4 to grp3. | 195 | // Link grp4 to grp3. |
196 | grp3.LinkToGroup(grp4); | 196 | grp3.LinkToGroup(grp4); |
197 | 197 | ||
198 | // At this point we should have 4 parts total in two groups. | 198 | // At this point we should have 4 parts total in two groups. |
199 | Assert.That(grp1.Parts.Length == 2, "Group1 children count should be 2"); | 199 | Assert.That(grp1.Parts.Length == 2, "Group1 children count should be 2"); |
200 | Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); | 200 | Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
202 | Assert.That(grp3.Parts.Length == 2, "Group3 children count should be 2"); | 202 | Assert.That(grp3.Parts.Length == 2, "Group3 children count should be 2"); |
203 | Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); | 203 | Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); |
204 | Assert.That(grp4.Parts.Length, Is.EqualTo(0), "Group 4 still contained parts after delink."); | 204 | Assert.That(grp4.Parts.Length, Is.EqualTo(0), "Group 4 still contained parts after delink."); |
205 | 205 | ||
206 | if (debugtest) | 206 | if (debugtest) |
207 | { | 207 | { |
208 | m_log.Debug("--------After Link-------"); | 208 | m_log.Debug("--------After Link-------"); |
@@ -273,13 +273,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
273 | Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1"); | 273 | Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1"); |
274 | Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2"); | 274 | Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2"); |
275 | Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); | 275 | Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); |
276 | Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) | 276 | Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) |
277 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) | 277 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) |
278 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) | 278 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) |
279 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003), | 279 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003), |
280 | "Badness 3"); | 280 | "Badness 3"); |
281 | } | 281 | } |
282 | 282 | ||
283 | /// <summary> | 283 | /// <summary> |
284 | /// Test that a new scene object which is already linked is correctly persisted to the persistence layer. | 284 | /// Test that a new scene object which is already linked is correctly persisted to the persistence layer. |
285 | /// </summary> | 285 | /// </summary> |
@@ -288,37 +288,37 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
288 | { | 288 | { |
289 | TestHelpers.InMethod(); | 289 | TestHelpers.InMethod(); |
290 | //log4net.Config.XmlConfigurator.Configure(); | 290 | //log4net.Config.XmlConfigurator.Configure(); |
291 | 291 | ||
292 | TestScene scene = new SceneHelpers().SetupScene(); | 292 | TestScene scene = new SceneHelpers().SetupScene(); |
293 | 293 | ||
294 | string rootPartName = "rootpart"; | 294 | string rootPartName = "rootpart"; |
295 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); | 295 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); |
296 | string linkPartName = "linkpart"; | 296 | string linkPartName = "linkpart"; |
297 | UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); | 297 | UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); |
298 | 298 | ||
299 | SceneObjectPart rootPart | 299 | SceneObjectPart rootPart |
300 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 300 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
301 | { Name = rootPartName, UUID = rootPartUuid }; | 301 | { Name = rootPartName, UUID = rootPartUuid }; |
302 | SceneObjectPart linkPart | 302 | SceneObjectPart linkPart |
303 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 303 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
304 | { Name = linkPartName, UUID = linkPartUuid }; | 304 | { Name = linkPartName, UUID = linkPartUuid }; |
305 | 305 | ||
306 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); | 306 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); |
307 | sog.AddPart(linkPart); | 307 | sog.AddPart(linkPart); |
308 | scene.AddNewSceneObject(sog, true); | 308 | scene.AddNewSceneObject(sog, true); |
309 | 309 | ||
310 | // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked | 310 | // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked |
311 | // scene backup thread. | 311 | // scene backup thread. |
312 | scene.Backup(true); | 312 | scene.Backup(true); |
313 | 313 | ||
314 | List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); | 314 | List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); |
315 | 315 | ||
316 | Assert.That(storedObjects.Count, Is.EqualTo(1)); | 316 | Assert.That(storedObjects.Count, Is.EqualTo(1)); |
317 | Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(2)); | 317 | Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(2)); |
318 | Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); | 318 | Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); |
319 | Assert.That(storedObjects[0].ContainsPart(linkPartUuid)); | 319 | Assert.That(storedObjects[0].ContainsPart(linkPartUuid)); |
320 | } | 320 | } |
321 | 321 | ||
322 | /// <summary> | 322 | /// <summary> |
323 | /// Test that a delink of a previously linked object is correctly persisted to the database | 323 | /// Test that a delink of a previously linked object is correctly persisted to the database |
324 | /// </summary> | 324 | /// </summary> |
@@ -327,20 +327,20 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
327 | { | 327 | { |
328 | TestHelpers.InMethod(); | 328 | TestHelpers.InMethod(); |
329 | //log4net.Config.XmlConfigurator.Configure(); | 329 | //log4net.Config.XmlConfigurator.Configure(); |
330 | 330 | ||
331 | TestScene scene = new SceneHelpers().SetupScene(); | 331 | TestScene scene = new SceneHelpers().SetupScene(); |
332 | 332 | ||
333 | string rootPartName = "rootpart"; | 333 | string rootPartName = "rootpart"; |
334 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); | 334 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); |
335 | string linkPartName = "linkpart"; | 335 | string linkPartName = "linkpart"; |
336 | UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); | 336 | UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); |
337 | 337 | ||
338 | SceneObjectPart rootPart | 338 | SceneObjectPart rootPart |
339 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 339 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
340 | { Name = rootPartName, UUID = rootPartUuid }; | 340 | { Name = rootPartName, UUID = rootPartUuid }; |
341 | 341 | ||
342 | SceneObjectPart linkPart | 342 | SceneObjectPart linkPart |
343 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 343 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
344 | { Name = linkPartName, UUID = linkPartUuid }; | 344 | { Name = linkPartName, UUID = linkPartUuid }; |
345 | SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart); | 345 | SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart); |
346 | scene.AddNewSceneObject(linkGroup, true); | 346 | scene.AddNewSceneObject(linkGroup, true); |
@@ -359,7 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
359 | SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); | 359 | SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); |
360 | Assert.IsFalse(groupToDelete.GroupContainsForeignPrims); | 360 | Assert.IsFalse(groupToDelete.GroupContainsForeignPrims); |
361 | 361 | ||
362 | /* backup is async | 362 | /* backup is async |
363 | scene.DeleteSceneObject(groupToDelete, false); | 363 | scene.DeleteSceneObject(groupToDelete, false); |
364 | 364 | ||
365 | List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); | 365 | List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index ec58a5a..c2c7822 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | |||
@@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
137 | Vector3 childPosition = new Vector3(rootPartPosition + rotatedChildOffsetPosition); | 137 | Vector3 childPosition = new Vector3(rootPartPosition + rotatedChildOffsetPosition); |
138 | 138 | ||
139 | SceneObjectPart childPart = so.Parts[1]; | 139 | SceneObjectPart childPart = so.Parts[1]; |
140 | 140 | ||
141 | Assert.That(childPart.AbsolutePosition, Is.EqualTo(childPosition)); | 141 | Assert.That(childPart.AbsolutePosition, Is.EqualTo(childPosition)); |
142 | 142 | ||
143 | Assert.That(childPart.GroupPosition, Is.EqualTo(rootPartPosition)); | 143 | Assert.That(childPart.GroupPosition, Is.EqualTo(rootPartPosition)); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index e98e631..8d88083 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
71 | m_so1.ScriptSetTemporaryStatus(false); | 71 | m_so1.ScriptSetTemporaryStatus(false); |
72 | 72 | ||
73 | Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None)); | 73 | Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None)); |
74 | Assert.That(m_so1.Backup, Is.True); | 74 | Assert.That(m_so1.Backup, Is.True); |
75 | } | 75 | } |
76 | 76 | ||
77 | [Test] | 77 | [Test] |
@@ -91,7 +91,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
91 | 91 | ||
92 | m_so1.ScriptSetPhantomStatus(false); | 92 | m_so1.ScriptSetPhantomStatus(false); |
93 | 93 | ||
94 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); | 94 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); |
95 | } | 95 | } |
96 | 96 | ||
97 | [Test] | 97 | [Test] |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
112 | 112 | ||
113 | m_so1.ScriptSetVolumeDetect(false); | 113 | m_so1.ScriptSetVolumeDetect(false); |
114 | 114 | ||
115 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); | 115 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); |
116 | } | 116 | } |
117 | 117 | ||
118 | [Test] | 118 | [Test] |
@@ -152,9 +152,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
152 | 152 | ||
153 | m_so1.ScriptSetVolumeDetect(false); | 153 | m_so1.ScriptSetVolumeDetect(false); |
154 | 154 | ||
155 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); | 155 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); |
156 | } | 156 | } |
157 | 157 | ||
158 | [Test] | 158 | [Test] |
159 | public void TestSetPhysicsLinkset() | 159 | public void TestSetPhysicsLinkset() |
160 | { | 160 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index a92e364..4ec69cd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | |||
@@ -53,30 +53,30 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
53 | { | 53 | { |
54 | TestHelpers.InMethod(); | 54 | TestHelpers.InMethod(); |
55 | // log4net.Config.XmlConfigurator.Configure(); | 55 | // log4net.Config.XmlConfigurator.Configure(); |
56 | 56 | ||
57 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); | 57 | UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); |
58 | 58 | ||
59 | TestScene scene = new SceneHelpers().SetupScene(); | 59 | TestScene scene = new SceneHelpers().SetupScene(); |
60 | IConfigSource configSource = new IniConfigSource(); | 60 | IConfigSource configSource = new IniConfigSource(); |
61 | 61 | ||
62 | IConfig startupConfig = configSource.AddConfig("Startup"); | 62 | IConfig startupConfig = configSource.AddConfig("Startup"); |
63 | startupConfig.Set("serverside_object_permissions", true); | 63 | startupConfig.Set("serverside_object_permissions", true); |
64 | 64 | ||
65 | IConfig groupsConfig = configSource.AddConfig("Groups"); | 65 | IConfig groupsConfig = configSource.AddConfig("Groups"); |
66 | groupsConfig.Set("Enabled", true); | 66 | groupsConfig.Set("Enabled", true); |
67 | groupsConfig.Set("Module", "GroupsModule"); | 67 | groupsConfig.Set("Module", "GroupsModule"); |
68 | groupsConfig.Set("DebugEnabled", true); | 68 | groupsConfig.Set("DebugEnabled", true); |
69 | 69 | ||
70 | SceneHelpers.SetupSceneModules( | 70 | SceneHelpers.SetupSceneModules( |
71 | scene, configSource, new object[] | 71 | scene, configSource, new object[] |
72 | { new DefaultPermissionsModule(), | 72 | { new DefaultPermissionsModule(), |
73 | new GroupsModule(), | 73 | new GroupsModule(), |
74 | new MockGroupsServicesConnector() }); | 74 | new MockGroupsServicesConnector() }); |
75 | 75 | ||
76 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 76 | IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; |
77 | 77 | ||
78 | IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>(); | 78 | IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>(); |
79 | 79 | ||
80 | groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); | 80 | groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); |
81 | } | 81 | } |
82 | } | 82 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index ada407f..0f386bc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
142 | // Check rest of exepcted parameters. | 142 | // Check rest of exepcted parameters. |
143 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null); | 143 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null); |
144 | Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); | 144 | Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); |
145 | 145 | ||
146 | Assert.That(sp.IsChildAgent, Is.False); | 146 | Assert.That(sp.IsChildAgent, Is.False); |
147 | Assert.That(sp.UUID, Is.EqualTo(spUuid)); | 147 | Assert.That(sp.UUID, Is.EqualTo(spUuid)); |
148 | 148 | ||
@@ -262,9 +262,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
262 | { | 262 | { |
263 | TestHelpers.InMethod(); | 263 | TestHelpers.InMethod(); |
264 | // log4net.Config.XmlConfigurator.Configure(); | 264 | // log4net.Config.XmlConfigurator.Configure(); |
265 | 265 | ||
266 | // UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); | 266 | // UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); |
267 | 267 | ||
268 | TestScene myScene1 = new SceneHelpers().SetupScene("Neighbour y", UUID.Random(), 1000, 1000); | 268 | TestScene myScene1 = new SceneHelpers().SetupScene("Neighbour y", UUID.Random(), 1000, 1000); |
269 | TestScene myScene2 = new SceneHelpers().SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); | 269 | TestScene myScene2 = new SceneHelpers().SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); |
270 | 270 | ||
@@ -279,7 +279,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
279 | 279 | ||
280 | EventQueueGetModule eqgm2 = new EventQueueGetModule(); | 280 | EventQueueGetModule eqgm2 = new EventQueueGetModule(); |
281 | SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2); | 281 | SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2); |
282 | 282 | ||
283 | // SceneHelpers.AddScenePresence(myScene1, agent1Id); | 283 | // SceneHelpers.AddScenePresence(myScene1, agent1Id); |
284 | // ScenePresence childPresence = myScene2.GetScenePresence(agent1); | 284 | // ScenePresence childPresence = myScene2.GetScenePresence(agent1); |
285 | // | 285 | // |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index b8f7458..86500c7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | |||
@@ -465,7 +465,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
465 | teleportLookAt, | 465 | teleportLookAt, |
466 | (uint)TeleportFlags.ViaLocation); | 466 | (uint)TeleportFlags.ViaLocation); |
467 | 467 | ||
468 | // FIXME: Not setting up InformClientOfNeighbour on the TestClient means that it does not initiate | 468 | // FIXME: Not setting up InformClientOfNeighbour on the TestClient means that it does not initiate |
469 | // communication with the destination region. But this is a very non-obvious way of doing it - really we | 469 | // communication with the destination region. But this is a very non-obvious way of doing it - really we |
470 | // should be forced to expicitly set this up. | 470 | // should be forced to expicitly set this up. |
471 | 471 | ||
@@ -627,8 +627,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
627 | // Both these operations will occur on different threads and will wait for each other. | 627 | // Both these operations will occur on different threads and will wait for each other. |
628 | // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 | 628 | // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 |
629 | // test protocol, where we are trying to avoid unpredictable async operations in regression tests. | 629 | // test protocol, where we are trying to avoid unpredictable async operations in regression tests. |
630 | tc.OnTestClientSendRegionTeleport | 630 | tc.OnTestClientSendRegionTeleport |
631 | += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) | 631 | += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) |
632 | => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); | 632 | => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); |
633 | 633 | ||
634 | sceneA.RequestTeleportLocation( | 634 | sceneA.RequestTeleportLocation( |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs index 584a03c..dbb6a37 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTelehubTests.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
70 | // Must still be possible to successfully log in | 70 | // Must still be possible to successfully log in |
71 | UUID loggingInUserId = TestHelpers.ParseTail(0x2); | 71 | UUID loggingInUserId = TestHelpers.ParseTail(0x2); |
72 | 72 | ||
73 | UserAccount ua | 73 | UserAccount ua |
74 | = UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password"); | 74 | = UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password"); |
75 | 75 | ||
76 | SceneHelpers.AddScenePresence(scene, ua); | 76 | SceneHelpers.AddScenePresence(scene, ua); |
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
107 | // Must still be possible to successfully log in | 107 | // Must still be possible to successfully log in |
108 | UUID loggingInUserId = TestHelpers.ParseTail(0x2); | 108 | UUID loggingInUserId = TestHelpers.ParseTail(0x2); |
109 | 109 | ||
110 | UserAccount ua | 110 | UserAccount ua |
111 | = UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password"); | 111 | = UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password"); |
112 | 112 | ||
113 | SceneHelpers.AddScenePresence(scene, ua); | 113 | SceneHelpers.AddScenePresence(scene, ua); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index 517faf1..6c0af8f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
66 | uint sizeX = 512; | 66 | uint sizeX = 512; |
67 | uint sizeY = 512; | 67 | uint sizeY = 512; |
68 | 68 | ||
69 | Scene scene | 69 | Scene scene |
70 | = new SceneHelpers().SetupScene("scene", regionUuid, 1000, 1000, sizeX, sizeY, new IniConfigSource()); | 70 | = new SceneHelpers().SetupScene("scene", regionUuid, 1000, 1000, sizeX, sizeY, new IniConfigSource()); |
71 | 71 | ||
72 | Assert.AreEqual(sizeX, scene.RegionInfo.RegionSizeX); | 72 | Assert.AreEqual(sizeX, scene.RegionInfo.RegionSizeX); |
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
83 | 83 | ||
84 | Scene scene = new SceneHelpers().SetupScene(); | 84 | Scene scene = new SceneHelpers().SetupScene(); |
85 | scene.Update(1); | 85 | scene.Update(1); |
86 | 86 | ||
87 | Assert.That(scene.Frame, Is.EqualTo(1)); | 87 | Assert.That(scene.Frame, Is.EqualTo(1)); |
88 | } | 88 | } |
89 | 89 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs index eeda84f..c74c83f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs | |||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
105 | // rmcp.LoadModulesFromAddins = false; | 105 | // rmcp.LoadModulesFromAddins = false; |
106 | //// reg.RegisterInterface<IRegionModulesController>(rmcp); | 106 | //// reg.RegisterInterface<IRegionModulesController>(rmcp); |
107 | // rmcp.Initialise(sim); | 107 | // rmcp.Initialise(sim); |
108 | // rmcp.PostInitialise(); | 108 | // rmcp.PostInitialise(); |
109 | // TypeExtensionNode node = new TypeExtensionNode(); | 109 | // TypeExtensionNode node = new TypeExtensionNode(); |
110 | // node. | 110 | // node. |
111 | // rmcp.AddNode(node, configSource.Configs["Modules"], new Dictionary<RuntimeAddin, IList<int>>()); | 111 | // rmcp.AddNode(node, configSource.Configs["Modules"], new Dictionary<RuntimeAddin, IList<int>>()); |
@@ -120,9 +120,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
120 | int expectedEventCount = 6; | 120 | int expectedEventCount = 6; |
121 | 121 | ||
122 | Assert.AreEqual( | 122 | Assert.AreEqual( |
123 | expectedEventCount, | 123 | expectedEventCount, |
124 | co.Count, | 124 | co.Count, |
125 | "Expected {0} events but only got {1} ({2})", | 125 | "Expected {0} events but only got {1} ({2})", |
126 | expectedEventCount, co.Count, string.Join(",", co)); | 126 | expectedEventCount, co.Count, string.Join(",", co)); |
127 | Assert.AreEqual("Initialise", co[0]); | 127 | Assert.AreEqual("Initialise", co[0]); |
128 | Assert.AreEqual("PostInitialise", co[1]); | 128 | Assert.AreEqual("PostInitialise", co[1]); |
@@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
137 | { | 137 | { |
138 | // FIXME: Should really use MethodInfo | 138 | // FIXME: Should really use MethodInfo |
139 | public List<string> CallOrder = new List<string>(); | 139 | public List<string> CallOrder = new List<string>(); |
140 | 140 | ||
141 | public string Name { get { return "TestSharedRegion"; } } | 141 | public string Name { get { return "TestSharedRegion"; } } |
142 | 142 | ||
143 | public Type ReplaceableInterface { get { return null; } } | 143 | public Type ReplaceableInterface { get { return null; } } |
@@ -186,13 +186,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
186 | 186 | ||
187 | public void Initialise() {} | 187 | public void Initialise() {} |
188 | 188 | ||
189 | public void Initialise(OpenSimBase sim) | 189 | public void Initialise(OpenSimBase sim) |
190 | { | 190 | { |
191 | m_openSim = sim; | 191 | m_openSim = sim; |
192 | } | 192 | } |
193 | 193 | ||
194 | /// <summary> | 194 | /// <summary> |
195 | /// Called when the application loading is completed | 195 | /// Called when the application loading is completed |
196 | /// </summary> | 196 | /// </summary> |
197 | public void PostInitialise() | 197 | public void PostInitialise() |
198 | { | 198 | { |
@@ -228,8 +228,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
228 | } | 228 | } |
229 | 229 | ||
230 | scene.RegionModules.Clear(); | 230 | scene.RegionModules.Clear(); |
231 | } | 231 | } |
232 | 232 | ||
233 | public void AddNode(ISharedRegionModule module) | 233 | public void AddNode(ISharedRegionModule module) |
234 | { | 234 | { |
235 | m_sharedInstances.Add(module); | 235 | m_sharedInstances.Add(module); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 33a630c..8273e32 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Tests | |||
55 | { | 55 | { |
56 | TestHelpers.InMethod(); | 56 | TestHelpers.InMethod(); |
57 | // log4net.Config.XmlConfigurator.Configure(); | 57 | // log4net.Config.XmlConfigurator.Configure(); |
58 | 58 | ||
59 | Scene scene = new SceneHelpers().SetupScene(); | 59 | Scene scene = new SceneHelpers().SetupScene(); |
60 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); | 60 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); |
61 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); | 61 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); |
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Framework.Tests | |||
78 | { | 78 | { |
79 | TestHelpers.InMethod(); | 79 | TestHelpers.InMethod(); |
80 | // log4net.Config.XmlConfigurator.Configure(); | 80 | // log4net.Config.XmlConfigurator.Configure(); |
81 | 81 | ||
82 | Scene scene = new SceneHelpers().SetupScene(); | 82 | Scene scene = new SceneHelpers().SetupScene(); |
83 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); | 83 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); |
84 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); | 84 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); |
@@ -121,7 +121,7 @@ namespace OpenSim.Region.Framework.Tests | |||
121 | { | 121 | { |
122 | TestHelpers.InMethod(); | 122 | TestHelpers.InMethod(); |
123 | // log4net.Config.XmlConfigurator.Configure(); | 123 | // log4net.Config.XmlConfigurator.Configure(); |
124 | 124 | ||
125 | Scene scene = new SceneHelpers().SetupScene(); | 125 | Scene scene = new SceneHelpers().SetupScene(); |
126 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); | 126 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); |
127 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); | 127 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); |
@@ -130,18 +130,18 @@ namespace OpenSim.Region.Framework.Tests | |||
130 | = TaskInventoryHelpers.AddNotecard( | 130 | = TaskInventoryHelpers.AddNotecard( |
131 | scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); | 131 | scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
132 | 132 | ||
133 | InventoryFolderBase folder | 133 | InventoryFolderBase folder |
134 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; | 134 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; |
135 | 135 | ||
136 | // Perform test | 136 | // Perform test |
137 | string message; | 137 | string message; |
138 | scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID, out message); | 138 | scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID, out message); |
139 | 139 | ||
140 | InventoryItemBase ncUserItem | 140 | InventoryItemBase ncUserItem |
141 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem"); | 141 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem"); |
142 | Assert.That(ncUserItem, Is.Not.Null, "Objects/ncItem was not found"); | 142 | Assert.That(ncUserItem, Is.Not.Null, "Objects/ncItem was not found"); |
143 | } | 143 | } |
144 | 144 | ||
145 | /// <summary> | 145 | /// <summary> |
146 | /// Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent folder assigned. | 146 | /// Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent folder assigned. |
147 | /// </summary> | 147 | /// </summary> |
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Tests | |||
153 | { | 153 | { |
154 | TestHelpers.InMethod(); | 154 | TestHelpers.InMethod(); |
155 | // log4net.Config.XmlConfigurator.Configure(); | 155 | // log4net.Config.XmlConfigurator.Configure(); |
156 | 156 | ||
157 | Scene scene = new SceneHelpers().SetupScene(); | 157 | Scene scene = new SceneHelpers().SetupScene(); |
158 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); | 158 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); |
159 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); | 159 | SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); |
@@ -162,11 +162,11 @@ namespace OpenSim.Region.Framework.Tests | |||
162 | TaskInventoryItem sopItem1 | 162 | TaskInventoryItem sopItem1 |
163 | = TaskInventoryHelpers.AddNotecard( | 163 | = TaskInventoryHelpers.AddNotecard( |
164 | scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); | 164 | scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
165 | 165 | ||
166 | // Perform test | 166 | // Perform test |
167 | string message; | 167 | string message; |
168 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID, out message); | 168 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID, out message); |
169 | 169 | ||
170 | InventoryItemBase ncUserItem | 170 | InventoryItemBase ncUserItem |
171 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Notecards/ncItem"); | 171 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Notecards/ncItem"); |
172 | Assert.That(ncUserItem, Is.Not.Null, "Notecards/ncItem was not found"); | 172 | Assert.That(ncUserItem, Is.Not.Null, "Notecards/ncItem was not found"); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs index 142ad84..58e157c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs | |||
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Tests | |||
113 | { | 113 | { |
114 | TestHelpers.InMethod(); | 114 | TestHelpers.InMethod(); |
115 | // TestHelpers.EnableLogging(); | 115 | // TestHelpers.EnableLogging(); |
116 | 116 | ||
117 | Scene scene = new SceneHelpers().SetupScene(); | 117 | Scene scene = new SceneHelpers().SetupScene(); |
118 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); | 118 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); |
119 | UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); | 119 | UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 937c414..4ceebc1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
41 | { | 41 | { |
42 | protected IAssetService m_assetService; | 42 | protected IAssetService m_assetService; |
43 | protected UuidGatherer m_uuidGatherer; | 43 | protected UuidGatherer m_uuidGatherer; |
44 | 44 | ||
45 | [SetUp] | 45 | [SetUp] |
46 | public void Init() | 46 | public void Init() |
47 | { | 47 | { |
@@ -55,9 +55,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
55 | public void TestCorruptAsset() | 55 | public void TestCorruptAsset() |
56 | { | 56 | { |
57 | TestHelpers.InMethod(); | 57 | TestHelpers.InMethod(); |
58 | 58 | ||
59 | UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); | 59 | UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); |
60 | AssetBase corruptAsset | 60 | AssetBase corruptAsset |
61 | = AssetHelpers.CreateAsset(corruptAssetUuid, AssetType.Notecard, "CORRUPT ASSET", UUID.Zero); | 61 | = AssetHelpers.CreateAsset(corruptAssetUuid, AssetType.Notecard, "CORRUPT ASSET", UUID.Zero); |
62 | m_assetService.Store(corruptAsset); | 62 | m_assetService.Store(corruptAsset); |
63 | 63 | ||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
67 | // We count the uuid as gathered even if the asset itself is corrupt. | 67 | // We count the uuid as gathered even if the asset itself is corrupt. |
68 | Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(1)); | 68 | Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(1)); |
69 | } | 69 | } |
70 | 70 | ||
71 | /// <summary> | 71 | /// <summary> |
72 | /// Test requests made for non-existent assets while we're gathering | 72 | /// Test requests made for non-existent assets while we're gathering |
73 | /// </summary> | 73 | /// </summary> |
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
75 | public void TestMissingAsset() | 75 | public void TestMissingAsset() |
76 | { | 76 | { |
77 | TestHelpers.InMethod(); | 77 | TestHelpers.InMethod(); |
78 | 78 | ||
79 | UUID missingAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); | 79 | UUID missingAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); |
80 | 80 | ||
81 | m_uuidGatherer.AddForInspection(missingAssetUuid); | 81 | m_uuidGatherer.AddForInspection(missingAssetUuid); |
@@ -89,23 +89,23 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
89 | { | 89 | { |
90 | TestHelpers.InMethod(); | 90 | TestHelpers.InMethod(); |
91 | // TestHelpers.EnableLogging(); | 91 | // TestHelpers.EnableLogging(); |
92 | 92 | ||
93 | UUID ownerId = TestHelpers.ParseTail(0x10); | 93 | UUID ownerId = TestHelpers.ParseTail(0x10); |
94 | UUID embeddedId = TestHelpers.ParseTail(0x20); | 94 | UUID embeddedId = TestHelpers.ParseTail(0x20); |
95 | UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); | 95 | UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); |
96 | UUID missingEmbeddedId = TestHelpers.ParseTail(0x22); | 96 | UUID missingEmbeddedId = TestHelpers.ParseTail(0x22); |
97 | UUID ncAssetId = TestHelpers.ParseTail(0x30); | 97 | UUID ncAssetId = TestHelpers.ParseTail(0x30); |
98 | 98 | ||
99 | AssetBase ncAsset | 99 | AssetBase ncAsset |
100 | = AssetHelpers.CreateNotecardAsset( | 100 | = AssetHelpers.CreateNotecardAsset( |
101 | ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); | 101 | ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); |
102 | m_assetService.Store(ncAsset); | 102 | m_assetService.Store(ncAsset); |
103 | 103 | ||
104 | AssetBase embeddedAsset | 104 | AssetBase embeddedAsset |
105 | = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId)); | 105 | = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId)); |
106 | m_assetService.Store(embeddedAsset); | 106 | m_assetService.Store(embeddedAsset); |
107 | 107 | ||
108 | AssetBase secondLevelEmbeddedAsset | 108 | AssetBase secondLevelEmbeddedAsset |
109 | = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when."); | 109 | = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when."); |
110 | m_assetService.Store(secondLevelEmbeddedAsset); | 110 | m_assetService.Store(secondLevelEmbeddedAsset); |
111 | 111 | ||