Reduce coupling in regression test task inventory creation methods to make them usable in tests with no scene present
parent
686b22da6e
commit
b1b72d7c2f
|
@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10);
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10);
|
||||||
TaskInventoryItem scriptItem
|
TaskInventoryItem scriptItem
|
||||||
= TaskInventoryHelpers.AddScript(
|
= TaskInventoryHelpers.AddScript(
|
||||||
scene,
|
scene.AssetService,
|
||||||
so.RootPart,
|
so.RootPart,
|
||||||
"scriptItem",
|
"scriptItem",
|
||||||
"default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
|
"default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
|
||||||
|
@ -659,7 +659,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10);
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10);
|
||||||
TaskInventoryItem scriptTaskItem
|
TaskInventoryItem scriptTaskItem
|
||||||
= TaskInventoryHelpers.AddScript(
|
= TaskInventoryHelpers.AddScript(
|
||||||
scene,
|
scene.AssetService,
|
||||||
so.RootPart,
|
so.RootPart,
|
||||||
"scriptItem",
|
"scriptItem",
|
||||||
"default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
|
"default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
|
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
|
||||||
TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
|
TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
|
||||||
|
|
||||||
TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
|
TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
|
||||||
Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));
|
Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));
|
||||||
|
@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
|
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
|
||||||
TaskInventoryItem taskSceneObjectItem
|
TaskInventoryItem taskSceneObjectItem
|
||||||
= TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
|
= TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
|
||||||
|
|
||||||
scene.AddSceneObject(sog1);
|
scene.AddSceneObject(sog1);
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
SceneObjectPart sop1 = sog1.RootPart;
|
SceneObjectPart sop1 = sog1.RootPart;
|
||||||
TaskInventoryItem sopItem1
|
TaskInventoryItem sopItem1
|
||||||
= TaskInventoryHelpers.AddNotecard(
|
= TaskInventoryHelpers.AddNotecard(
|
||||||
scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
||||||
|
|
||||||
InventoryFolderBase folder
|
InventoryFolderBase folder
|
||||||
= InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0];
|
= InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0];
|
||||||
|
@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
SceneObjectPart sop1 = sog1.RootPart;
|
SceneObjectPart sop1 = sog1.RootPart;
|
||||||
TaskInventoryItem sopItem1
|
TaskInventoryItem sopItem1
|
||||||
= TaskInventoryHelpers.AddNotecard(
|
= TaskInventoryHelpers.AddNotecard(
|
||||||
scene, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
scene.AssetService, sop1, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
||||||
|
|
||||||
// Perform test
|
// Perform test
|
||||||
string message;
|
string message;
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
// TestHelpers.EnableLogging();
|
// TestHelpers.EnableLogging();
|
||||||
|
|
||||||
UUID ownerId = TestHelpers.ParseTail(0x10);
|
UUID ownerId = TestHelpers.ParseTail(0x10);
|
||||||
UUID embeddedId = TestHelpers.ParseTail(0x20);
|
UUID embeddedId = TestHelpers.ParseTail(0x20);
|
||||||
UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21);
|
UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21);
|
||||||
|
@ -120,5 +120,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId));
|
Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId));
|
||||||
Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId));
|
Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestTaskItem()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
TestHelpers.EnableLogging();
|
||||||
|
|
||||||
|
UUID ownerId = TestHelpers.ParseTail(0x10);
|
||||||
|
UUID embeddedId = TestHelpers.ParseTail(0x20);
|
||||||
|
UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21);
|
||||||
|
UUID missingEmbeddedId = TestHelpers.ParseTail(0x22);
|
||||||
|
UUID ncAssetId = TestHelpers.ParseTail(0x30);
|
||||||
|
|
||||||
|
AssetBase ncAsset
|
||||||
|
= AssetHelpers.CreateNotecardAsset(
|
||||||
|
ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId));
|
||||||
|
m_assetService.Store(ncAsset);
|
||||||
|
|
||||||
|
AssetBase embeddedAsset
|
||||||
|
= AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId));
|
||||||
|
m_assetService.Store(embeddedAsset);
|
||||||
|
|
||||||
|
AssetBase secondLevelEmbeddedAsset
|
||||||
|
= AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when.");
|
||||||
|
m_assetService.Store(secondLevelEmbeddedAsset);
|
||||||
|
|
||||||
|
m_uuidGatherer.AddForInspection(ncAssetId);
|
||||||
|
m_uuidGatherer.GatherAll();
|
||||||
|
|
||||||
|
// foreach (UUID key in m_uuidGatherer.GatheredUuids.Keys)
|
||||||
|
// System.Console.WriteLine("key : {0}", key);
|
||||||
|
|
||||||
|
Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3));
|
||||||
|
Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId));
|
||||||
|
Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId));
|
||||||
|
Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine, m_urlModule);
|
SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine, m_urlModule);
|
||||||
|
|
||||||
SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
|
SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
|
||||||
m_scriptItem = TaskInventoryHelpers.AddScript(m_scene, so.RootPart);
|
m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, so.RootPart);
|
||||||
|
|
||||||
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
||||||
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID itemId = TestHelpers.ParseTail(0x20);
|
UUID itemId = TestHelpers.ParseTail(0x20);
|
||||||
TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, userId);
|
TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, userId);
|
||||||
|
|
||||||
LSL_Api api = new LSL_Api();
|
LSL_Api api = new LSL_Api();
|
||||||
api.Initialize(m_engine, so1.RootPart, null, null);
|
api.Initialize(m_engine, so1.RootPart, null, null);
|
||||||
|
@ -131,7 +131,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID itemId = TestHelpers.ParseTail(0x20);
|
UUID itemId = TestHelpers.ParseTail(0x20);
|
||||||
TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id);
|
TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, user1Id);
|
||||||
|
|
||||||
// Create a second object
|
// Create a second object
|
||||||
SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100);
|
SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100);
|
||||||
|
@ -188,7 +188,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID itemId = TestHelpers.ParseTail(0x20);
|
UUID itemId = TestHelpers.ParseTail(0x20);
|
||||||
TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id);
|
TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, user1Id);
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id);
|
UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id);
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID itemId = TestHelpers.ParseTail(0x20);
|
UUID itemId = TestHelpers.ParseTail(0x20);
|
||||||
TaskInventoryItem tii
|
TaskInventoryItem tii
|
||||||
= TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id);
|
= TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, user1Id);
|
||||||
tii.NextPermissions &= ~((uint)PermissionMask.Modify);
|
tii.NextPermissions &= ~((uint)PermissionMask.Modify);
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id);
|
UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id);
|
||||||
|
@ -251,7 +251,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(sourceSo);
|
m_scene.AddSceneObject(sourceSo);
|
||||||
LSL_Api api = new LSL_Api();
|
LSL_Api api = new LSL_Api();
|
||||||
api.Initialize(m_engine, sourceSo.RootPart, null, null);
|
api.Initialize(m_engine, sourceSo.RootPart, null, null);
|
||||||
TaskInventoryHelpers.AddScript(m_scene, sourceSo.RootPart, "script", "Hello World");
|
TaskInventoryHelpers.AddScript(m_scene.AssetService, sourceSo.RootPart, "script", "Hello World");
|
||||||
|
|
||||||
SceneObjectGroup targetSo = SceneHelpers.AddSceneObject(m_scene, "targetSo", user1Id);
|
SceneObjectGroup targetSo = SceneHelpers.AddSceneObject(m_scene, "targetSo", user1Id);
|
||||||
SceneObjectGroup otherOwnedTargetSo = SceneHelpers.AddSceneObject(m_scene, "otherOwnedTargetSo", user2Id);
|
SceneObjectGroup otherOwnedTargetSo = SceneHelpers.AddSceneObject(m_scene, "otherOwnedTargetSo", user2Id);
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// FIXME: This should really be a script item (with accompanying script)
|
// FIXME: This should really be a script item (with accompanying script)
|
||||||
TaskInventoryItem grp1Item
|
TaskInventoryItem grp1Item
|
||||||
= TaskInventoryHelpers.AddNotecard(
|
= TaskInventoryHelpers.AddNotecard(
|
||||||
m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
||||||
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
||||||
|
|
||||||
SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20);
|
SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20);
|
||||||
|
@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// FIXME: This should really be a script item (with accompanying script)
|
// FIXME: This should really be a script item (with accompanying script)
|
||||||
TaskInventoryItem grp1Item
|
TaskInventoryItem grp1Item
|
||||||
= TaskInventoryHelpers.AddNotecard(
|
= TaskInventoryHelpers.AddNotecard(
|
||||||
m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
||||||
|
|
||||||
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// FIXME: This should really be a script item (with accompanying script)
|
// FIXME: This should really be a script item (with accompanying script)
|
||||||
TaskInventoryItem grp1Item
|
TaskInventoryItem grp1Item
|
||||||
= TaskInventoryHelpers.AddNotecard(
|
= TaskInventoryHelpers.AddNotecard(
|
||||||
m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
m_scene.AssetService, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
|
||||||
|
|
||||||
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine);
|
SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine);
|
||||||
|
|
||||||
m_so = SceneHelpers.AddSceneObject(m_scene);
|
m_so = SceneHelpers.AddSceneObject(m_scene);
|
||||||
m_scriptItem = TaskInventoryHelpers.AddScript(m_scene, m_so.RootPart);
|
m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, m_so.RootPart);
|
||||||
|
|
||||||
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
||||||
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
||||||
|
@ -77,7 +77,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
string[] ncLines = { "One", "Twoè", "Three" };
|
string[] ncLines = { "One", "Twoè", "Three" };
|
||||||
|
|
||||||
TaskInventoryItem ncItem
|
TaskInventoryItem ncItem
|
||||||
= TaskInventoryHelpers.AddNotecard(m_scene, m_so.RootPart, "nc", "1", "10", string.Join("\n", ncLines));
|
= TaskInventoryHelpers.AddNotecard(m_scene.AssetService, m_so.RootPart, "nc", "1", "10", string.Join("\n", ncLines));
|
||||||
|
|
||||||
AssertValidNotecardLine(ncItem.Name, 0, ncLines[0]);
|
AssertValidNotecardLine(ncItem.Name, 0, ncLines[0]);
|
||||||
AssertValidNotecardLine(ncItem.Name, 2, ncLines[2]);
|
AssertValidNotecardLine(ncItem.Name, 2, ncLines[2]);
|
||||||
|
@ -102,7 +102,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
TaskInventoryItem ncItem = TaskInventoryHelpers.AddScript(m_scene, m_so.RootPart, "nc1", "Not important");
|
TaskInventoryItem ncItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, m_so.RootPart, "nc1", "Not important");
|
||||||
|
|
||||||
AssertInValidNotecardLine(ncItem.Name, 0);
|
AssertInValidNotecardLine(ncItem.Name, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, userId);
|
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, userId);
|
||||||
|
|
||||||
SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart;
|
SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart;
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, part);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, part);
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, part, scriptItem, null);
|
apiGrp1.Initialize(m_engine, part, scriptItem, null);
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, 0x1);
|
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, 0x1);
|
||||||
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1.PrincipalID);
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1.PrincipalID);
|
||||||
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, inWorldObj.RootPart);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
||||||
|
|
||||||
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
|
@ -105,7 +105,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, ua1.PrincipalID);
|
// SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, ua1.PrincipalID);
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
TaskInventoryHelpers.AddSceneObject(m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID);
|
TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID);
|
||||||
|
|
||||||
osslApi.osForceAttachToAvatarFromInventory(taskInvObjItemName, (int)attachPoint);
|
osslApi.osForceAttachToAvatarFromInventory(taskInvObjItemName, (int)attachPoint);
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, 0x1);
|
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, 0x1);
|
||||||
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1.PrincipalID);
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1.PrincipalID);
|
||||||
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, inWorldObj.RootPart);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
||||||
|
|
||||||
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
|
@ -150,7 +150,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
TaskInventoryHelpers.AddNotecard(
|
TaskInventoryHelpers.AddNotecard(
|
||||||
m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, TestHelpers.ParseTail(0x900), "Hello World!");
|
m_scene.AssetService, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, TestHelpers.ParseTail(0x900), "Hello World!");
|
||||||
|
|
||||||
bool exceptionCaught = false;
|
bool exceptionCaught = false;
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
|
||||||
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1);
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, ua1);
|
||||||
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene, inWorldObj.RootPart);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
||||||
|
|
||||||
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
|
@ -198,7 +198,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
TaskInventoryHelpers.AddSceneObject(
|
TaskInventoryHelpers.AddSceneObject(
|
||||||
m_scene, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID);
|
m_scene.AssetService, inWorldObj.RootPart, taskInvObjItemName, taskInvObjItemId, ua1.PrincipalID);
|
||||||
|
|
||||||
ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, ua2);
|
ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, ua2);
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace OpenSim.Region.ScriptEngine.Tests
|
||||||
|
|
||||||
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10);
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, sp.UUID, "att-name", 0x10);
|
||||||
TaskInventoryHelpers.AddScript(
|
TaskInventoryHelpers.AddScript(
|
||||||
scene,
|
scene.AssetService,
|
||||||
so.RootPart,
|
so.RootPart,
|
||||||
"scriptItem",
|
"scriptItem",
|
||||||
"default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
|
"default { attach(key id) { if (id != NULL_KEY) { llSay(0, \"Hello World\"); } } }");
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a notecard item to the given part.
|
/// Add a notecard item to the given part.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scene"></param>
|
/// <param name="assetService"></param>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
/// <param name="itemName"></param>
|
/// <param name="itemName"></param>
|
||||||
/// <param name="itemIDFrag">UUID or UUID stem</param>
|
/// <param name="itemIDFrag">UUID or UUID stem</param>
|
||||||
|
@ -51,16 +51,16 @@ namespace OpenSim.Tests.Common
|
||||||
/// <param name="text">The tex to put in the notecard.</param>
|
/// <param name="text">The tex to put in the notecard.</param>
|
||||||
/// <returns>The item that was added</returns>
|
/// <returns>The item that was added</returns>
|
||||||
public static TaskInventoryItem AddNotecard(
|
public static TaskInventoryItem AddNotecard(
|
||||||
Scene scene, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text)
|
IAssetService assetService, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text)
|
||||||
{
|
{
|
||||||
return AddNotecard(
|
return AddNotecard(
|
||||||
scene, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text);
|
assetService, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a notecard item to the given part.
|
/// Add a notecard item to the given part.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scene"></param>
|
/// <param name="assetService"></param>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
/// <param name="itemName"></param>
|
/// <param name="itemName"></param>
|
||||||
/// <param name="itemID"></param>
|
/// <param name="itemID"></param>
|
||||||
|
@ -68,7 +68,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// <param name="text">The tex to put in the notecard.</param>
|
/// <param name="text">The tex to put in the notecard.</param>
|
||||||
/// <returns>The item that was added</returns>
|
/// <returns>The item that was added</returns>
|
||||||
public static TaskInventoryItem AddNotecard(
|
public static TaskInventoryItem AddNotecard(
|
||||||
Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text)
|
IAssetService assetService, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text)
|
||||||
{
|
{
|
||||||
AssetNotecard nc = new AssetNotecard();
|
AssetNotecard nc = new AssetNotecard();
|
||||||
nc.BodyText = text;
|
nc.BodyText = text;
|
||||||
|
@ -76,7 +76,7 @@ namespace OpenSim.Tests.Common
|
||||||
|
|
||||||
AssetBase ncAsset
|
AssetBase ncAsset
|
||||||
= AssetHelpers.CreateAsset(assetID, AssetType.Notecard, nc.AssetData, UUID.Zero);
|
= AssetHelpers.CreateAsset(assetID, AssetType.Notecard, nc.AssetData, UUID.Zero);
|
||||||
scene.AssetService.Store(ncAsset);
|
assetService.Store(ncAsset);
|
||||||
|
|
||||||
TaskInventoryItem ncItem
|
TaskInventoryItem ncItem
|
||||||
= new TaskInventoryItem
|
= new TaskInventoryItem
|
||||||
|
@ -94,12 +94,12 @@ namespace OpenSim.Tests.Common
|
||||||
/// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these
|
/// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these
|
||||||
/// functions more than once in a test.
|
/// functions more than once in a test.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="scene"></param>
|
/// <param name="assetService"></param>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
/// <returns>The item that was added</returns>
|
/// <returns>The item that was added</returns>
|
||||||
public static TaskInventoryItem AddScript(Scene scene, SceneObjectPart part)
|
public static TaskInventoryItem AddScript(IAssetService assetService, SceneObjectPart part)
|
||||||
{
|
{
|
||||||
return AddScript(scene, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }");
|
return AddScript(assetService, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -109,15 +109,15 @@ namespace OpenSim.Tests.Common
|
||||||
/// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather
|
/// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather
|
||||||
/// than a random component.
|
/// than a random component.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="scene"></param>
|
/// <param name="assetService"></param>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
/// <param name="scriptName">Name of the script to add</param>
|
/// <param name="scriptName">Name of the script to add</param>
|
||||||
/// <param name="scriptSource">LSL script source</param>
|
/// <param name="scriptSource">LSL script source</param>
|
||||||
/// <returns>The item that was added</returns>
|
/// <returns>The item that was added</returns>
|
||||||
public static TaskInventoryItem AddScript(
|
public static TaskInventoryItem AddScript(
|
||||||
Scene scene, SceneObjectPart part, string scriptName, string scriptSource)
|
IAssetService assetService, SceneObjectPart part, string scriptName, string scriptSource)
|
||||||
{
|
{
|
||||||
return AddScript(scene, part, UUID.Random(), UUID.Random(), scriptName, scriptSource);
|
return AddScript(assetService, part, UUID.Random(), UUID.Random(), scriptName, scriptSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -127,7 +127,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather
|
/// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather
|
||||||
/// than a random component.
|
/// than a random component.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="scene"></param>
|
/// <param name="assetService"></param>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
/// <param name="itemId">Item UUID for the script</param>
|
/// <param name="itemId">Item UUID for the script</param>
|
||||||
/// <param name="assetId">Asset UUID for the script</param>
|
/// <param name="assetId">Asset UUID for the script</param>
|
||||||
|
@ -135,7 +135,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// <param name="scriptSource">LSL script source</param>
|
/// <param name="scriptSource">LSL script source</param>
|
||||||
/// <returns>The item that was added</returns>
|
/// <returns>The item that was added</returns>
|
||||||
public static TaskInventoryItem AddScript(
|
public static TaskInventoryItem AddScript(
|
||||||
Scene scene, SceneObjectPart part, UUID itemId, UUID assetId, string scriptName, string scriptSource)
|
IAssetService assetService, SceneObjectPart part, UUID itemId, UUID assetId, string scriptName, string scriptSource)
|
||||||
{
|
{
|
||||||
AssetScriptText ast = new AssetScriptText();
|
AssetScriptText ast = new AssetScriptText();
|
||||||
ast.Source = scriptSource;
|
ast.Source = scriptSource;
|
||||||
|
@ -143,7 +143,7 @@ namespace OpenSim.Tests.Common
|
||||||
|
|
||||||
AssetBase asset
|
AssetBase asset
|
||||||
= AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero);
|
= AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero);
|
||||||
scene.AssetService.Store(asset);
|
assetService.Store(asset);
|
||||||
TaskInventoryItem item
|
TaskInventoryItem item
|
||||||
= new TaskInventoryItem
|
= new TaskInventoryItem
|
||||||
{ Name = scriptName, AssetID = assetId, ItemID = itemId,
|
{ Name = scriptName, AssetID = assetId, ItemID = itemId,
|
||||||
|
@ -162,17 +162,17 @@ namespace OpenSim.Tests.Common
|
||||||
/// functions more than once in a test.
|
/// functions more than once in a test.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
///
|
///
|
||||||
/// <param name="scene"></param>
|
/// <param name="assetService"></param>
|
||||||
/// <param name="sop"></param>
|
/// <param name="sop"></param>
|
||||||
/// <param name="itemName"></param>
|
/// <param name="itemName"></param>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <param name="userId"></param>
|
/// <param name="userId"></param>
|
||||||
public static TaskInventoryItem AddSceneObject(
|
public static TaskInventoryItem AddSceneObject(
|
||||||
Scene scene, SceneObjectPart sop, string itemName, UUID id, UUID userId)
|
IAssetService assetService, SceneObjectPart sop, string itemName, UUID id, UUID userId)
|
||||||
{
|
{
|
||||||
SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero);
|
SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero);
|
||||||
AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
|
AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
|
||||||
scene.AssetService.Store(taskSceneObjectAsset);
|
assetService.Store(taskSceneObjectAsset);
|
||||||
TaskInventoryItem taskSceneObjectItem
|
TaskInventoryItem taskSceneObjectItem
|
||||||
= new TaskInventoryItem
|
= new TaskInventoryItem
|
||||||
{ Name = itemName,
|
{ Name = itemName,
|
||||||
|
|
Loading…
Reference in New Issue