28 using System.Collections.Generic;
30 using NUnit.Framework;
32 using OpenSim.Framework;
33 using OpenSim.Region.Framework.Scenes;
34 using OpenSim.Services.Interfaces;
35 using OpenSim.Tests.Common;
37 namespace OpenSim.
Region.Framework.Scenes.Tests
50 m_assetService = scene.AssetService;
57 TestHelpers.InMethod();
59 UUID corruptAssetUuid = UUID.Parse(
"00000000-0000-0000-0000-000000000666");
61 = AssetHelpers.CreateAsset(corruptAssetUuid, AssetType.Notecard,
"CORRUPT ASSET", UUID.Zero);
62 m_assetService.Store(corruptAsset);
64 m_uuidGatherer.AddForInspection(corruptAssetUuid);
65 m_uuidGatherer.GatherAll();
68 Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(1));
77 TestHelpers.InMethod();
79 UUID missingAssetUuid = UUID.Parse(
"00000000-0000-0000-0000-000000000666");
81 m_uuidGatherer.AddForInspection(missingAssetUuid);
82 m_uuidGatherer.GatherAll();
84 Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(0));
90 TestHelpers.InMethod();
93 UUID ownerId = TestHelpers.ParseTail(0x10);
94 UUID embeddedId = TestHelpers.ParseTail(0x20);
95 UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21);
96 UUID missingEmbeddedId = TestHelpers.ParseTail(0x22);
97 UUID ncAssetId = TestHelpers.ParseTail(0x30);
100 = AssetHelpers.CreateNotecardAsset(
101 ncAssetId, string.Format(
"Hello{0}World{1}", embeddedId, missingEmbeddedId));
102 m_assetService.Store(ncAsset);
105 = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format(
"{0} We'll meet again.", secondLevelEmbeddedId));
106 m_assetService.Store(embeddedAsset);
109 = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId,
"Don't know where, don't know when.");
110 m_assetService.Store(secondLevelEmbeddedAsset);
112 m_uuidGatherer.AddForInspection(ncAssetId);
113 m_uuidGatherer.GatherAll();
118 Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3));
119 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId));
120 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId));
121 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId));
127 TestHelpers.InMethod();
130 UUID ownerId = TestHelpers.ParseTail(0x10);
132 SceneObjectGroup soL0 = SceneHelpers.CreateSceneObject(1, ownerId,
"l0", 0x20);
133 SceneObjectGroup soL1 = SceneHelpers.CreateSceneObject(1, ownerId,
"l1", 0x21);
134 SceneObjectGroup soL2 = SceneHelpers.CreateSceneObject(1, ownerId,
"l2", 0x22);
136 TaskInventoryHelpers.AddScript(
137 m_assetService, soL2.RootPart, TestHelpers.ParseTail(0x33),
TestHelpers.
ParseTail(0x43),
"l3-script",
"gibberish");
139 TaskInventoryHelpers.AddSceneObject(
140 m_assetService, soL1.RootPart,
"l2-item", TestHelpers.ParseTail(0x32), soL2,
TestHelpers.
ParseTail(0x42));
141 TaskInventoryHelpers.AddSceneObject(
142 m_assetService, soL0.RootPart,
"l1-item", TestHelpers.ParseTail(0x31), soL1,
TestHelpers.
ParseTail(0x41));
144 m_uuidGatherer.AddForInspection(soL0);
145 m_uuidGatherer.GatherAll();
151 Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(4));
153 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(TestHelpers.ParseTail(0x41)));
154 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(TestHelpers.ParseTail(0x42)));
155 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(TestHelpers.ParseTail(0x43)));
void TestMissingAsset()
Test requests made for non-existent assets while we're gathering
Gather uuids for a given entity.
UuidGatherer m_uuidGatherer
IAssetService m_assetService
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Asset class. All Assets are reference by this class or a class derived from this class ...
static UUID ParseTail(int tail)
Parse tail section into full UUID.
const string DefaultTexture
Helpers for setting up scenes.