aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common
diff options
context:
space:
mode:
authorMelanie2011-05-22 20:23:25 +0100
committerMelanie2011-05-22 20:23:25 +0100
commitbe1996f1210ba58ba44f9715de68a3675cf13582 (patch)
tree7306bfe8a6e89bd1b2de9f145bea85f2b5645164 /OpenSim/Tests/Common
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentAdd stubs for unimplemented lsl functions (diff)
downloadopensim-SC_OLD-be1996f1210ba58ba44f9715de68a3675cf13582.zip
opensim-SC_OLD-be1996f1210ba58ba44f9715de68a3675cf13582.tar.gz
opensim-SC_OLD-be1996f1210ba58ba44f9715de68a3675cf13582.tar.bz2
opensim-SC_OLD-be1996f1210ba58ba44f9715de68a3675cf13582.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Tests/Common')
-rw-r--r--OpenSim/Tests/Common/Helpers/AssetHelpers.cs (renamed from OpenSim/Tests/Common/Setup/AssetHelpers.cs)20
-rw-r--r--OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs (renamed from OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs)4
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneSetupHelpers.cs (renamed from OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs)2
-rw-r--r--OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs89
-rw-r--r--OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs (renamed from OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs)4
-rw-r--r--OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs (renamed from OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs)4
6 files changed, 113 insertions, 10 deletions
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs
index d572249..aa55bcd 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs
@@ -56,10 +56,24 @@ namespace OpenSim.Tests.Common
56 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); 56 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
57 scene.AssetService.Store(asset); 57 scene.AssetService.Store(asset);
58 return asset; 58 return asset;
59 } 59 }
60
61 /// <summary>
62 /// Create an asset from the given object.
63 /// </summary>
64 /// <param name="assetUuidTail">
65 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
66 /// will be used.
67 /// </param>
68 /// <param name="sog"></param>
69 /// <returns></returns>
70 public static AssetBase CreateAsset(int assetUuidTail, SceneObjectGroup sog)
71 {
72 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), sog);
73 }
60 74
61 /// <summary> 75 /// <summary>
62 /// Create an asset from the given scene object. 76 /// Create an asset from the given object.
63 /// </summary> 77 /// </summary>
64 /// <param name="assetUuid"></param> 78 /// <param name="assetUuid"></param>
65 /// <param name="sog"></param> 79 /// <param name="sog"></param>
@@ -76,7 +90,7 @@ namespace OpenSim.Tests.Common
76 /// <summary> 90 /// <summary>
77 /// Create an asset from the given scene object. 91 /// Create an asset from the given scene object.
78 /// </summary> 92 /// </summary>
79 /// <param name="assetUuidTailZ"> 93 /// <param name="assetUuidTail">
80 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}" 94 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
81 /// will be used. 95 /// will be used.
82 /// </param> 96 /// </param>
diff --git a/OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs
index eaf8b39..49c99c5 100644
--- a/OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs
+++ b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs
@@ -34,9 +34,9 @@ using OpenSim.Framework.Servers;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Tests.Common.Mock; 35using OpenSim.Tests.Common.Mock;
36 36
37namespace OpenSim.Tests.Common.Setup 37namespace OpenSim.Tests.Common
38{ 38{
39 public class BaseRequestHandlerTestHelper 39 public class BaseRequestHandlerHelpers
40 { 40 {
41 private static string[] m_emptyStringArray = new string[] { }; 41 private static string[] m_emptyStringArray = new string[] { };
42 42
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneSetupHelpers.cs
index d122409..bef0481 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneSetupHelpers.cs
@@ -49,7 +49,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
49using OpenSim.Services.Interfaces; 49using OpenSim.Services.Interfaces;
50using OpenSim.Tests.Common.Mock; 50using OpenSim.Tests.Common.Mock;
51 51
52namespace OpenSim.Tests.Common.Setup 52namespace OpenSim.Tests.Common
53{ 53{
54 /// <summary> 54 /// <summary>
55 /// Helpers for setting up scenes. 55 /// Helpers for setting up scenes.
diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
new file mode 100644
index 0000000..5215c34
--- /dev/null
+++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
@@ -0,0 +1,89 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using OpenMetaverse;
30using OpenMetaverse.Assets;
31using OpenSim.Framework;
32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Services.Interfaces;
34
35namespace OpenSim.Tests.Common
36{
37 /// <summary>
38 /// Utility functions for carrying out task inventory tests.
39 /// </summary>
40 ///
41 public static class TaskInventoryHelpers
42 {
43 /// <summary>
44 /// Add a notecard item to the given part.
45 /// </summary>
46 /// <param name="scene"></param>
47 /// <param name="part"></param>
48 /// <returns>The item that was added</returns>
49 public static TaskInventoryItem AddNotecard(Scene scene, SceneObjectPart part)
50 {
51 AssetNotecard nc = new AssetNotecard();
52 nc.BodyText = "Hello World!";
53 nc.Encode();
54 UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
55 UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
56 AssetBase ncAsset
57 = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero);
58 scene.AssetService.Store(ncAsset);
59 TaskInventoryItem ncItem
60 = new TaskInventoryItem
61 { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid,
62 Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard };
63 part.Inventory.AddInventoryItem(ncItem, true);
64
65 return ncItem;
66 }
67
68 /// <summary>
69 /// Add a scene object item to the given part.
70 /// </summary>
71 /// <param name="scene"></param>
72 /// <param name="sop"></param>
73 /// <param name="itemName"></param>
74 /// <param name="id"></param>
75 public static TaskInventoryItem AddSceneObject(Scene scene, SceneObjectPart sop, string itemName, UUID id)
76 {
77 SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero);
78 AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
79 scene.AssetService.Store(taskSceneObjectAsset);
80 TaskInventoryItem taskSceneObjectItem
81 = new TaskInventoryItem
82 { Name = itemName, AssetID = taskSceneObjectAsset.FullID, ItemID = id,
83 Type = (int)AssetType.Object, InvType = (int)InventoryType.Object };
84 sop.Inventory.AddInventoryItem(taskSceneObjectItem, true);
85
86 return taskSceneObjectItem;
87 }
88 }
89} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs
index d01521d..8cfad79 100644
--- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
+++ b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs
@@ -31,12 +31,12 @@ using OpenSim.Framework.Communications;
31using OpenSim.Region.Framework.Scenes; 31using OpenSim.Region.Framework.Scenes;
32using OpenSim.Services.Interfaces; 32using OpenSim.Services.Interfaces;
33 33
34namespace OpenSim.Tests.Common.Setup 34namespace OpenSim.Tests.Common
35{ 35{
36 /// <summary> 36 /// <summary>
37 /// Utility functions for carrying out user profile related tests. 37 /// Utility functions for carrying out user profile related tests.
38 /// </summary> 38 /// </summary>
39 public static class UserProfileTestUtils 39 public static class UserAccountHelpers
40 { 40 {
41// /// <summary> 41// /// <summary>
42// /// Create a test user with a standard inventory 42// /// Create a test user with a standard inventory
diff --git a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
index 135c50e..0419134 100644
--- a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
+++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
@@ -34,9 +34,9 @@ using OpenSim.Services.Interfaces;
34namespace OpenSim.Tests.Common 34namespace OpenSim.Tests.Common
35{ 35{
36 /// <summary> 36 /// <summary>
37 /// Utility functions for carrying out user inventory related tests. 37 /// Utility functions for carrying out user inventory tests.
38 /// </summary> 38 /// </summary>
39 public static class UserInventoryTestUtils 39 public static class UserInventoryHelpers
40 { 40 {
41 public static readonly string PATH_DELIMITER = "/"; 41 public static readonly string PATH_DELIMITER = "/";
42 42