diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index b31d4df..de29ae9 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -48,12 +48,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
48 | { | 48 | { |
49 | [TestFixture] | 49 | [TestFixture] |
50 | public class InventoryAccessModuleTests : OpenSimTestCase | 50 | public class InventoryAccessModuleTests : OpenSimTestCase |
51 | { | 51 | { |
52 | protected TestScene m_scene; | 52 | protected TestScene m_scene; |
53 | protected BasicInventoryAccessModule m_iam; | 53 | protected BasicInventoryAccessModule m_iam; |
54 | protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 54 | protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
55 | protected TestClient m_tc; | 55 | protected TestClient m_tc; |
56 | 56 | ||
57 | [SetUp] | 57 | [SetUp] |
58 | public override void SetUp() | 58 | public override void SetUp() |
59 | { | 59 | { |
@@ -68,32 +68,32 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
68 | SceneHelpers sceneHelpers = new SceneHelpers(); | 68 | SceneHelpers sceneHelpers = new SceneHelpers(); |
69 | m_scene = sceneHelpers.SetupScene(); | 69 | m_scene = sceneHelpers.SetupScene(); |
70 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); | 70 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); |
71 | 71 | ||
72 | // Create user | 72 | // Create user |
73 | string userFirstName = "Jock"; | 73 | string userFirstName = "Jock"; |
74 | string userLastName = "Stirrup"; | 74 | string userLastName = "Stirrup"; |
75 | string userPassword = "troll"; | 75 | string userPassword = "troll"; |
76 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); | 76 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); |
77 | 77 | ||
78 | AgentCircuitData acd = new AgentCircuitData(); | 78 | AgentCircuitData acd = new AgentCircuitData(); |
79 | acd.AgentID = m_userId; | 79 | acd.AgentID = m_userId; |
80 | m_tc = new TestClient(acd, m_scene); | 80 | m_tc = new TestClient(acd, m_scene); |
81 | } | 81 | } |
82 | 82 | ||
83 | [Test] | 83 | [Test] |
84 | public void TestRezCoalescedObject() | 84 | public void TestRezCoalescedObject() |
85 | { | 85 | { |
86 | /* | 86 | /* |
87 | TestHelpers.InMethod(); | 87 | TestHelpers.InMethod(); |
88 | // log4net.Config.XmlConfigurator.Configure(); | 88 | // log4net.Config.XmlConfigurator.Configure(); |
89 | 89 | ||
90 | // Create asset | 90 | // Create asset |
91 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); | 91 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); |
92 | object1.AbsolutePosition = new Vector3(15, 30, 45); | 92 | object1.AbsolutePosition = new Vector3(15, 30, 45); |
93 | 93 | ||
94 | SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); | 94 | SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); |
95 | object2.AbsolutePosition = new Vector3(25, 50, 75); | 95 | object2.AbsolutePosition = new Vector3(25, 50, 75); |
96 | 96 | ||
97 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); | 97 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); |
98 | 98 | ||
99 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 99 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
@@ -107,46 +107,46 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
107 | item1.Name = item1Name; | 107 | item1.Name = item1Name; |
108 | item1.AssetID = asset1.FullID; | 108 | item1.AssetID = asset1.FullID; |
109 | item1.ID = item1Id; | 109 | item1.ID = item1Id; |
110 | InventoryFolderBase objsFolder | 110 | InventoryFolderBase objsFolder |
111 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; | 111 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; |
112 | item1.Folder = objsFolder.ID; | 112 | item1.Folder = objsFolder.ID; |
113 | item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems; | 113 | item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems; |
114 | m_scene.AddInventoryItem(item1); | 114 | m_scene.AddInventoryItem(item1); |
115 | 115 | ||
116 | SceneObjectGroup so | 116 | SceneObjectGroup so |
117 | = m_iam.RezObject( | 117 | = m_iam.RezObject( |
118 | m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | 118 | m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); |
119 | 119 | ||
120 | Assert.That(so, Is.Not.Null); | 120 | Assert.That(so, Is.Not.Null); |
121 | 121 | ||
122 | Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2)); | 122 | Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2)); |
123 | 123 | ||
124 | SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name); | 124 | SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name); |
125 | Assert.That(retrievedObj1Part, Is.Null); | 125 | Assert.That(retrievedObj1Part, Is.Null); |
126 | 126 | ||
127 | retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name); | 127 | retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name); |
128 | Assert.That(retrievedObj1Part, Is.Not.Null); | 128 | Assert.That(retrievedObj1Part, Is.Not.Null); |
129 | Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name)); | 129 | Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name)); |
130 | 130 | ||
131 | // Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom | 131 | // Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom |
132 | // object is unit square. | 132 | // object is unit square. |
133 | Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f))); | 133 | Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f))); |
134 | 134 | ||
135 | SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name); | 135 | SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name); |
136 | Assert.That(retrievedObj2Part, Is.Not.Null); | 136 | Assert.That(retrievedObj2Part, Is.Not.Null); |
137 | Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name)); | 137 | Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name)); |
138 | Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f))); | 138 | Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f))); |
139 | */ | 139 | */ |
140 | } | 140 | } |
141 | 141 | ||
142 | [Test] | 142 | [Test] |
143 | public void TestRezObject() | 143 | public void TestRezObject() |
144 | { | 144 | { |
145 | TestHelpers.InMethod(); | 145 | TestHelpers.InMethod(); |
146 | // log4net.Config.XmlConfigurator.Configure(); | 146 | // log4net.Config.XmlConfigurator.Configure(); |
147 | 147 | ||
148 | // Create asset | 148 | // Create asset |
149 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); | 149 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); |
150 | 150 | ||
151 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 151 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
152 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 152 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
@@ -159,17 +159,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
159 | item1.Name = item1Name; | 159 | item1.Name = item1Name; |
160 | item1.AssetID = asset1.FullID; | 160 | item1.AssetID = asset1.FullID; |
161 | item1.ID = item1Id; | 161 | item1.ID = item1Id; |
162 | InventoryFolderBase objsFolder | 162 | InventoryFolderBase objsFolder |
163 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; | 163 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; |
164 | item1.Folder = objsFolder.ID; | 164 | item1.Folder = objsFolder.ID; |
165 | m_scene.AddInventoryItem(item1); | 165 | m_scene.AddInventoryItem(item1); |
166 | 166 | ||
167 | SceneObjectGroup so | 167 | SceneObjectGroup so |
168 | = m_iam.RezObject( | 168 | = m_iam.RezObject( |
169 | m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | 169 | m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); |
170 | 170 | ||
171 | Assert.That(so, Is.Not.Null); | 171 | Assert.That(so, Is.Not.Null); |
172 | 172 | ||
173 | SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID); | 173 | SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID); |
174 | Assert.That(retrievedPart, Is.Not.Null); | 174 | Assert.That(retrievedPart, Is.Not.Null); |
175 | } | 175 | } |