diff options
author | Justin Clark-Casey (justincc) | 2011-04-13 18:11:04 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-13 18:11:04 +0100 |
commit | 08fd1d9bbd0878e6ea0ce4abc0a664a70865ea01 (patch) | |
tree | d07883230ccf5f40b9b47b88b98ea0419186c6e1 /OpenSim | |
parent | Add a regression test for rezzing a single object into a scene from user inve... (diff) | |
download | opensim-SC_OLD-08fd1d9bbd0878e6ea0ce4abc0a664a70865ea01.zip opensim-SC_OLD-08fd1d9bbd0878e6ea0ce4abc0a664a70865ea01.tar.gz opensim-SC_OLD-08fd1d9bbd0878e6ea0ce4abc0a664a70865ea01.tar.bz2 opensim-SC_OLD-08fd1d9bbd0878e6ea0ce4abc0a664a70865ea01.tar.xz |
factor out some test code into the SetUp()
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index ecf70ac..5eca753 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -54,6 +54,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
54 | { | 54 | { |
55 | protected TestScene m_scene; | 55 | protected TestScene m_scene; |
56 | protected BasicInventoryAccessModule m_iam; | 56 | protected BasicInventoryAccessModule m_iam; |
57 | protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | ||
58 | protected TestClient m_tc; | ||
57 | 59 | ||
58 | [SetUp] | 60 | [SetUp] |
59 | public void SetUp() | 61 | public void SetUp() |
@@ -66,20 +68,23 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
66 | 68 | ||
67 | m_scene = SceneSetupHelpers.SetupScene("Inventory"); | 69 | m_scene = SceneSetupHelpers.SetupScene("Inventory"); |
68 | SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam); | 70 | SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam); |
71 | |||
72 | // Create user | ||
73 | string userFirstName = "Jock"; | ||
74 | string userLastName = "Stirrup"; | ||
75 | string userPassword = "troll"; | ||
76 | UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); | ||
77 | |||
78 | AgentCircuitData acd = new AgentCircuitData(); | ||
79 | acd.AgentID = m_userId; | ||
80 | m_tc = new TestClient(acd, m_scene); | ||
69 | } | 81 | } |
70 | 82 | ||
71 | [Test] | 83 | [Test] |
72 | public void TestRezObject() | 84 | public void TestRezObject() |
73 | { | 85 | { |
74 | TestHelper.InMethod(); | 86 | TestHelper.InMethod(); |
75 | log4net.Config.XmlConfigurator.Configure(); | 87 | // log4net.Config.XmlConfigurator.Configure(); |
76 | |||
77 | // Create user | ||
78 | string userFirstName = "Jock"; | ||
79 | string userLastName = "Stirrup"; | ||
80 | string userPassword = "troll"; | ||
81 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | ||
82 | UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); | ||
83 | 88 | ||
84 | // Create asset | 89 | // Create asset |
85 | SceneObjectGroup object1; | 90 | SceneObjectGroup object1; |
@@ -112,17 +117,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
112 | item1.AssetID = asset1.FullID; | 117 | item1.AssetID = asset1.FullID; |
113 | item1.ID = item1Id; | 118 | item1.ID = item1Id; |
114 | InventoryFolderBase objsFolder | 119 | InventoryFolderBase objsFolder |
115 | = InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, userId, "Objects")[0]; | 120 | = InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, m_userId, "Objects")[0]; |
116 | item1.Folder = objsFolder.ID; | 121 | item1.Folder = objsFolder.ID; |
117 | m_scene.AddInventoryItem(item1); | 122 | m_scene.AddInventoryItem(item1); |
118 | 123 | ||
119 | AgentCircuitData acd = new AgentCircuitData(); | ||
120 | acd.AgentID = userId; | ||
121 | TestClient tc = new TestClient(acd, m_scene); | ||
122 | |||
123 | SceneObjectGroup so | 124 | SceneObjectGroup so |
124 | = m_iam.RezObject( | 125 | = m_iam.RezObject( |
125 | tc, item1Id, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | 126 | m_tc, item1Id, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); |
126 | 127 | ||
127 | Assert.That(so, Is.Not.Null); | 128 | Assert.That(so, Is.Not.Null); |
128 | 129 | ||