aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Helpers
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Tests/Common/Helpers/AssetHelpers.cs32
-rw-r--r--OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs2
-rw-r--r--OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs6
-rw-r--r--OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs12
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs74
-rw-r--r--OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs12
-rw-r--r--OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs4
-rw-r--r--OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs20
8 files changed, 85 insertions, 77 deletions
diff --git a/OpenSim/Tests/Common/Helpers/AssetHelpers.cs b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs
index 7af8bed..974da4c 100644
--- a/OpenSim/Tests/Common/Helpers/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Tests.Common
66 { 66 {
67 return CreateAsset(assetId, AssetType.Notecard, text, UUID.Random()); 67 return CreateAsset(assetId, AssetType.Notecard, text, UUID.Random());
68 } 68 }
69 69
70// /// <summary> 70// /// <summary>
71// /// Create and store a notecard asset with a random uuid and dummy text. 71// /// Create and store a notecard asset with a random uuid and dummy text.
72// /// </summary> 72// /// </summary>
@@ -92,7 +92,7 @@ namespace OpenSim.Tests.Common
92 { 92 {
93 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), sog); 93 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), sog);
94 } 94 }
95 95
96 /// <summary> 96 /// <summary>
97 /// Create an asset from the given object. 97 /// Create an asset from the given object.
98 /// </summary> 98 /// </summary>
@@ -102,12 +102,12 @@ namespace OpenSim.Tests.Common
102 public static AssetBase CreateAsset(UUID assetUuid, SceneObjectGroup sog) 102 public static AssetBase CreateAsset(UUID assetUuid, SceneObjectGroup sog)
103 { 103 {
104 return CreateAsset( 104 return CreateAsset(
105 assetUuid, 105 assetUuid,
106 AssetType.Object, 106 AssetType.Object,
107 Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)), 107 Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)),
108 sog.OwnerID); 108 sog.OwnerID);
109 } 109 }
110 110
111 /// <summary> 111 /// <summary>
112 /// Create an asset from the given scene object. 112 /// Create an asset from the given scene object.
113 /// </summary> 113 /// </summary>
@@ -120,8 +120,8 @@ namespace OpenSim.Tests.Common
120 public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa) 120 public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa)
121 { 121 {
122 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa); 122 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa);
123 } 123 }
124 124
125 /// <summary> 125 /// <summary>
126 /// Create an asset from the given scene object. 126 /// Create an asset from the given scene object.
127 /// </summary> 127 /// </summary>
@@ -131,12 +131,12 @@ namespace OpenSim.Tests.Common
131 public static AssetBase CreateAsset(UUID assetUuid, CoalescedSceneObjects coa) 131 public static AssetBase CreateAsset(UUID assetUuid, CoalescedSceneObjects coa)
132 { 132 {
133 return CreateAsset( 133 return CreateAsset(
134 assetUuid, 134 assetUuid,
135 AssetType.Object, 135 AssetType.Object,
136 Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)), 136 Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)),
137 coa.CreatorId); 137 coa.CreatorId);
138 } 138 }
139 139
140 /// <summary> 140 /// <summary>
141 /// Create an asset from the given data. 141 /// Create an asset from the given data.
142 /// </summary> 142 /// </summary>
@@ -148,7 +148,7 @@ namespace OpenSim.Tests.Common
148 148
149 return CreateAsset(assetUuid, assetType, anc.AssetData, creatorID); 149 return CreateAsset(assetUuid, assetType, anc.AssetData, creatorID);
150 } 150 }
151 151
152 /// <summary> 152 /// <summary>
153 /// Create an asset from the given data. 153 /// Create an asset from the given data.
154 /// </summary> 154 /// </summary>
@@ -158,9 +158,9 @@ namespace OpenSim.Tests.Common
158 asset.Data = data; 158 asset.Data = data;
159 return asset; 159 return asset;
160 } 160 }
161 161
162 public static string ReadAssetAsString(IAssetService assetService, UUID uuid) 162 public static string ReadAssetAsString(IAssetService assetService, UUID uuid)
163 { 163 {
164 byte[] assetData = assetService.GetData(uuid.ToString()); 164 byte[] assetData = assetService.GetData(uuid.ToString());
165 return Encoding.ASCII.GetString(assetData); 165 return Encoding.ASCII.GetString(assetData);
166 } 166 }
diff --git a/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs
index 82ecf9a..b27c719 100644
--- a/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Tests.Common
59 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(null), "Failed on null."); 59 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(null), "Failed on null.");
60 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(""), "Failed on empty path."); 60 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(""), "Failed on empty path.");
61 Assert.AreEqual(m_emptyStringArray, handler.SplitParams("corruptUrl"), "Failed on corrupt url."); 61 Assert.AreEqual(m_emptyStringArray, handler.SplitParams("corruptUrl"), "Failed on corrupt url.");
62 62
63 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath), "Failed on empty params."); 63 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath), "Failed on empty params.");
64 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath + "/"), "Failed on single slash."); 64 Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath + "/"), "Failed on single slash.");
65 65
diff --git a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs
index 33cd8a2..753830f 100644
--- a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Tests.Common
48 { 48 {
49 public static ScenePresence AddChildClient( 49 public static ScenePresence AddChildClient(
50 Scene scene, LLUDPServer udpServer, UUID agentId, UUID sessionId, uint circuitCode) 50 Scene scene, LLUDPServer udpServer, UUID agentId, UUID sessionId, uint circuitCode)
51 { 51 {
52 IPEndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); 52 IPEndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999);
53 53
54 UseCircuitCodePacket uccp = new UseCircuitCodePacket(); 54 UseCircuitCodePacket uccp = new UseCircuitCodePacket();
@@ -86,10 +86,10 @@ namespace OpenSim.Tests.Common
86 uint port = 0; 86 uint port = 0;
87 AgentCircuitManager acm = scene.AuthenticateHandler; 87 AgentCircuitManager acm = scene.AuthenticateHandler;
88 88
89 TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, false, configSource, acm); 89 TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, configSource, acm);
90 udpServer.AddScene(scene); 90 udpServer.AddScene(scene);
91 91
92 return udpServer; 92 return udpServer;
93 } 93 }
94 } 94 }
95} \ No newline at end of file 95}
diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs
index b215f1e..b0c9596 100644
--- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common
56 /// </summary> 56 /// </summary>
57 /// <param name='tc'></param> 57 /// <param name='tc'></param>
58 /// <param name='neighbourTcs'> 58 /// <param name='neighbourTcs'>
59 /// A list that will be populated with any TestClients set up in response to 59 /// A list that will be populated with any TestClients set up in response to
60 /// being informed about a destination region. 60 /// being informed about a destination region.
61 /// </param> 61 /// </param>
62 public static void SetupInformClientOfNeighbourTriggersNeighbourClientCreate( 62 public static void SetupInformClientOfNeighbourTriggersNeighbourClientCreate(
@@ -71,7 +71,7 @@ namespace OpenSim.Tests.Common
71 Util.RegionHandleToRegionLoc(neighbourHandle, out x, out y); 71 Util.RegionHandleToRegionLoc(neighbourHandle, out x, out y);
72 72
73 m_log.DebugFormat( 73 m_log.DebugFormat(
74 "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}", 74 "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}",
75 x, y, neighbourExternalEndPoint); 75 x, y, neighbourExternalEndPoint);
76 76
77 AgentCircuitData newAgent = tc.RequestClientInfo(); 77 AgentCircuitData newAgent = tc.RequestClientInfo();
@@ -91,20 +91,20 @@ namespace OpenSim.Tests.Common
91 /// </summary> 91 /// </summary>
92 /// <param name='tc'></param> 92 /// <param name='tc'></param>
93 /// <param name='neighbourTcs'> 93 /// <param name='neighbourTcs'>
94 /// A list that will be populated with any TestClients set up in response to 94 /// A list that will be populated with any TestClients set up in response to
95 /// being informed about a destination region. 95 /// being informed about a destination region.
96 /// </param> 96 /// </param>
97 public static void SetupSendRegionTeleportTriggersDestinationClientCreateAndCompleteMovement( 97 public static void SetupSendRegionTeleportTriggersDestinationClientCreateAndCompleteMovement(
98 TestClient client, List<TestClient> destinationClients) 98 TestClient client, List<TestClient> destinationClients)
99 { 99 {
100 client.OnTestClientSendRegionTeleport 100 client.OnTestClientSendRegionTeleport
101 += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) => 101 += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) =>
102 { 102 {
103 uint x, y; 103 uint x, y;
104 Util.RegionHandleToRegionLoc(regionHandle, out x, out y); 104 Util.RegionHandleToRegionLoc(regionHandle, out x, out y);
105 105
106 m_log.DebugFormat( 106 m_log.DebugFormat(
107 "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}", 107 "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}",
108 x, y, regionExternalEndPoint); 108 x, y, regionExternalEndPoint);
109 109
110 AgentCircuitData newAgent = client.RequestClientInfo(); 110 AgentCircuitData newAgent = client.RequestClientInfo();
@@ -120,4 +120,4 @@ namespace OpenSim.Tests.Common
120 }; 120 };
121 } 121 }
122 } 122 }
123} \ No newline at end of file 123}
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index df8b14c..7902fb1 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Tests.Common
102 102
103 m_physicsScene = StartPhysicsScene(); 103 m_physicsScene = StartPhysicsScene();
104 104
105 SimDataService 105 SimDataService
106 = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null); 106 = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
107 } 107 }
108 108
@@ -146,7 +146,7 @@ namespace OpenSim.Tests.Common
146 146
147 // We must set up a console otherwise setup of some modules may fail 147 // We must set up a console otherwise setup of some modules may fail
148 MainConsole.Instance = new MockConsole(); 148 MainConsole.Instance = new MockConsole();
149 149
150 RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); 150 RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
151 regInfo.RegionName = name; 151 regInfo.RegionName = name;
152 regInfo.RegionID = id; 152 regInfo.RegionID = id;
@@ -156,6 +156,9 @@ namespace OpenSim.Tests.Common
156 TestScene testScene = new TestScene( 156 TestScene testScene = new TestScene(
157 regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); 157 regInfo, m_acm, SimDataService, m_estateDataService, configSource, null);
158 158
159 testScene.RegionInfo.EstateSettings = new EstateSettings();
160 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
161
159 INonSharedRegionModule godsModule = new GodsModule(); 162 INonSharedRegionModule godsModule = new GodsModule();
160 godsModule.Initialise(new IniConfigSource()); 163 godsModule.Initialise(new IniConfigSource());
161 godsModule.AddRegion(testScene); 164 godsModule.AddRegion(testScene);
@@ -196,14 +199,13 @@ namespace OpenSim.Tests.Common
196 m_presenceService.AddRegion(testScene); 199 m_presenceService.AddRegion(testScene);
197 m_presenceService.RegionLoaded(testScene); 200 m_presenceService.RegionLoaded(testScene);
198 testScene.AddRegionModule(m_presenceService.Name, m_presenceService); 201 testScene.AddRegionModule(m_presenceService.Name, m_presenceService);
199 202
200 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); 203
201 testScene.SetModuleInterfaces(); 204 testScene.SetModuleInterfaces();
202 205
203 testScene.LandChannel = new TestLandChannel(testScene); 206 testScene.LandChannel = new TestLandChannel(testScene);
204 testScene.LoadWorldMap(); 207 testScene.LoadWorldMap();
205 208
206 testScene.RegionInfo.EstateSettings = new EstateSettings();
207 testScene.LoginsEnabled = true; 209 testScene.LoginsEnabled = true;
208 testScene.RegisterRegionWithGrid(); 210 testScene.RegisterRegionWithGrid();
209 211
@@ -215,10 +217,10 @@ namespace OpenSim.Tests.Common
215 private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache) 217 private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache)
216 { 218 {
217 IConfigSource config = new IniConfigSource(); 219 IConfigSource config = new IniConfigSource();
218 config.AddConfig("Modules"); 220 config.AddConfig("Modules");
219 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); 221 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
220 config.AddConfig("AssetService"); 222 config.AddConfig("AssetService");
221 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); 223 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
222 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 224 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
223 225
224 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); 226 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
@@ -233,7 +235,7 @@ namespace OpenSim.Tests.Common
233 235
234 cache.Initialise(cacheConfig); 236 cache.Initialise(cacheConfig);
235 } 237 }
236 238
237 return assetService; 239 return assetService;
238 } 240 }
239 241
@@ -255,7 +257,7 @@ namespace OpenSim.Tests.Common
255 257
256 private static LocalInventoryServicesConnector StartInventoryService() 258 private static LocalInventoryServicesConnector StartInventoryService()
257 { 259 {
258 IConfigSource config = new IniConfigSource(); 260 IConfigSource config = new IniConfigSource();
259 config.AddConfig("Modules"); 261 config.AddConfig("Modules");
260 config.AddConfig("InventoryService"); 262 config.AddConfig("InventoryService");
261 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); 263 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
@@ -264,8 +266,8 @@ namespace OpenSim.Tests.Common
264 266
265 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); 267 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
266 inventoryService.Initialise(config); 268 inventoryService.Initialise(config);
267 269
268 return inventoryService; 270 return inventoryService;
269 } 271 }
270 272
271 private static LocalGridServicesConnector StartGridService() 273 private static LocalGridServicesConnector StartGridService()
@@ -280,7 +282,7 @@ namespace OpenSim.Tests.Common
280 282
281 LocalGridServicesConnector gridService = new LocalGridServicesConnector(); 283 LocalGridServicesConnector gridService = new LocalGridServicesConnector();
282 gridService.Initialise(config); 284 gridService.Initialise(config);
283 285
284 return gridService; 286 return gridService;
285 } 287 }
286 288
@@ -301,7 +303,7 @@ namespace OpenSim.Tests.Common
301 303
302 LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector(); 304 LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector();
303 userAccountService.Initialise(config); 305 userAccountService.Initialise(config);
304 306
305 return userAccountService; 307 return userAccountService;
306 } 308 }
307 309
@@ -326,7 +328,7 @@ namespace OpenSim.Tests.Common
326 328
327 LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); 329 LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector();
328 presenceService.Initialise(config); 330 presenceService.Initialise(config);
329 331
330 return presenceService; 332 return presenceService;
331 } 333 }
332 334
@@ -382,8 +384,8 @@ namespace OpenSim.Tests.Common
382 /// </summary> 384 /// </summary>
383 /// <remarks> 385 /// <remarks>
384 /// If called directly, then all the modules must be shared modules. 386 /// If called directly, then all the modules must be shared modules.
385 /// 387 ///
386 /// We are emulating here the normal calls made to setup region modules 388 /// We are emulating here the normal calls made to setup region modules
387 /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()). 389 /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()).
388 /// TODO: Need to reuse normal runtime module code. 390 /// TODO: Need to reuse normal runtime module code.
389 /// </remarks> 391 /// </remarks>
@@ -606,7 +608,7 @@ namespace OpenSim.Tests.Common
606 /// <returns></returns> 608 /// <returns></returns>
607 public static SceneObjectGroup AddSceneObject(Scene scene) 609 public static SceneObjectGroup AddSceneObject(Scene scene)
608 { 610 {
609 return AddSceneObject(scene, "Test Object", UUID.Zero); 611 return AddSceneObject(scene, "Test Object", UUID.Random());
610 } 612 }
611 613
612 /// <summary> 614 /// <summary>
@@ -624,6 +626,7 @@ namespace OpenSim.Tests.Common
624 //part.ObjectFlags |= (uint)PrimFlags.Phantom; 626 //part.ObjectFlags |= (uint)PrimFlags.Phantom;
625 627
626 scene.AddNewSceneObject(so, true); 628 scene.AddNewSceneObject(so, true);
629 so.InvalidateDeepEffectivePerms();
627 630
628 return so; 631 return so;
629 } 632 }
@@ -650,10 +653,11 @@ namespace OpenSim.Tests.Common
650 SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail); 653 SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail);
651 654
652 scene.AddNewSceneObject(so, false); 655 scene.AddNewSceneObject(so, false);
656 so.InvalidateDeepEffectivePerms();
653 657
654 return so; 658 return so;
655 } 659 }
656 660
657 /// <summary> 661 /// <summary>
658 /// Create a scene object part. 662 /// Create a scene object part.
659 /// </summary> 663 /// </summary>
@@ -662,10 +666,10 @@ namespace OpenSim.Tests.Common
662 /// <param name="ownerId"></param> 666 /// <param name="ownerId"></param>
663 /// <returns></returns> 667 /// <returns></returns>
664 public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) 668 public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId)
665 { 669 {
666 return new SceneObjectPart( 670 return new SceneObjectPart(
667 ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 671 ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
668 { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; 672 { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) };
669 } 673 }
670 674
671 /// <summary> 675 /// <summary>
@@ -680,10 +684,10 @@ namespace OpenSim.Tests.Common
680 /// <param name="ownerId"></param> 684 /// <param name="ownerId"></param>
681 /// <returns></returns> 685 /// <returns></returns>
682 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId) 686 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId)
683 { 687 {
684 return CreateSceneObject(parts, ownerId, 0x1); 688 return CreateSceneObject(parts, ownerId, 0x1);
685 } 689 }
686 690
687 /// <summary> 691 /// <summary>
688 /// Create a scene object but do not add it to the scene. 692 /// Create a scene object but do not add it to the scene.
689 /// </summary> 693 /// </summary>
@@ -695,10 +699,10 @@ namespace OpenSim.Tests.Common
695 /// </param> 699 /// </param>
696 /// <returns></returns> 700 /// <returns></returns>
697 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail) 701 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail)
698 { 702 {
699 return CreateSceneObject(parts, ownerId, "", uuidTail); 703 return CreateSceneObject(parts, ownerId, "", uuidTail);
700 } 704 }
701 705
702 /// <summary> 706 /// <summary>
703 /// Create a scene object but do not add it to the scene. 707 /// Create a scene object but do not add it to the scene.
704 /// </summary> 708 /// </summary>
@@ -716,22 +720,22 @@ namespace OpenSim.Tests.Common
716 /// </param> 720 /// </param>
717 /// <returns></returns> 721 /// <returns></returns>
718 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail) 722 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail)
719 { 723 {
720 string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail); 724 string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail);
721 725
722 SceneObjectGroup sog 726 SceneObjectGroup sog
723 = new SceneObjectGroup( 727 = new SceneObjectGroup(
724 CreateSceneObjectPart(string.Format("{0}Part1", partNamePrefix), new UUID(rawSogId), ownerId)); 728 CreateSceneObjectPart(string.Format("{0}Part1", partNamePrefix), new UUID(rawSogId), ownerId));
725 729
726 if (parts > 1) 730 if (parts > 1)
727 for (int i = 2; i <= parts; i++) 731 for (int i = 2; i <= parts; i++)
728 sog.AddPart( 732 sog.AddPart(
729 CreateSceneObjectPart( 733 CreateSceneObjectPart(
730 string.Format("{0}Part{1}", partNamePrefix, i), 734 string.Format("{0}Part{1}", partNamePrefix, i),
731 new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i - 1)), 735 new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i - 1)),
732 ownerId)); 736 ownerId));
733 737
734 return sog; 738 return sog;
735 } 739 }
736 } 740 }
737} 741}
diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
index 3a3b33a..e3110f6 100644
--- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
@@ -78,12 +78,12 @@ namespace OpenSim.Tests.Common
78 = AssetHelpers.CreateAsset(assetID, AssetType.Notecard, nc.AssetData, UUID.Zero); 78 = AssetHelpers.CreateAsset(assetID, AssetType.Notecard, nc.AssetData, UUID.Zero);
79 assetService.Store(ncAsset); 79 assetService.Store(ncAsset);
80 80
81 TaskInventoryItem ncItem 81 TaskInventoryItem ncItem
82 = new TaskInventoryItem 82 = new TaskInventoryItem
83 { Name = itemName, AssetID = assetID, ItemID = itemID, 83 { Name = itemName, AssetID = assetID, ItemID = itemID,
84 Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard }; 84 Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard };
85 part.Inventory.AddInventoryItem(ncItem, true); 85 part.Inventory.AddInventoryItem(ncItem, true);
86 86
87 return ncItem; 87 return ncItem;
88 } 88 }
89 89
@@ -119,7 +119,7 @@ namespace OpenSim.Tests.Common
119 { 119 {
120 return AddScript(assetService, part, UUID.Random(), UUID.Random(), scriptName, scriptSource); 120 return AddScript(assetService, part, UUID.Random(), UUID.Random(), scriptName, scriptSource);
121 } 121 }
122 122
123 /// <summary> 123 /// <summary>
124 /// Add a simple script to the given part. 124 /// Add a simple script to the given part.
125 /// </summary> 125 /// </summary>
@@ -145,7 +145,7 @@ namespace OpenSim.Tests.Common
145 = AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero); 145 = AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero);
146 assetService.Store(asset); 146 assetService.Store(asset);
147 TaskInventoryItem item 147 TaskInventoryItem item
148 = new TaskInventoryItem 148 = new TaskInventoryItem
149 { Name = scriptName, AssetID = assetId, ItemID = itemId, 149 { Name = scriptName, AssetID = assetId, ItemID = itemId,
150 Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL }; 150 Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL };
151 part.Inventory.AddInventoryItem(item, true); 151 part.Inventory.AddInventoryItem(item, true);
diff --git a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs
index c62b58e..e6af34b 100644
--- a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Tests.Common
83// /// </param> 83// /// </param>
84// /// <returns></returns> 84// /// <returns></returns>
85// public static CachedUserInfo CreateUserWithInventory( 85// public static CachedUserInfo CreateUserWithInventory(
86// CommunicationsManager commsManager, string firstName, string lastName, 86// CommunicationsManager commsManager, string firstName, string lastName,
87// UUID userId, OnInventoryReceivedDelegate callback) 87// UUID userId, OnInventoryReceivedDelegate callback)
88// { 88// {
89// return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback); 89// return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback);
@@ -147,7 +147,7 @@ namespace OpenSim.Tests.Common
147 CreateUserWithInventory(scene, ua, pw); 147 CreateUserWithInventory(scene, ua, pw);
148 return ua; 148 return ua;
149 } 149 }
150 150
151 public static void CreateUserWithInventory(Scene scene, UserAccount ua, string pw) 151 public static void CreateUserWithInventory(Scene scene, UserAccount ua, string pw)
152 { 152 {
153 // FIXME: This should really be set up by UserAccount itself 153 // FIXME: This should really be set up by UserAccount itself
diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
index 5a36332..e188665 100644
--- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Tests.Common
101 Scene scene, string itemName, UUID itemId, InventoryType itemType, AssetBase asset, UUID userId) 101 Scene scene, string itemName, UUID itemId, InventoryType itemType, AssetBase asset, UUID userId)
102 { 102 {
103 return AddInventoryItem( 103 return AddInventoryItem(
104 scene, itemName, itemId, itemType, asset, userId, 104 scene, itemName, itemId, itemType, asset, userId,
105 scene.InventoryService.GetFolderForType(userId, (FolderType)asset.Type).Name); 105 scene.InventoryService.GetFolderForType(userId, (FolderType)asset.Type).Name);
106 } 106 }
107 107
@@ -128,6 +128,10 @@ namespace OpenSim.Tests.Common
128 item.Owner = userId; 128 item.Owner = userId;
129 item.AssetType = asset.Type; 129 item.AssetType = asset.Type;
130 item.InvType = (int)itemType; 130 item.InvType = (int)itemType;
131 item.BasePermissions = (uint)OpenMetaverse.PermissionMask.All |
132 (uint)(Framework.PermissionMask.FoldedMask | Framework.PermissionMask.FoldedCopy | Framework.PermissionMask.FoldedModify | Framework.PermissionMask.FoldedTransfer);
133 item.CurrentPermissions = (uint)OpenMetaverse.PermissionMask.All |
134 (uint)(Framework.PermissionMask.FoldedMask | Framework.PermissionMask.FoldedCopy | Framework.PermissionMask.FoldedModify | Framework.PermissionMask.FoldedTransfer);
131 135
132 InventoryFolderBase folder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, path)[0]; 136 InventoryFolderBase folder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, path)[0];
133 137
@@ -207,7 +211,7 @@ namespace OpenSim.Tests.Common
207 /// </param> 211 /// </param>
208 /// <param name="useExistingFolders"> 212 /// <param name="useExistingFolders">
209 /// If true, then folders in the path which already the same name are 213 /// If true, then folders in the path which already the same name are
210 /// used. This applies to the terminal folder as well. 214 /// used. This applies to the terminal folder as well.
211 /// If false, then all folders in the path are created, even if there is already a folder at a particular 215 /// If false, then all folders in the path are created, even if there is already a folder at a particular
212 /// level with the same name. 216 /// level with the same name.
213 /// </param> 217 /// </param>
@@ -232,7 +236,7 @@ namespace OpenSim.Tests.Common
232 /// </param> 236 /// </param>
233 /// <param name="useExistingFolders"> 237 /// <param name="useExistingFolders">
234 /// If true, then folders in the path which already the same name are 238 /// If true, then folders in the path which already the same name are
235 /// used. This applies to the terminal folder as well. 239 /// used. This applies to the terminal folder as well.
236 /// If false, then all folders in the path are created, even if there is already a folder at a particular 240 /// If false, then all folders in the path are created, even if there is already a folder at a particular
237 /// level with the same name. 241 /// level with the same name.
238 /// </param> 242 /// </param>
@@ -255,7 +259,7 @@ namespace OpenSim.Tests.Common
255 /// Create inventory folders starting from a given parent folder 259 /// Create inventory folders starting from a given parent folder
256 /// </summary> 260 /// </summary>
257 /// <remarks> 261 /// <remarks>
258 /// If any stem of the path names folders that already exist then these are not recreated. This includes the 262 /// If any stem of the path names folders that already exist then these are not recreated. This includes the
259 /// final folder. 263 /// final folder.
260 /// TODO: May need to make it an option to create duplicate folders. 264 /// TODO: May need to make it an option to create duplicate folders.
261 /// </remarks> 265 /// </remarks>
@@ -267,7 +271,7 @@ namespace OpenSim.Tests.Common
267 /// </param> 271 /// </param>
268 /// <param name="useExistingFolders"> 272 /// <param name="useExistingFolders">
269 /// If true, then folders in the path which already the same name are 273 /// If true, then folders in the path which already the same name are
270 /// used. This applies to the terminal folder as well. 274 /// used. This applies to the terminal folder as well.
271 /// If false, then all folders in the path are created, even if there is already a folder at a particular 275 /// If false, then all folders in the path are created, even if there is already a folder at a particular
272 /// level with the same name. 276 /// level with the same name.
273 /// </param> 277 /// </param>
@@ -295,10 +299,10 @@ namespace OpenSim.Tests.Common
295 else 299 else
296 folderIdForCreate = folderId; 300 folderIdForCreate = folderId;
297 301
298 folder 302 folder
299 = new InventoryFolderBase( 303 = new InventoryFolderBase(
300 folderIdForCreate, components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0); 304 folderIdForCreate, components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0);
301 305
302 inventoryService.AddFolder(folder); 306 inventoryService.AddFolder(folder);
303 } 307 }
304// else 308// else
@@ -367,4 +371,4 @@ namespace OpenSim.Tests.Common
367 return InventoryArchiveUtils.FindItemsByPath(inventoryService, userId, path); 371 return InventoryArchiveUtils.FindItemsByPath(inventoryService, userId, path);
368 } 372 }
369 } 373 }
370} \ No newline at end of file 374}