aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs45
1 files changed, 44 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 2aef4b0..73f66cb 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -90,11 +90,54 @@ namespace OpenSim.Region.Framework.Tests
90 90
91 return ncItem; 91 return ncItem;
92 } 92 }
93 93
94 [Test]
95 public void TestRezObjectFromInventoryItem()
96 {
97 TestHelper.InMethod();
98// log4net.Config.XmlConfigurator.Configure();
99
100 Scene scene = SceneSetupHelpers.SetupScene();
101 UserAccount user1 = CreateUser(scene);
102 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
103 SceneObjectPart sop1 = sog1.RootPart;
104
105 // Create an object embedded inside the first
106 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
107
108 SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero);
109 AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
110 scene.AssetService.Store(taskSceneObjectAsset);
111 TaskInventoryItem taskSceneObjectItem
112 = new TaskInventoryItem
113 { Name = "tso", AssetID = taskSceneObjectAsset.FullID, ItemID = taskSceneObjectItemId,
114 Type = (int)AssetType.Object, InvType = (int)InventoryType.Object };
115 sop1.Inventory.AddInventoryItem(taskSceneObjectItem, true);
116
117 scene.AddSceneObject(sog1);
118
119 Vector3 rezPos = new Vector3(10, 10, 10);
120 Quaternion rezRot = new Quaternion(0.5f, 0.5f, 0.5f, 0.5f);
121 Vector3 rezVel = new Vector3(2, 2, 2);
122
123 scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0);
124
125 SceneObjectPart rezzedObjectPart = scene.GetSceneObjectPart("tso");
126
127 Assert.That(rezzedObjectPart, Is.Not.Null);
128 Assert.That(rezzedObjectPart.AbsolutePosition, Is.EqualTo(rezPos));
129 Assert.That(rezzedObjectPart.RotationOffset, Is.EqualTo(rezRot));
130
131 // Velocity isn't being set, possibly because we have no physics
132 //Assert.That(rezzedObjectPart.Velocity, Is.EqualTo(rezVel));
133 }
134
94 /// <summary> 135 /// <summary>
95 /// Test MoveTaskInventoryItem where the item has no parent folder assigned. 136 /// Test MoveTaskInventoryItem where the item has no parent folder assigned.
96 /// </summary> 137 /// </summary>
138 /// <remarks>
97 /// This should place it in the most suitable user folder. 139 /// This should place it in the most suitable user folder.
140 /// </remarks>
98 [Test] 141 [Test]
99 public void TestMoveTaskInventoryItem() 142 public void TestMoveTaskInventoryItem()
100 { 143 {