29 using System.Collections.Generic;
30 using System.Reflection;
32 using System.Threading;
36 using NUnit.Framework;
38 using OpenMetaverse.Assets;
39 using OpenSim.Framework;
40 using OpenSim.Region.Framework.Scenes;
41 using OpenSim.Region.Framework.Interfaces;
42 using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
43 using OpenSim.Region.CoreModules.World.Serialiser;
44 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
45 using OpenSim.Services.Interfaces;
46 using OpenSim.Tests.Common;
56 TestHelpers.InMethod();
60 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
61 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
65 UUID taskSceneObjectItemId = UUID.Parse(
"00000000-0000-0000-0000-100000000000");
66 TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1,
"tso", taskSceneObjectItemId, user1.PrincipalID);
68 TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
69 Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));
70 Assert.That(addedItem.OwnerID, Is.EqualTo(user1.PrincipalID));
71 Assert.That(addedItem.ParentID, Is.EqualTo(sop1.UUID));
72 Assert.That(addedItem.InvType, Is.EqualTo((int)InventoryType.Object));
73 Assert.That(addedItem.Type, Is.EqualTo((int)AssetType.Object));
79 TestHelpers.InMethod();
83 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
84 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
88 UUID taskSceneObjectItemId = UUID.Parse(
"00000000-0000-0000-0000-100000000000");
90 = TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1,
"tso", taskSceneObjectItemId, user1.PrincipalID);
92 scene.AddSceneObject(sog1);
94 Vector3 rezPos =
new Vector3(10, 10, 10);
95 Quaternion rezRot =
new Quaternion(0.5f, 0.5f, 0.5f, 0.5f);
96 Vector3 rezVel =
new Vector3(2, 2, 2);
98 scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0,
false);
102 Assert.That(rezzedObject, Is.Not.Null);
103 Assert.That(rezzedObject.AbsolutePosition, Is.EqualTo(rezPos));
107 Assert.That(rezzedObject.Velocity, Is.EqualTo(Vector3.Zero));
110 Assert.That(rezzedObject.RootPart.RotationOffset, Is.EqualTo(rezRot));
122 TestHelpers.InMethod();
126 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
127 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
130 = TaskInventoryHelpers.AddNotecard(
131 scene.AssetService, sop1,
"ncItem", TestHelpers.ParseTail(0x800),
TestHelpers.
ParseTail(0x900),
"Hello World!");
134 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID,
"Objects")[0];
138 scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID, out message);
141 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID,
"Objects/ncItem");
142 Assert.That(ncUserItem, Is.Not.Null,
"Objects/ncItem was not found");
154 TestHelpers.InMethod();
158 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
159 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
163 = TaskInventoryHelpers.AddNotecard(
164 scene.AssetService, sop1,
"ncItem", TestHelpers.ParseTail(0x800),
TestHelpers.
ParseTail(0x900),
"Hello World!");
168 scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID, out message);
171 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID,
"Notecards/ncItem");
172 Assert.That(ncUserItem, Is.Not.Null,
"Notecards/ncItem was not found");
void TestMoveTaskInventoryItem()
Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent fol...
System.Timers.Timer Timer
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Represents an item in a task inventory
System.Timers.Timer Timer
static UUID ParseTail(int tail)
Parse tail section into full UUID.
Inventory Item - contains all the properties associated with an individual inventory piece...
void TestMoveTaskInventoryItemNoParent()
Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent fol...
Helpers for setting up scenes.
Interactive OpenSim region server
void TestAddTaskInventoryItem()
void TestRezObjectFromInventoryItem()