diff options
author | Justin Clark-Casey (justincc) | 2015-02-25 20:30:03 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2015-02-25 20:30:03 +0000 |
commit | b1b72d7c2f16e7d1e239a0579dc0b28ea9812ed7 (patch) | |
tree | e271b19776ad3a956730a947af3764de2c645431 /OpenSim/Region/Framework/Scenes | |
parent | On shutdown (job engine stop), don't allow the ObjectDisposedException on Blo... (diff) | |
download | opensim-SC_OLD-b1b72d7c2f16e7d1e239a0579dc0b28ea9812ed7.zip opensim-SC_OLD-b1b72d7c2f16e7d1e239a0579dc0b28ea9812ed7.tar.gz opensim-SC_OLD-b1b72d7c2f16e7d1e239a0579dc0b28ea9812ed7.tar.bz2 opensim-SC_OLD-b1b72d7c2f16e7d1e239a0579dc0b28ea9812ed7.tar.xz |
Reduce coupling in regression test task inventory creation methods to make them usable in tests with no scene present
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | 39 |
2 files changed, 42 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 9655d19..8ec6974 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Tests | |||
64 | 64 | ||
65 | // Create an object embedded inside the first | 65 | // Create an object embedded inside the first |
66 | UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); | 66 | UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); |
67 | TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); | 67 | TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); |
68 | 68 | ||
69 | TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId); | 69 | TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId); |
70 | Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId)); | 70 | Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId)); |
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Tests | |||
88 | // Create an object embedded inside the first | 88 | // Create an object embedded inside the first |
89 | UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); | 89 | UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); |
90 | TaskInventoryItem taskSceneObjectItem | 90 | TaskInventoryItem taskSceneObjectItem |
91 | = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); | 91 | = TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID); |
92 | 92 | ||
93 | scene.AddSceneObject(sog1); | 93 | scene.AddSceneObject(sog1); |
94 | 94 | ||
@@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Tests | |||
129 | SceneObjectPart sop1 = sog1.RootPart; | 129 | SceneObjectPart sop1 = sog1.RootPart; |
130 | TaskInventoryItem sopItem1 | 130 | TaskInventoryItem sopItem1 |
131 | = TaskInventoryHelpers.AddNotecard( | 131 | = TaskInventoryHelpers.AddNotecard( |
132 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); | 132 | scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
133 | 133 | ||
134 | InventoryFolderBase folder | 134 | InventoryFolderBase folder |
135 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; | 135 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; |
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Tests | |||
162 | SceneObjectPart sop1 = sog1.RootPart; | 162 | SceneObjectPart sop1 = sog1.RootPart; |
163 | TaskInventoryItem sopItem1 | 163 | TaskInventoryItem sopItem1 |
164 | = TaskInventoryHelpers.AddNotecard( | 164 | = TaskInventoryHelpers.AddNotecard( |
165 | scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); | 165 | scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!"); |
166 | 166 | ||
167 | // Perform test | 167 | // Perform test |
168 | string message; | 168 | string message; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 4ae27d7..0b41039 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
89 | { | 89 | { |
90 | TestHelpers.InMethod(); | 90 | TestHelpers.InMethod(); |
91 | // TestHelpers.EnableLogging(); | 91 | // TestHelpers.EnableLogging(); |
92 | 92 | ||
93 | UUID ownerId = TestHelpers.ParseTail(0x10); | 93 | UUID ownerId = TestHelpers.ParseTail(0x10); |
94 | UUID embeddedId = TestHelpers.ParseTail(0x20); | 94 | UUID embeddedId = TestHelpers.ParseTail(0x20); |
95 | UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); | 95 | UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); |
@@ -120,5 +120,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
120 | Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); | 120 | Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); |
121 | Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId)); | 121 | Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId)); |
122 | } | 122 | } |
123 | |||
124 | [Test] | ||
125 | public void TestTaskItem() | ||
126 | { | ||
127 | TestHelpers.InMethod(); | ||
128 | TestHelpers.EnableLogging(); | ||
129 | |||
130 | UUID ownerId = TestHelpers.ParseTail(0x10); | ||
131 | UUID embeddedId = TestHelpers.ParseTail(0x20); | ||
132 | UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); | ||
133 | UUID missingEmbeddedId = TestHelpers.ParseTail(0x22); | ||
134 | UUID ncAssetId = TestHelpers.ParseTail(0x30); | ||
135 | |||
136 | AssetBase ncAsset | ||
137 | = AssetHelpers.CreateNotecardAsset( | ||
138 | ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); | ||
139 | m_assetService.Store(ncAsset); | ||
140 | |||
141 | AssetBase embeddedAsset | ||
142 | = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId)); | ||
143 | m_assetService.Store(embeddedAsset); | ||
144 | |||
145 | AssetBase secondLevelEmbeddedAsset | ||
146 | = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when."); | ||
147 | m_assetService.Store(secondLevelEmbeddedAsset); | ||
148 | |||
149 | m_uuidGatherer.AddForInspection(ncAssetId); | ||
150 | m_uuidGatherer.GatherAll(); | ||
151 | |||
152 | // foreach (UUID key in m_uuidGatherer.GatheredUuids.Keys) | ||
153 | // System.Console.WriteLine("key : {0}", key); | ||
154 | |||
155 | Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3)); | ||
156 | Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId)); | ||
157 | Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); | ||
158 | Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId)); | ||
159 | } | ||
123 | } | 160 | } |
124 | } \ No newline at end of file | 161 | } \ No newline at end of file |