diff options
author | Tom | 2011-05-26 03:42:45 -0700 |
---|---|---|
committer | Tom | 2011-05-26 03:42:45 -0700 |
commit | 03525959c96a76cf555923f9441407bddd538398 (patch) | |
tree | 2c293d455250908de315bd2de805e510538963d3 /OpenSim/Tests/Common | |
parent | Some additional protection, it seems that responsedata needs to be locked, bu... (diff) | |
parent | Add PayPrice to serialization format Xml2 (diff) | |
download | opensim-SC-03525959c96a76cf555923f9441407bddd538398.zip opensim-SC-03525959c96a76cf555923f9441407bddd538398.tar.gz opensim-SC-03525959c96a76cf555923f9441407bddd538398.tar.bz2 opensim-SC-03525959c96a76cf555923f9441407bddd538398.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster 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.cs | 89 | ||||
-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; | |||
34 | using OpenSim.Framework.Servers.HttpServer; | 34 | using OpenSim.Framework.Servers.HttpServer; |
35 | using OpenSim.Tests.Common.Mock; | 35 | using OpenSim.Tests.Common.Mock; |
36 | 36 | ||
37 | namespace OpenSim.Tests.Common.Setup | 37 | namespace 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; | |||
49 | using OpenSim.Services.Interfaces; | 49 | using OpenSim.Services.Interfaces; |
50 | using OpenSim.Tests.Common.Mock; | 50 | using OpenSim.Tests.Common.Mock; |
51 | 51 | ||
52 | namespace OpenSim.Tests.Common.Setup | 52 | namespace 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 | |||
28 | using System; | ||
29 | using OpenMetaverse; | ||
30 | using OpenMetaverse.Assets; | ||
31 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Framework.Scenes; | ||
33 | using OpenSim.Services.Interfaces; | ||
34 | |||
35 | namespace 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; | |||
31 | using OpenSim.Region.Framework.Scenes; | 31 | using OpenSim.Region.Framework.Scenes; |
32 | using OpenSim.Services.Interfaces; | 32 | using OpenSim.Services.Interfaces; |
33 | 33 | ||
34 | namespace OpenSim.Tests.Common.Setup | 34 | namespace 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; | |||
34 | namespace OpenSim.Tests.Common | 34 | namespace 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 | ||