diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs index 7ddc396..82ed091 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs | |||
@@ -44,9 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
44 | { | 44 | { |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class InventoryTransferModuleTests : OpenSimTestCase | 46 | public class InventoryTransferModuleTests : OpenSimTestCase |
47 | { | 47 | { |
48 | protected TestScene m_scene; | 48 | protected TestScene m_scene; |
49 | 49 | ||
50 | [SetUp] | 50 | [SetUp] |
51 | public override void SetUp() | 51 | public override void SetUp() |
52 | { | 52 | { |
@@ -56,9 +56,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
56 | config.AddConfig("Messaging"); | 56 | config.AddConfig("Messaging"); |
57 | config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); | 57 | config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); |
58 | 58 | ||
59 | m_scene = new SceneHelpers().SetupScene(); | 59 | m_scene = new SceneHelpers().SetupScene(); |
60 | SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule()); | 60 | SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule()); |
61 | } | 61 | } |
62 | 62 | ||
63 | [Test] | 63 | [Test] |
64 | public void TestAcceptGivenItem() | 64 | public void TestAcceptGivenItem() |
@@ -69,9 +69,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
69 | UUID itemId = TestHelpers.ParseTail(0x100); | 69 | UUID itemId = TestHelpers.ParseTail(0x100); |
70 | UUID assetId = TestHelpers.ParseTail(0x200); | 70 | UUID assetId = TestHelpers.ParseTail(0x200); |
71 | 71 | ||
72 | UserAccount ua1 | 72 | UserAccount ua1 |
73 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 73 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
74 | UserAccount ua2 | 74 | UserAccount ua2 |
75 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 75 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
76 | 76 | ||
77 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 77 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
81 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 81 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
82 | 82 | ||
83 | // Create the object to test give | 83 | // Create the object to test give |
84 | InventoryItemBase originalItem | 84 | InventoryItemBase originalItem |
85 | = UserInventoryHelpers.CreateInventoryItem( | 85 | = UserInventoryHelpers.CreateInventoryItem( |
86 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); | 86 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); |
87 | 87 | ||
@@ -89,35 +89,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
89 | byte[] itemIdBytes = itemId.GetBytes(); | 89 | byte[] itemIdBytes = itemId.GetBytes(); |
90 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 90 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
91 | 91 | ||
92 | GridInstantMessage giveIm | 92 | GridInstantMessage giveIm |
93 | = new GridInstantMessage( | 93 | = new GridInstantMessage( |
94 | m_scene, | 94 | m_scene, |
95 | giverSp.UUID, | 95 | giverSp.UUID, |
96 | giverSp.Name, | 96 | giverSp.Name, |
97 | receiverSp.UUID, | 97 | receiverSp.UUID, |
98 | (byte)InstantMessageDialog.InventoryOffered, | 98 | (byte)InstantMessageDialog.InventoryOffered, |
99 | false, | 99 | false, |
100 | "inventory offered msg", | 100 | "inventory offered msg", |
101 | initialSessionId, | 101 | initialSessionId, |
102 | false, | 102 | false, |
103 | Vector3.Zero, | 103 | Vector3.Zero, |
104 | giveImBinaryBucket, | 104 | giveImBinaryBucket, |
105 | true); | 105 | true); |
106 | 106 | ||
107 | giverClient.HandleImprovedInstantMessage(giveIm); | 107 | giverClient.HandleImprovedInstantMessage(giveIm); |
108 | 108 | ||
109 | // These details might not all be correct. | 109 | // These details might not all be correct. |
110 | GridInstantMessage acceptIm | 110 | GridInstantMessage acceptIm |
111 | = new GridInstantMessage( | 111 | = new GridInstantMessage( |
112 | m_scene, | 112 | m_scene, |
113 | receiverSp.UUID, | 113 | receiverSp.UUID, |
114 | receiverSp.Name, | 114 | receiverSp.Name, |
115 | giverSp.UUID, | 115 | giverSp.UUID, |
116 | (byte)InstantMessageDialog.InventoryAccepted, | 116 | (byte)InstantMessageDialog.InventoryAccepted, |
117 | false, | 117 | false, |
118 | "inventory accepted msg", | 118 | "inventory accepted msg", |
119 | initialSessionId, | 119 | initialSessionId, |
120 | false, | 120 | false, |
121 | Vector3.Zero, | 121 | Vector3.Zero, |
122 | null, | 122 | null, |
123 | true); | 123 | true); |
@@ -133,7 +133,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
133 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); | 133 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); |
134 | 134 | ||
135 | // Test for item successfully making it into the receiver's inventory | 135 | // Test for item successfully making it into the receiver's inventory |
136 | InventoryItemBase receivedItem | 136 | InventoryItemBase receivedItem |
137 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj"); | 137 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj"); |
138 | 138 | ||
139 | Assert.That(receivedItem, Is.Not.Null); | 139 | Assert.That(receivedItem, Is.Not.Null); |
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
148 | Assert.That(originalItemAfterDelete, Is.Not.Null); | 148 | Assert.That(originalItemAfterDelete, Is.Not.Null); |
149 | 149 | ||
150 | // TODO: Test scenario where giver deletes their item first. | 150 | // TODO: Test scenario where giver deletes their item first. |
151 | } | 151 | } |
152 | 152 | ||
153 | /// <summary> | 153 | /// <summary> |
154 | /// Test user rejection of a given item. | 154 | /// Test user rejection of a given item. |
@@ -165,9 +165,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
165 | UUID itemId = TestHelpers.ParseTail(0x100); | 165 | UUID itemId = TestHelpers.ParseTail(0x100); |
166 | UUID assetId = TestHelpers.ParseTail(0x200); | 166 | UUID assetId = TestHelpers.ParseTail(0x200); |
167 | 167 | ||
168 | UserAccount ua1 | 168 | UserAccount ua1 |
169 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 169 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
170 | UserAccount ua2 | 170 | UserAccount ua2 |
171 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 171 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
172 | 172 | ||
173 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 173 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
177 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 177 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
178 | 178 | ||
179 | // Create the object to test give | 179 | // Create the object to test give |
180 | InventoryItemBase originalItem | 180 | InventoryItemBase originalItem |
181 | = UserInventoryHelpers.CreateInventoryItem( | 181 | = UserInventoryHelpers.CreateInventoryItem( |
182 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); | 182 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); |
183 | 183 | ||
@@ -188,36 +188,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
188 | byte[] itemIdBytes = itemId.GetBytes(); | 188 | byte[] itemIdBytes = itemId.GetBytes(); |
189 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 189 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
190 | 190 | ||
191 | GridInstantMessage giveIm | 191 | GridInstantMessage giveIm |
192 | = new GridInstantMessage( | 192 | = new GridInstantMessage( |
193 | m_scene, | 193 | m_scene, |
194 | giverSp.UUID, | 194 | giverSp.UUID, |
195 | giverSp.Name, | 195 | giverSp.Name, |
196 | receiverSp.UUID, | 196 | receiverSp.UUID, |
197 | (byte)InstantMessageDialog.InventoryOffered, | 197 | (byte)InstantMessageDialog.InventoryOffered, |
198 | false, | 198 | false, |
199 | "inventory offered msg", | 199 | "inventory offered msg", |
200 | initialSessionId, | 200 | initialSessionId, |
201 | false, | 201 | false, |
202 | Vector3.Zero, | 202 | Vector3.Zero, |
203 | giveImBinaryBucket, | 203 | giveImBinaryBucket, |
204 | true); | 204 | true); |
205 | 205 | ||
206 | giverClient.HandleImprovedInstantMessage(giveIm); | 206 | giverClient.HandleImprovedInstantMessage(giveIm); |
207 | 207 | ||
208 | // These details might not all be correct. | 208 | // These details might not all be correct. |
209 | // Session ID is now the created item ID (!) | 209 | // Session ID is now the created item ID (!) |
210 | GridInstantMessage rejectIm | 210 | GridInstantMessage rejectIm |
211 | = new GridInstantMessage( | 211 | = new GridInstantMessage( |
212 | m_scene, | 212 | m_scene, |
213 | receiverSp.UUID, | 213 | receiverSp.UUID, |
214 | receiverSp.Name, | 214 | receiverSp.Name, |
215 | giverSp.UUID, | 215 | giverSp.UUID, |
216 | (byte)InstantMessageDialog.InventoryDeclined, | 216 | (byte)InstantMessageDialog.InventoryDeclined, |
217 | false, | 217 | false, |
218 | "inventory declined msg", | 218 | "inventory declined msg", |
219 | new UUID(receivedIm.imSessionID), | 219 | new UUID(receivedIm.imSessionID), |
220 | false, | 220 | false, |
221 | Vector3.Zero, | 221 | Vector3.Zero, |
222 | null, | 222 | null, |
223 | true); | 223 | true); |
@@ -233,7 +233,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
233 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); | 233 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); |
234 | 234 | ||
235 | // Test for item successfully making it into the receiver's inventory | 235 | // Test for item successfully making it into the receiver's inventory |
236 | InventoryItemBase receivedItem | 236 | InventoryItemBase receivedItem |
237 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); | 237 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); |
238 | 238 | ||
239 | InventoryFolderBase trashFolder | 239 | InventoryFolderBase trashFolder |
@@ -250,7 +250,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
250 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); | 250 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); |
251 | 251 | ||
252 | Assert.That(originalItemAfterDelete, Is.Not.Null); | 252 | Assert.That(originalItemAfterDelete, Is.Not.Null); |
253 | } | 253 | } |
254 | 254 | ||
255 | [Test] | 255 | [Test] |
256 | public void TestAcceptGivenFolder() | 256 | public void TestAcceptGivenFolder() |
@@ -261,9 +261,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
261 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | 261 | UUID initialSessionId = TestHelpers.ParseTail(0x10); |
262 | UUID folderId = TestHelpers.ParseTail(0x100); | 262 | UUID folderId = TestHelpers.ParseTail(0x100); |
263 | 263 | ||
264 | UserAccount ua1 | 264 | UserAccount ua1 |
265 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 265 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
266 | UserAccount ua2 | 266 | UserAccount ua2 |
267 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 267 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
268 | 268 | ||
269 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 269 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
272 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); | 272 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); |
273 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 273 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
274 | 274 | ||
275 | InventoryFolderBase originalFolder | 275 | InventoryFolderBase originalFolder |
276 | = UserInventoryHelpers.CreateInventoryFolder( | 276 | = UserInventoryHelpers.CreateInventoryFolder( |
277 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); | 277 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); |
278 | 278 | ||
@@ -281,35 +281,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
281 | byte[] itemIdBytes = folderId.GetBytes(); | 281 | byte[] itemIdBytes = folderId.GetBytes(); |
282 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 282 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
283 | 283 | ||
284 | GridInstantMessage giveIm | 284 | GridInstantMessage giveIm |
285 | = new GridInstantMessage( | 285 | = new GridInstantMessage( |
286 | m_scene, | 286 | m_scene, |
287 | giverSp.UUID, | 287 | giverSp.UUID, |
288 | giverSp.Name, | 288 | giverSp.Name, |
289 | receiverSp.UUID, | 289 | receiverSp.UUID, |
290 | (byte)InstantMessageDialog.InventoryOffered, | 290 | (byte)InstantMessageDialog.InventoryOffered, |
291 | false, | 291 | false, |
292 | "inventory offered msg", | 292 | "inventory offered msg", |
293 | initialSessionId, | 293 | initialSessionId, |
294 | false, | 294 | false, |
295 | Vector3.Zero, | 295 | Vector3.Zero, |
296 | giveImBinaryBucket, | 296 | giveImBinaryBucket, |
297 | true); | 297 | true); |
298 | 298 | ||
299 | giverClient.HandleImprovedInstantMessage(giveIm); | 299 | giverClient.HandleImprovedInstantMessage(giveIm); |
300 | 300 | ||
301 | // These details might not all be correct. | 301 | // These details might not all be correct. |
302 | GridInstantMessage acceptIm | 302 | GridInstantMessage acceptIm |
303 | = new GridInstantMessage( | 303 | = new GridInstantMessage( |
304 | m_scene, | 304 | m_scene, |
305 | receiverSp.UUID, | 305 | receiverSp.UUID, |
306 | receiverSp.Name, | 306 | receiverSp.Name, |
307 | giverSp.UUID, | 307 | giverSp.UUID, |
308 | (byte)InstantMessageDialog.InventoryAccepted, | 308 | (byte)InstantMessageDialog.InventoryAccepted, |
309 | false, | 309 | false, |
310 | "inventory accepted msg", | 310 | "inventory accepted msg", |
311 | initialSessionId, | 311 | initialSessionId, |
312 | false, | 312 | false, |
313 | Vector3.Zero, | 313 | Vector3.Zero, |
314 | null, | 314 | null, |
315 | true); | 315 | true); |
@@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
325 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); | 325 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); |
326 | 326 | ||
327 | // Test for item successfully making it into the receiver's inventory | 327 | // Test for item successfully making it into the receiver's inventory |
328 | InventoryFolderBase receivedFolder | 328 | InventoryFolderBase receivedFolder |
329 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1"); | 329 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1"); |
330 | 330 | ||
331 | Assert.That(receivedFolder, Is.Not.Null); | 331 | Assert.That(receivedFolder, Is.Not.Null); |
@@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
340 | Assert.That(originalFolderAfterDelete, Is.Not.Null); | 340 | Assert.That(originalFolderAfterDelete, Is.Not.Null); |
341 | 341 | ||
342 | // TODO: Test scenario where giver deletes their item first. | 342 | // TODO: Test scenario where giver deletes their item first. |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// Test user rejection of a given item. | 346 | /// Test user rejection of a given item. |
@@ -357,9 +357,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
357 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | 357 | UUID initialSessionId = TestHelpers.ParseTail(0x10); |
358 | UUID folderId = TestHelpers.ParseTail(0x100); | 358 | UUID folderId = TestHelpers.ParseTail(0x100); |
359 | 359 | ||
360 | UserAccount ua1 | 360 | UserAccount ua1 |
361 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 361 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
362 | UserAccount ua2 | 362 | UserAccount ua2 |
363 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 363 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
364 | 364 | ||
365 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 365 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -369,7 +369,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
369 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 369 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
370 | 370 | ||
371 | // Create the folder to test give | 371 | // Create the folder to test give |
372 | InventoryFolderBase originalFolder | 372 | InventoryFolderBase originalFolder |
373 | = UserInventoryHelpers.CreateInventoryFolder( | 373 | = UserInventoryHelpers.CreateInventoryFolder( |
374 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); | 374 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); |
375 | 375 | ||
@@ -381,36 +381,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
381 | byte[] itemIdBytes = folderId.GetBytes(); | 381 | byte[] itemIdBytes = folderId.GetBytes(); |
382 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 382 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
383 | 383 | ||
384 | GridInstantMessage giveIm | 384 | GridInstantMessage giveIm |
385 | = new GridInstantMessage( | 385 | = new GridInstantMessage( |
386 | m_scene, | 386 | m_scene, |
387 | giverSp.UUID, | 387 | giverSp.UUID, |
388 | giverSp.Name, | 388 | giverSp.Name, |
389 | receiverSp.UUID, | 389 | receiverSp.UUID, |
390 | (byte)InstantMessageDialog.InventoryOffered, | 390 | (byte)InstantMessageDialog.InventoryOffered, |
391 | false, | 391 | false, |
392 | "inventory offered msg", | 392 | "inventory offered msg", |
393 | initialSessionId, | 393 | initialSessionId, |
394 | false, | 394 | false, |
395 | Vector3.Zero, | 395 | Vector3.Zero, |
396 | giveImBinaryBucket, | 396 | giveImBinaryBucket, |
397 | true); | 397 | true); |
398 | 398 | ||
399 | giverClient.HandleImprovedInstantMessage(giveIm); | 399 | giverClient.HandleImprovedInstantMessage(giveIm); |
400 | 400 | ||
401 | // These details might not all be correct. | 401 | // These details might not all be correct. |
402 | // Session ID is now the created item ID (!) | 402 | // Session ID is now the created item ID (!) |
403 | GridInstantMessage rejectIm | 403 | GridInstantMessage rejectIm |
404 | = new GridInstantMessage( | 404 | = new GridInstantMessage( |
405 | m_scene, | 405 | m_scene, |
406 | receiverSp.UUID, | 406 | receiverSp.UUID, |
407 | receiverSp.Name, | 407 | receiverSp.Name, |
408 | giverSp.UUID, | 408 | giverSp.UUID, |
409 | (byte)InstantMessageDialog.InventoryDeclined, | 409 | (byte)InstantMessageDialog.InventoryDeclined, |
410 | false, | 410 | false, |
411 | "inventory declined msg", | 411 | "inventory declined msg", |
412 | new UUID(receivedIm.imSessionID), | 412 | new UUID(receivedIm.imSessionID), |
413 | false, | 413 | false, |
414 | Vector3.Zero, | 414 | Vector3.Zero, |
415 | null, | 415 | null, |
416 | true); | 416 | true); |
@@ -426,7 +426,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
426 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); | 426 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); |
427 | 427 | ||
428 | // Test for folder successfully making it into the receiver's inventory | 428 | // Test for folder successfully making it into the receiver's inventory |
429 | InventoryFolderBase receivedFolder | 429 | InventoryFolderBase receivedFolder |
430 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); | 430 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); |
431 | 431 | ||
432 | InventoryFolderBase trashFolder | 432 | InventoryFolderBase trashFolder |
@@ -443,6 +443,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
443 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); | 443 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); |
444 | 444 | ||
445 | Assert.That(originalFolderAfterDelete, Is.Not.Null); | 445 | Assert.That(originalFolderAfterDelete, Is.Not.Null); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | } \ No newline at end of file | 448 | } \ No newline at end of file |