diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index 5eca753..f8fa424 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -81,6 +81,85 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
81 | } | 81 | } |
82 | 82 | ||
83 | [Test] | 83 | [Test] |
84 | public void TestRezCoalescedObject() | ||
85 | { | ||
86 | TestHelper.InMethod(); | ||
87 | log4net.Config.XmlConfigurator.Configure(); | ||
88 | |||
89 | // Create asset | ||
90 | SceneObjectGroup object1; | ||
91 | { | ||
92 | string partName = "Object1"; | ||
93 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | ||
94 | PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); | ||
95 | Vector3 groupPosition = new Vector3(10, 20, 30); | ||
96 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); | ||
97 | Vector3 offsetPosition = new Vector3(5, 10, 15); | ||
98 | |||
99 | SceneObjectPart part1 | ||
100 | = new SceneObjectPart( | ||
101 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); | ||
102 | part1.Name = partName; | ||
103 | |||
104 | object1 = new SceneObjectGroup(part1); | ||
105 | } | ||
106 | |||
107 | SceneObjectGroup object2; | ||
108 | { | ||
109 | string partName = "Object2"; | ||
110 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | ||
111 | PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); | ||
112 | Vector3 groupPosition = new Vector3(10, 20, 30); | ||
113 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); | ||
114 | Vector3 offsetPosition = new Vector3(5, 10, 15); | ||
115 | |||
116 | SceneObjectPart part1 | ||
117 | = new SceneObjectPart( | ||
118 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); | ||
119 | part1.Name = partName; | ||
120 | |||
121 | object2 = new SceneObjectGroup(part1); | ||
122 | } | ||
123 | |||
124 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); | ||
125 | |||
126 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | ||
127 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, coa); | ||
128 | m_scene.AssetService.Store(asset1); | ||
129 | |||
130 | // Create item | ||
131 | UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080"); | ||
132 | string item1Name = "My Little Dog"; | ||
133 | InventoryItemBase item1 = new InventoryItemBase(); | ||
134 | item1.Name = item1Name; | ||
135 | item1.AssetID = asset1.FullID; | ||
136 | item1.ID = item1Id; | ||
137 | InventoryFolderBase objsFolder | ||
138 | = InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, m_userId, "Objects")[0]; | ||
139 | item1.Folder = objsFolder.ID; | ||
140 | m_scene.AddInventoryItem(item1); | ||
141 | |||
142 | SceneObjectGroup so | ||
143 | = m_iam.RezObject( | ||
144 | m_tc, item1Id, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | ||
145 | |||
146 | Assert.That(so, Is.Not.Null); | ||
147 | |||
148 | Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2)); | ||
149 | |||
150 | SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name); | ||
151 | Assert.That(retrievedObj1Part, Is.Null); | ||
152 | |||
153 | retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name); | ||
154 | Assert.That(retrievedObj1Part, Is.Not.Null); | ||
155 | Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name)); | ||
156 | |||
157 | // FIXME: Can't test yet due to a bug where objects in coalescence all get the item name when rerezzed. | ||
158 | // SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name); | ||
159 | // Assert.That(retrievedObj2Part, Is.Not.Null); | ||
160 | } | ||
161 | |||
162 | [Test] | ||
84 | public void TestRezObject() | 163 | public void TestRezObject() |
85 | { | 164 | { |
86 | TestHelper.InMethod(); | 165 | TestHelper.InMethod(); |