aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Helpers
diff options
context:
space:
mode:
authorDiva Canto2013-02-28 14:20:31 -0800
committerDiva Canto2013-02-28 14:20:31 -0800
commit433102108b903669cef632feff871fe9bc37021c (patch)
treed530ec4b8164d569a8064b0beaef37cde2f279ae /OpenSim/Tests/Common/Helpers
parentBug fix in DataSnapshot, where a var was being used before being initialized. (diff)
parentFix potential concurrency issue since the LSL notecard cache was not being ch... (diff)
downloadopensim-SC_OLD-433102108b903669cef632feff871fe9bc37021c.zip
opensim-SC_OLD-433102108b903669cef632feff871fe9bc37021c.tar.gz
opensim-SC_OLD-433102108b903669cef632feff871fe9bc37021c.tar.bz2
opensim-SC_OLD-433102108b903669cef632feff871fe9bc37021c.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Tests/Common/Helpers')
-rw-r--r--OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs32
1 files changed, 26 insertions, 6 deletions
diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
index 0a2b30a..bb4b55f 100644
--- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
@@ -46,13 +46,32 @@ namespace OpenSim.Tests.Common
46 /// <param name="scene"></param> 46 /// <param name="scene"></param>
47 /// <param name="part"></param> 47 /// <param name="part"></param>
48 /// <param name="itemName"></param> 48 /// <param name="itemName"></param>
49 /// <param name="itemIDFrag">UUID or UUID stem</param>
50 /// <param name="assetIDFrag">UUID or UUID stem</param>
51 /// <param name="text">The tex to put in the notecard.</param>
52 /// <returns>The item that was added</returns>
53 public static TaskInventoryItem AddNotecard(
54 Scene scene, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text)
55 {
56 return AddNotecard(
57 scene, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text);
58 }
59
60 /// <summary>
61 /// Add a notecard item to the given part.
62 /// </summary>
63 /// <param name="scene"></param>
64 /// <param name="part"></param>
65 /// <param name="itemName"></param>
49 /// <param name="itemID"></param> 66 /// <param name="itemID"></param>
50 /// <param name="assetID"></param> 67 /// <param name="assetID"></param>
68 /// <param name="text">The tex to put in the notecard.</param>
51 /// <returns>The item that was added</returns> 69 /// <returns>The item that was added</returns>
52 public static TaskInventoryItem AddNotecard(Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID) 70 public static TaskInventoryItem AddNotecard(
71 Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text)
53 { 72 {
54 AssetNotecard nc = new AssetNotecard(); 73 AssetNotecard nc = new AssetNotecard();
55 nc.BodyText = "Hello World!"; 74 nc.BodyText = text;
56 nc.Encode(); 75 nc.Encode();
57 76
58 AssetBase ncAsset 77 AssetBase ncAsset
@@ -87,8 +106,8 @@ namespace OpenSim.Tests.Common
87 /// Add a simple script to the given part. 106 /// Add a simple script to the given part.
88 /// </summary> 107 /// </summary>
89 /// <remarks> 108 /// <remarks>
90 /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these 109 /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather
91 /// functions more than once in a test. 110 /// than a random component.
92 /// </remarks> 111 /// </remarks>
93 /// <param name="scene"></param> 112 /// <param name="scene"></param>
94 /// <param name="part"></param> 113 /// <param name="part"></param>
@@ -102,8 +121,9 @@ namespace OpenSim.Tests.Common
102 ast.Source = scriptSource; 121 ast.Source = scriptSource;
103 ast.Encode(); 122 ast.Encode();
104 123
105 UUID assetUuid = new UUID("00000000-0000-0000-1000-000000000000"); 124 UUID assetUuid = UUID.Random();
106 UUID itemUuid = new UUID("00000000-0000-0000-1100-000000000000"); 125 UUID itemUuid = UUID.Random();
126
107 AssetBase asset 127 AssetBase asset
108 = AssetHelpers.CreateAsset(assetUuid, AssetType.LSLText, ast.AssetData, UUID.Zero); 128 = AssetHelpers.CreateAsset(assetUuid, AssetType.LSLText, ast.AssetData, UUID.Zero);
109 scene.AssetService.Store(asset); 129 scene.AssetService.Store(asset);