diff options
Diffstat (limited to '')
36 files changed, 1621 insertions, 281 deletions
diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs new file mode 100644 index 0000000..7d3aee3 --- /dev/null +++ b/OpenSim/Tests/Clients/Grid/GridClient.cs | |||
@@ -0,0 +1,205 @@ | |||
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 System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using System.Reflection; | ||
32 | |||
33 | using OpenMetaverse; | ||
34 | using log4net; | ||
35 | using log4net.Appender; | ||
36 | using log4net.Layout; | ||
37 | |||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
41 | using OpenSim.Services.Connectors; | ||
42 | |||
43 | namespace OpenSim.Tests.Clients.GridClient | ||
44 | { | ||
45 | public class GridClient | ||
46 | { | ||
47 | // private static readonly ILog m_log = | ||
48 | // LogManager.GetLogger( | ||
49 | // MethodBase.GetCurrentMethod().DeclaringType); | ||
50 | |||
51 | public static void Main(string[] args) | ||
52 | { | ||
53 | ConsoleAppender consoleAppender = new ConsoleAppender(); | ||
54 | consoleAppender.Layout = | ||
55 | new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); | ||
56 | log4net.Config.BasicConfigurator.Configure(consoleAppender); | ||
57 | |||
58 | string serverURI = "http://127.0.0.1:8001"; | ||
59 | GridServicesConnector m_Connector = new GridServicesConnector(serverURI); | ||
60 | |||
61 | GridRegion r1 = CreateRegion("Test Region 1", 1000, 1000); | ||
62 | GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000); | ||
63 | GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); | ||
64 | |||
65 | Console.WriteLine("[GRID CLIENT]: *** Registering region 1"); | ||
66 | string msg = m_Connector.RegisterRegion(UUID.Zero, r1); | ||
67 | if (msg == String.Empty) | ||
68 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 1"); | ||
69 | else | ||
70 | Console.WriteLine("[GRID CLIENT]: region 1 failed to register"); | ||
71 | |||
72 | Console.WriteLine("[GRID CLIENT]: *** Registering region 2"); | ||
73 | msg = m_Connector.RegisterRegion(UUID.Zero, r2); | ||
74 | if (msg == String.Empty) | ||
75 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 2"); | ||
76 | else | ||
77 | Console.WriteLine("[GRID CLIENT]: region 2 failed to register"); | ||
78 | |||
79 | Console.WriteLine("[GRID CLIENT]: *** Registering region 3"); | ||
80 | msg = m_Connector.RegisterRegion(UUID.Zero, r3); | ||
81 | if (msg == String.Empty) | ||
82 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); | ||
83 | else | ||
84 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); | ||
85 | |||
86 | |||
87 | bool success; | ||
88 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); | ||
89 | success = m_Connector.DeregisterRegion(r3.RegionID); | ||
90 | if (success) | ||
91 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); | ||
92 | else | ||
93 | Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); | ||
94 | Console.WriteLine("[GRID CLIENT]: *** Registering region 3 again"); | ||
95 | msg = m_Connector.RegisterRegion(UUID.Zero, r3); | ||
96 | if (msg == String.Empty) | ||
97 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); | ||
98 | else | ||
99 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); | ||
100 | |||
101 | Console.WriteLine("[GRID CLIENT]: *** GetNeighbours of region 1"); | ||
102 | List<GridRegion> regions = m_Connector.GetNeighbours(UUID.Zero, r1.RegionID); | ||
103 | if (regions == null) | ||
104 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 failed"); | ||
105 | else if (regions.Count > 0) | ||
106 | { | ||
107 | if (regions.Count != 1) | ||
108 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned more neighbours than expected: " + regions.Count); | ||
109 | else | ||
110 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned the right neighbour " + regions[0].RegionName); | ||
111 | } | ||
112 | else | ||
113 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned 0 neighbours"); | ||
114 | |||
115 | |||
116 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of region 2 (this should succeed)"); | ||
117 | GridRegion region = m_Connector.GetRegionByUUID(UUID.Zero, r2.RegionID); | ||
118 | if (region == null) | ||
119 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); | ||
120 | else | ||
121 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); | ||
122 | |||
123 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of non-existent region (this should fail)"); | ||
124 | region = m_Connector.GetRegionByUUID(UUID.Zero, UUID.Random()); | ||
125 | if (region == null) | ||
126 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); | ||
127 | else | ||
128 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); | ||
129 | |||
130 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of region 3 (this should succeed)"); | ||
131 | region = m_Connector.GetRegionByName(UUID.Zero, r3.RegionName); | ||
132 | if (region == null) | ||
133 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); | ||
134 | else | ||
135 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); | ||
136 | |||
137 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of non-existent region (this should fail)"); | ||
138 | region = m_Connector.GetRegionByName(UUID.Zero, "Foo"); | ||
139 | if (region == null) | ||
140 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); | ||
141 | else | ||
142 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); | ||
143 | |||
144 | Console.WriteLine("[GRID CLIENT]: *** GetRegionsByName (this should return 3 regions)"); | ||
145 | regions = m_Connector.GetRegionsByName(UUID.Zero, "Test", 10); | ||
146 | if (regions == null) | ||
147 | Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned null"); | ||
148 | else | ||
149 | Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned " + regions.Count + " regions"); | ||
150 | |||
151 | Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)"); | ||
152 | regions = m_Connector.GetRegionRange(UUID.Zero, | ||
153 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), | ||
154 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); | ||
155 | if (regions == null) | ||
156 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); | ||
157 | else | ||
158 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); | ||
159 | Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 0 regions)"); | ||
160 | regions = m_Connector.GetRegionRange(UUID.Zero, | ||
161 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950), | ||
162 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950) ); | ||
163 | if (regions == null) | ||
164 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); | ||
165 | else | ||
166 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); | ||
167 | |||
168 | Console.Write("Proceed to deregister? Press enter..."); | ||
169 | Console.ReadLine(); | ||
170 | |||
171 | // Deregister them all | ||
172 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 1"); | ||
173 | success = m_Connector.DeregisterRegion(r1.RegionID); | ||
174 | if (success) | ||
175 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 1"); | ||
176 | else | ||
177 | Console.WriteLine("[GRID CLIENT]: region 1 failed to deregister"); | ||
178 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 2"); | ||
179 | success = m_Connector.DeregisterRegion(r2.RegionID); | ||
180 | if (success) | ||
181 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 2"); | ||
182 | else | ||
183 | Console.WriteLine("[GRID CLIENT]: region 2 failed to deregister"); | ||
184 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); | ||
185 | success = m_Connector.DeregisterRegion(r3.RegionID); | ||
186 | if (success) | ||
187 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); | ||
188 | else | ||
189 | Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); | ||
190 | |||
191 | } | ||
192 | |||
193 | private static GridRegion CreateRegion(string name, uint xcell, uint ycell) | ||
194 | { | ||
195 | GridRegion region = new GridRegion(xcell, ycell); | ||
196 | region.RegionName = name; | ||
197 | region.RegionID = UUID.Random(); | ||
198 | region.ExternalHostName = "127.0.0.1"; | ||
199 | region.HttpPort = 9000; | ||
200 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); | ||
201 | |||
202 | return region; | ||
203 | } | ||
204 | } | ||
205 | } | ||
diff --git a/OpenSim/Tests/Common/DatabaseTestAttribute.cs b/OpenSim/Tests/Common/DatabaseTestAttribute.cs index d027d59..d6a03cd 100644 --- a/OpenSim/Tests/Common/DatabaseTestAttribute.cs +++ b/OpenSim/Tests/Common/DatabaseTestAttribute.cs | |||
@@ -32,13 +32,13 @@ using NUnit.Framework; | |||
32 | 32 | ||
33 | namespace OpenSim.Tests.Common | 33 | namespace OpenSim.Tests.Common |
34 | { | 34 | { |
35 | [AttributeUsage(AttributeTargets.All, | 35 | [AttributeUsage(AttributeTargets.All, |
36 | AllowMultiple=false, | 36 | AllowMultiple=false, |
37 | Inherited=true)] | 37 | Inherited=true)] |
38 | public class DatabaseTestAttribute : LongRunningAttribute | 38 | public class DatabaseTestAttribute : LongRunningAttribute |
39 | { | 39 | { |
40 | public DatabaseTestAttribute() : base("Database") | 40 | public DatabaseTestAttribute() : base("Database") |
41 | { | 41 | { |
42 | } | 42 | } |
43 | } | 43 | } |
44 | } \ No newline at end of file | 44 | } \ No newline at end of file |
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 | } |
diff --git a/OpenSim/Tests/Common/LongRunningAttribute.cs b/OpenSim/Tests/Common/LongRunningAttribute.cs index 9831ea8..6013fcb 100644 --- a/OpenSim/Tests/Common/LongRunningAttribute.cs +++ b/OpenSim/Tests/Common/LongRunningAttribute.cs | |||
@@ -35,11 +35,11 @@ namespace OpenSim.Tests.Common | |||
35 | [AttributeUsage(AttributeTargets.All, | 35 | [AttributeUsage(AttributeTargets.All, |
36 | AllowMultiple = false, | 36 | AllowMultiple = false, |
37 | Inherited = true)] | 37 | Inherited = true)] |
38 | public class LongRunningAttribute : CategoryAttribute | 38 | public class LongRunningAttribute : CategoryAttribute |
39 | { | 39 | { |
40 | public LongRunningAttribute() : this("Long Running Test") | 40 | public LongRunningAttribute() : this("Long Running Test") |
41 | { | 41 | { |
42 | 42 | ||
43 | } | 43 | } |
44 | 44 | ||
45 | protected LongRunningAttribute(string category) : base(category) | 45 | protected LongRunningAttribute(string category) : base(category) |
diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index cb4fb80..d0430ff 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Tests.Common | |||
36 | { | 36 | { |
37 | protected Dictionary<UUID, AssetBase> Assets = new Dictionary<UUID, AssetBase>(); | 37 | protected Dictionary<UUID, AssetBase> Assets = new Dictionary<UUID, AssetBase>(); |
38 | 38 | ||
39 | public AssetBase FetchAsset(UUID uuid) | 39 | public AssetBase FetchAsset(UUID uuid) |
40 | { | 40 | { |
41 | if (AssetsExist(new[] { uuid })[0]) | 41 | if (AssetsExist(new[] { uuid })[0]) |
42 | return Assets[uuid]; | 42 | return Assets[uuid]; |
@@ -44,17 +44,17 @@ namespace OpenSim.Tests.Common | |||
44 | return null; | 44 | return null; |
45 | } | 45 | } |
46 | 46 | ||
47 | public void CreateAsset(AssetBase asset) | 47 | public void CreateAsset(AssetBase asset) |
48 | { | 48 | { |
49 | Assets[asset.FullID] = asset; | 49 | Assets[asset.FullID] = asset; |
50 | } | 50 | } |
51 | 51 | ||
52 | public void UpdateAsset(AssetBase asset) | 52 | public void UpdateAsset(AssetBase asset) |
53 | { | 53 | { |
54 | CreateAsset(asset); | 54 | CreateAsset(asset); |
55 | } | 55 | } |
56 | 56 | ||
57 | public bool[] AssetsExist(UUID[] uuids) | 57 | public bool[] AssetsExist(UUID[] uuids) |
58 | { | 58 | { |
59 | return Array.ConvertAll(uuids, id => Assets.ContainsKey(id)); | 59 | return Array.ConvertAll(uuids, id => Assets.ContainsKey(id)); |
60 | } | 60 | } |
diff --git a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs index dddf75d..aaf61e7 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | |||
@@ -54,9 +54,10 @@ namespace OpenSim.Tests.Common | |||
54 | return assets.Find(x=>x.FullID == uuid); | 54 | return assets.Find(x=>x.FullID == uuid); |
55 | } | 55 | } |
56 | 56 | ||
57 | public void StoreAsset(AssetBase asset) | 57 | public bool StoreAsset(AssetBase asset) |
58 | { | 58 | { |
59 | assets.Add(asset); | 59 | assets.Add(asset); |
60 | return true; | ||
60 | } | 61 | } |
61 | 62 | ||
62 | public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); } | 63 | public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); } |
diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index 7f530d0..e9deac7 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs | |||
@@ -85,8 +85,8 @@ namespace OpenSim.Tests.Common | |||
85 | { | 85 | { |
86 | } | 86 | } |
87 | 87 | ||
88 | public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, | 88 | public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, |
89 | int membershipFee, bool openEnrollment, bool allowPublish, | 89 | int membershipFee, bool openEnrollment, bool allowPublish, |
90 | bool maturePublish, UUID founderID) | 90 | bool maturePublish, UUID founderID) |
91 | { | 91 | { |
92 | XGroup group = new XGroup() | 92 | XGroup group = new XGroup() |
@@ -118,13 +118,13 @@ namespace OpenSim.Tests.Common | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, | 121 | public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, |
122 | UUID insigniaID, int membershipFee, bool openEnrollment, | 122 | UUID insigniaID, int membershipFee, bool openEnrollment, |
123 | bool allowPublish, bool maturePublish) | 123 | bool allowPublish, bool maturePublish) |
124 | { | 124 | { |
125 | } | 125 | } |
126 | 126 | ||
127 | public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, | 127 | public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, |
128 | string title, ulong powers) | 128 | string title, ulong powers) |
129 | { | 129 | { |
130 | } | 130 | } |
@@ -133,7 +133,7 @@ namespace OpenSim.Tests.Common | |||
133 | { | 133 | { |
134 | } | 134 | } |
135 | 135 | ||
136 | public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, | 136 | public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, |
137 | string title, ulong powers) | 137 | string title, ulong powers) |
138 | { | 138 | { |
139 | } | 139 | } |
@@ -144,7 +144,7 @@ namespace OpenSim.Tests.Common | |||
144 | 144 | ||
145 | 145 | ||
146 | if (group == null) | 146 | if (group == null) |
147 | m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: No group found with ID {0}", groupID); | 147 | m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: No group found with ID {0}", groupID); |
148 | 148 | ||
149 | return group; | 149 | return group; |
150 | } | 150 | } |
@@ -152,7 +152,7 @@ namespace OpenSim.Tests.Common | |||
152 | public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) | 152 | public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) |
153 | { | 153 | { |
154 | m_log.DebugFormat( | 154 | m_log.DebugFormat( |
155 | "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", | 155 | "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", |
156 | groupID, groupName); | 156 | groupID, groupName); |
157 | 157 | ||
158 | XGroup xg = GetXGroup(groupID, groupName); | 158 | XGroup xg = GetXGroup(groupID, groupName); |
@@ -194,7 +194,7 @@ namespace OpenSim.Tests.Common | |||
194 | public void SetAgentGroupInfo(UUID requestingAgentID, UUID agentID, UUID groupID, bool acceptNotices, bool listInProfile) | 194 | public void SetAgentGroupInfo(UUID requestingAgentID, UUID agentID, UUID groupID, bool acceptNotices, bool listInProfile) |
195 | { | 195 | { |
196 | m_log.DebugFormat( | 196 | m_log.DebugFormat( |
197 | "[MOCK GROUPS SERVICES CONNECTOR]: SetAgentGroupInfo, requestingAgentID {0}, agentID {1}, groupID {2}, acceptNotices {3}, listInProfile {4}", | 197 | "[MOCK GROUPS SERVICES CONNECTOR]: SetAgentGroupInfo, requestingAgentID {0}, agentID {1}, groupID {2}, acceptNotices {3}, listInProfile {4}", |
198 | requestingAgentID, agentID, groupID, acceptNotices, listInProfile); | 198 | requestingAgentID, agentID, groupID, acceptNotices, listInProfile); |
199 | 199 | ||
200 | XGroup group = GetXGroup(groupID, null); | 200 | XGroup group = GetXGroup(groupID, null); |
@@ -228,7 +228,7 @@ namespace OpenSim.Tests.Common | |||
228 | public void AddAgentToGroup(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID) | 228 | public void AddAgentToGroup(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID) |
229 | { | 229 | { |
230 | m_log.DebugFormat( | 230 | m_log.DebugFormat( |
231 | "[MOCK GROUPS SERVICES CONNECTOR]: AddAgentToGroup, requestingAgentID {0}, agentID {1}, groupID {2}, roleID {3}", | 231 | "[MOCK GROUPS SERVICES CONNECTOR]: AddAgentToGroup, requestingAgentID {0}, agentID {1}, groupID {2}, roleID {3}", |
232 | requestingAgentID, agentID, groupID, roleID); | 232 | requestingAgentID, agentID, groupID, roleID); |
233 | 233 | ||
234 | XGroup group = GetXGroup(groupID, null); | 234 | XGroup group = GetXGroup(groupID, null); |
@@ -348,7 +348,7 @@ namespace OpenSim.Tests.Common | |||
348 | 348 | ||
349 | return notices; | 349 | return notices; |
350 | } | 350 | } |
351 | 351 | ||
352 | public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) | 352 | public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) |
353 | { | 353 | { |
354 | m_log.DebugFormat( | 354 | m_log.DebugFormat( |
@@ -378,14 +378,14 @@ namespace OpenSim.Tests.Common | |||
378 | return gni; | 378 | return gni; |
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
382 | return null; | 382 | return null; |
383 | } | 383 | } |
384 | 384 | ||
385 | public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) | 385 | public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) |
386 | { | 386 | { |
387 | m_log.DebugFormat( | 387 | m_log.DebugFormat( |
388 | "[MOCK GROUPS SERVICES CONNECTOR]: AddGroupNotice, requestingAgentID {0}, groupID {1}, noticeID {2}, fromName {3}, subject {4}, message {5}, binaryBucket.Length {6}", | 388 | "[MOCK GROUPS SERVICES CONNECTOR]: AddGroupNotice, requestingAgentID {0}, groupID {1}, noticeID {2}, fromName {3}, subject {4}, message {5}, binaryBucket.Length {6}", |
389 | requestingAgentID, groupID, noticeID, fromName, subject, message, binaryBucket.Length); | 389 | requestingAgentID, groupID, noticeID, fromName, subject, message, binaryBucket.Length); |
390 | 390 | ||
391 | XGroup group = GetXGroup(groupID, null); | 391 | XGroup group = GetXGroup(groupID, null); |
diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 5df8e04..a73a0b8 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | |||
@@ -74,6 +74,11 @@ namespace OpenSim.Data.Null | |||
74 | m_store.StoreTerrain(terrain, regionID); | 74 | m_store.StoreTerrain(terrain, regionID); |
75 | } | 75 | } |
76 | 76 | ||
77 | public void StoreBakedTerrain(TerrainData terrain, UUID regionID) | ||
78 | { | ||
79 | m_store.StoreBakedTerrain(terrain, regionID); | ||
80 | } | ||
81 | |||
77 | public double[,] LoadTerrain(UUID regionID) | 82 | public double[,] LoadTerrain(UUID regionID) |
78 | { | 83 | { |
79 | return m_store.LoadTerrain(regionID); | 84 | return m_store.LoadTerrain(regionID); |
@@ -84,6 +89,11 @@ namespace OpenSim.Data.Null | |||
84 | return m_store.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); | 89 | return m_store.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); |
85 | } | 90 | } |
86 | 91 | ||
92 | public TerrainData LoadBakedTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) | ||
93 | { | ||
94 | return m_store.LoadBakedTerrain(regionID, pSizeX, pSizeY, pSizeZ); | ||
95 | } | ||
96 | |||
87 | public void StoreLandObject(ILandObject Parcel) | 97 | public void StoreLandObject(ILandObject Parcel) |
88 | { | 98 | { |
89 | m_store.StoreLandObject(Parcel); | 99 | m_store.StoreLandObject(Parcel); |
@@ -138,6 +148,11 @@ namespace OpenSim.Data.Null | |||
138 | m_store.RemoveRegionEnvironmentSettings(regionUUID); | 148 | m_store.RemoveRegionEnvironmentSettings(regionUUID); |
139 | } | 149 | } |
140 | 150 | ||
151 | public UUID[] GetObjectIDs(UUID regionID) | ||
152 | { | ||
153 | return new UUID[0]; | ||
154 | } | ||
155 | |||
141 | public void SaveExtra(UUID regionID, string name, string value) | 156 | public void SaveExtra(UUID regionID, string name, string value) |
142 | { | 157 | { |
143 | } | 158 | } |
@@ -159,14 +174,15 @@ namespace OpenSim.Data.Null | |||
159 | public class NullDataStore : ISimulationDataStore | 174 | public class NullDataStore : ISimulationDataStore |
160 | { | 175 | { |
161 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 176 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
162 | 177 | ||
163 | protected Dictionary<UUID, RegionSettings> m_regionSettings = new Dictionary<UUID, RegionSettings>(); | 178 | protected Dictionary<UUID, RegionSettings> m_regionSettings = new Dictionary<UUID, RegionSettings>(); |
164 | protected Dictionary<UUID, SceneObjectPart> m_sceneObjectParts = new Dictionary<UUID, SceneObjectPart>(); | 179 | protected Dictionary<UUID, SceneObjectPart> m_sceneObjectParts = new Dictionary<UUID, SceneObjectPart>(); |
165 | protected Dictionary<UUID, ICollection<TaskInventoryItem>> m_primItems | 180 | protected Dictionary<UUID, ICollection<TaskInventoryItem>> m_primItems |
166 | = new Dictionary<UUID, ICollection<TaskInventoryItem>>(); | 181 | = new Dictionary<UUID, ICollection<TaskInventoryItem>>(); |
167 | protected Dictionary<UUID, TerrainData> m_terrains = new Dictionary<UUID, TerrainData>(); | 182 | protected Dictionary<UUID, TerrainData> m_terrains = new Dictionary<UUID, TerrainData>(); |
183 | protected Dictionary<UUID, TerrainData> m_bakedterrains = new Dictionary<UUID, TerrainData>(); | ||
168 | protected Dictionary<UUID, LandData> m_landData = new Dictionary<UUID, LandData>(); | 184 | protected Dictionary<UUID, LandData> m_landData = new Dictionary<UUID, LandData>(); |
169 | 185 | ||
170 | public void Initialise(string dbfile) | 186 | public void Initialise(string dbfile) |
171 | { | 187 | { |
172 | return; | 188 | return; |
@@ -180,14 +196,14 @@ namespace OpenSim.Data.Null | |||
180 | { | 196 | { |
181 | m_regionSettings[rs.RegionUUID] = rs; | 197 | m_regionSettings[rs.RegionUUID] = rs; |
182 | } | 198 | } |
183 | 199 | ||
184 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) | 200 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
185 | { | 201 | { |
186 | //This connector doesn't support the windlight module yet | 202 | //This connector doesn't support the windlight module yet |
187 | //Return default LL windlight settings | 203 | //Return default LL windlight settings |
188 | return new RegionLightShareData(); | 204 | return new RegionLightShareData(); |
189 | } | 205 | } |
190 | 206 | ||
191 | public void RemoveRegionWindlightSettings(UUID regionID) | 207 | public void RemoveRegionWindlightSettings(UUID regionID) |
192 | { | 208 | { |
193 | } | 209 | } |
@@ -222,7 +238,7 @@ namespace OpenSim.Data.Null | |||
222 | 238 | ||
223 | if (rs == null) | 239 | if (rs == null) |
224 | rs = new RegionSettings(); | 240 | rs = new RegionSettings(); |
225 | 241 | ||
226 | return rs; | 242 | return rs; |
227 | } | 243 | } |
228 | 244 | ||
@@ -234,9 +250,9 @@ namespace OpenSim.Data.Null | |||
234 | foreach (SceneObjectPart prim in obj.Parts) | 250 | foreach (SceneObjectPart prim in obj.Parts) |
235 | { | 251 | { |
236 | // m_log.DebugFormat( | 252 | // m_log.DebugFormat( |
237 | // "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", | 253 | // "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", |
238 | // prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); | 254 | // prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); |
239 | 255 | ||
240 | m_sceneObjectParts[prim.UUID] = prim; | 256 | m_sceneObjectParts[prim.UUID] = prim; |
241 | } | 257 | } |
242 | } | 258 | } |
@@ -250,7 +266,7 @@ namespace OpenSim.Data.Null | |||
250 | if (part.ParentGroup.UUID == obj) | 266 | if (part.ParentGroup.UUID == obj) |
251 | { | 267 | { |
252 | // m_log.DebugFormat( | 268 | // m_log.DebugFormat( |
253 | // "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", | 269 | // "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", |
254 | // part.Name, part.UUID, obj, regionUUID); | 270 | // part.Name, part.UUID, obj, regionUUID); |
255 | m_sceneObjectParts.Remove(part.UUID); | 271 | m_sceneObjectParts.Remove(part.UUID); |
256 | } | 272 | } |
@@ -265,7 +281,7 @@ namespace OpenSim.Data.Null | |||
265 | public List<SceneObjectGroup> LoadObjects(UUID regionUUID) | 281 | public List<SceneObjectGroup> LoadObjects(UUID regionUUID) |
266 | { | 282 | { |
267 | Dictionary<UUID, SceneObjectGroup> objects = new Dictionary<UUID, SceneObjectGroup>(); | 283 | Dictionary<UUID, SceneObjectGroup> objects = new Dictionary<UUID, SceneObjectGroup>(); |
268 | 284 | ||
269 | // Create all of the SOGs from the root prims first | 285 | // Create all of the SOGs from the root prims first |
270 | foreach (SceneObjectPart prim in m_sceneObjectParts.Values) | 286 | foreach (SceneObjectPart prim in m_sceneObjectParts.Values) |
271 | { | 287 | { |
@@ -302,10 +318,10 @@ namespace OpenSim.Data.Null | |||
302 | } | 318 | } |
303 | } | 319 | } |
304 | } | 320 | } |
305 | 321 | ||
306 | // TODO: Load items. This is assymetric - we store items as a separate method but don't retrieve them that | 322 | // TODO: Load items. This is assymetric - we store items as a separate method but don't retrieve them that |
307 | // way! | 323 | // way! |
308 | 324 | ||
309 | return new List<SceneObjectGroup>(objects.Values); | 325 | return new List<SceneObjectGroup>(objects.Values); |
310 | } | 326 | } |
311 | 327 | ||
@@ -314,6 +330,11 @@ namespace OpenSim.Data.Null | |||
314 | m_terrains[regionID] = ter; | 330 | m_terrains[regionID] = ter; |
315 | } | 331 | } |
316 | 332 | ||
333 | public void StoreBakedTerrain(TerrainData ter, UUID regionID) | ||
334 | { | ||
335 | m_bakedterrains[regionID] = ter; | ||
336 | } | ||
337 | |||
317 | public void StoreTerrain(double[,] ter, UUID regionID) | 338 | public void StoreTerrain(double[,] ter, UUID regionID) |
318 | { | 339 | { |
319 | m_terrains[regionID] = new HeightmapTerrainData(ter); | 340 | m_terrains[regionID] = new HeightmapTerrainData(ter); |
@@ -327,6 +348,14 @@ namespace OpenSim.Data.Null | |||
327 | return null; | 348 | return null; |
328 | } | 349 | } |
329 | 350 | ||
351 | public TerrainData LoadBakedTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) | ||
352 | { | ||
353 | if (m_bakedterrains.ContainsKey(regionID)) | ||
354 | return m_bakedterrains[regionID]; | ||
355 | else | ||
356 | return null; | ||
357 | } | ||
358 | |||
330 | public double[,] LoadTerrain(UUID regionID) | 359 | public double[,] LoadTerrain(UUID regionID) |
331 | { | 360 | { |
332 | if (m_terrains.ContainsKey(regionID)) | 361 | if (m_terrains.ContainsKey(regionID)) |
@@ -355,6 +384,11 @@ namespace OpenSim.Data.Null | |||
355 | { | 384 | { |
356 | } | 385 | } |
357 | 386 | ||
387 | public UUID[] GetObjectIDs(UUID regionID) | ||
388 | { | ||
389 | return new UUID[0]; | ||
390 | } | ||
391 | |||
358 | public void SaveExtra(UUID regionID, string name, string value) | 392 | public void SaveExtra(UUID regionID, string name, string value) |
359 | { | 393 | { |
360 | } | 394 | } |
diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index d7a144c..9d426f6 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs | |||
@@ -40,7 +40,7 @@ using OpenSim.Region.ScriptEngine.Shared; | |||
40 | namespace OpenSim.Tests.Common | 40 | namespace OpenSim.Tests.Common |
41 | { | 41 | { |
42 | public class MockScriptEngine : INonSharedRegionModule, IScriptModule, IScriptEngine | 42 | public class MockScriptEngine : INonSharedRegionModule, IScriptModule, IScriptEngine |
43 | { | 43 | { |
44 | public IConfigSource ConfigSource { get; private set; } | 44 | public IConfigSource ConfigSource { get; private set; } |
45 | 45 | ||
46 | public IConfig Config { get; private set; } | 46 | public IConfig Config { get; private set; } |
@@ -89,7 +89,7 @@ namespace OpenSim.Tests.Common | |||
89 | { | 89 | { |
90 | } | 90 | } |
91 | 91 | ||
92 | public string Name { get { return "Mock Script Engine"; } } | 92 | public string Name { get { return "Mock Script Engine"; } } |
93 | public string ScriptEngineName { get { return Name; } } | 93 | public string ScriptEngineName { get { return Name; } } |
94 | 94 | ||
95 | public Type ReplaceableInterface { get { return null; } } | 95 | public Type ReplaceableInterface { get { return null; } } |
@@ -200,7 +200,7 @@ namespace OpenSim.Tests.Common | |||
200 | { | 200 | { |
201 | throw new System.NotImplementedException (); | 201 | throw new System.NotImplementedException (); |
202 | } | 202 | } |
203 | 203 | ||
204 | public IScriptWorkItem QueueEventHandler(object parms) | 204 | public IScriptWorkItem QueueEventHandler(object parms) |
205 | { | 205 | { |
206 | throw new System.NotImplementedException (); | 206 | throw new System.NotImplementedException (); |
@@ -221,7 +221,7 @@ namespace OpenSim.Tests.Common | |||
221 | throw new System.NotImplementedException (); | 221 | throw new System.NotImplementedException (); |
222 | } | 222 | } |
223 | 223 | ||
224 | public void SetScriptState(UUID itemID, bool state) | 224 | public void SetScriptState(UUID itemID, bool state, bool self) |
225 | { | 225 | { |
226 | throw new System.NotImplementedException (); | 226 | throw new System.NotImplementedException (); |
227 | } | 227 | } |
@@ -258,7 +258,7 @@ namespace OpenSim.Tests.Common | |||
258 | 258 | ||
259 | public string[] ScriptReferencedAssemblies { get { throw new System.NotImplementedException (); } } | 259 | public string[] ScriptReferencedAssemblies { get { throw new System.NotImplementedException (); } } |
260 | 260 | ||
261 | public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } | 261 | public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } |
262 | 262 | ||
263 | public void ClearPostedEvents() | 263 | public void ClearPostedEvents() |
264 | { | 264 | { |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0e1bc8f..449716b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Tests.Common | |||
88 | public event MoneyTransferRequest OnMoneyTransferRequest; | 88 | public event MoneyTransferRequest OnMoneyTransferRequest; |
89 | public event ParcelBuy OnParcelBuy; | 89 | public event ParcelBuy OnParcelBuy; |
90 | public event Action<IClientAPI> OnConnectionClosed; | 90 | public event Action<IClientAPI> OnConnectionClosed; |
91 | 91 | public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | |
92 | public event ImprovedInstantMessage OnInstantMessage; | 92 | public event ImprovedInstantMessage OnInstantMessage; |
93 | public event ChatMessage OnChatFromClient; | 93 | public event ChatMessage OnChatFromClient; |
94 | public event TextureRequest OnRequestTexture; | 94 | public event TextureRequest OnRequestTexture; |
@@ -105,6 +105,7 @@ namespace OpenSim.Tests.Common | |||
105 | public event ObjectDrop OnObjectDrop; | 105 | public event ObjectDrop OnObjectDrop; |
106 | public event StartAnim OnStartAnim; | 106 | public event StartAnim OnStartAnim; |
107 | public event StopAnim OnStopAnim; | 107 | public event StopAnim OnStopAnim; |
108 | public event ChangeAnim OnChangeAnim; | ||
108 | public event LinkObjects OnLinkObjects; | 109 | public event LinkObjects OnLinkObjects; |
109 | public event DelinkObjects OnDelinkObjects; | 110 | public event DelinkObjects OnDelinkObjects; |
110 | public event RequestMapBlocks OnRequestMapBlocks; | 111 | public event RequestMapBlocks OnRequestMapBlocks; |
@@ -117,6 +118,7 @@ namespace OpenSim.Tests.Common | |||
117 | public event SetAlwaysRun OnSetAlwaysRun; | 118 | public event SetAlwaysRun OnSetAlwaysRun; |
118 | 119 | ||
119 | public event DeRezObject OnDeRezObject; | 120 | public event DeRezObject OnDeRezObject; |
121 | public event RezRestoreToWorld OnRezRestoreToWorld; | ||
120 | public event Action<IClientAPI> OnRegionHandShakeReply; | 122 | public event Action<IClientAPI> OnRegionHandShakeReply; |
121 | public event GenericCall1 OnRequestWearables; | 123 | public event GenericCall1 OnRequestWearables; |
122 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; | 124 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; |
@@ -153,6 +155,7 @@ namespace OpenSim.Tests.Common | |||
153 | public event GenericCall7 OnObjectMaterial; | 155 | public event GenericCall7 OnObjectMaterial; |
154 | public event UpdatePrimFlags OnUpdatePrimFlags; | 156 | public event UpdatePrimFlags OnUpdatePrimFlags; |
155 | public event UpdatePrimTexture OnUpdatePrimTexture; | 157 | public event UpdatePrimTexture OnUpdatePrimTexture; |
158 | public event ClientChangeObject onClientChangeObject; | ||
156 | public event UpdateVector OnUpdatePrimGroupPosition; | 159 | public event UpdateVector OnUpdatePrimGroupPosition; |
157 | public event UpdateVector OnUpdatePrimSinglePosition; | 160 | public event UpdateVector OnUpdatePrimSinglePosition; |
158 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | 161 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; |
@@ -295,7 +298,7 @@ namespace OpenSim.Tests.Common | |||
295 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; | 298 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; |
296 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 299 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
297 | public event ClassifiedDelete OnClassifiedDelete; | 300 | public event ClassifiedDelete OnClassifiedDelete; |
298 | public event ClassifiedDelete OnClassifiedGodDelete; | 301 | public event ClassifiedGodDelete OnClassifiedGodDelete; |
299 | 302 | ||
300 | public event EventNotificationAddRequest OnEventNotificationAddRequest; | 303 | public event EventNotificationAddRequest OnEventNotificationAddRequest; |
301 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 304 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
@@ -318,7 +321,7 @@ namespace OpenSim.Tests.Common | |||
318 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 321 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
319 | 322 | ||
320 | public event PlacesQuery OnPlacesQuery; | 323 | public event PlacesQuery OnPlacesQuery; |
321 | 324 | ||
322 | public event FindAgentUpdate OnFindAgent; | 325 | public event FindAgentUpdate OnFindAgent; |
323 | public event TrackAgentUpdate OnTrackAgent; | 326 | public event TrackAgentUpdate OnTrackAgent; |
324 | public event NewUserReport OnUserReport; | 327 | public event NewUserReport OnUserReport; |
@@ -334,11 +337,12 @@ namespace OpenSim.Tests.Common | |||
334 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 337 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
335 | public event SimWideDeletesDelegate OnSimWideDeletes; | 338 | public event SimWideDeletesDelegate OnSimWideDeletes; |
336 | public event SendPostcard OnSendPostcard; | 339 | public event SendPostcard OnSendPostcard; |
340 | public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; | ||
337 | public event MuteListEntryUpdate OnUpdateMuteListEntry; | 341 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
338 | public event MuteListEntryRemove OnRemoveMuteListEntry; | 342 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
339 | public event GodlikeMessage onGodlikeMessage; | 343 | public event GodlikeMessage onGodlikeMessage; |
340 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; | 344 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
341 | 345 | public event GenericCall2 OnUpdateThrottles; | |
342 | #pragma warning restore 67 | 346 | #pragma warning restore 67 |
343 | 347 | ||
344 | /// <value> | 348 | /// <value> |
@@ -387,6 +391,8 @@ namespace OpenSim.Tests.Common | |||
387 | get { return FirstName + " " + LastName; } | 391 | get { return FirstName + " " + LastName; } |
388 | } | 392 | } |
389 | 393 | ||
394 | public int PingTimeMS { get { return 0; } } | ||
395 | |||
390 | public bool IsActive | 396 | public bool IsActive |
391 | { | 397 | { |
392 | get { return true; } | 398 | get { return true; } |
@@ -398,16 +404,19 @@ namespace OpenSim.Tests.Common | |||
398 | public UUID ActiveGroupId | 404 | public UUID ActiveGroupId |
399 | { | 405 | { |
400 | get { return UUID.Zero; } | 406 | get { return UUID.Zero; } |
407 | set { } | ||
401 | } | 408 | } |
402 | 409 | ||
403 | public string ActiveGroupName | 410 | public string ActiveGroupName |
404 | { | 411 | { |
405 | get { return String.Empty; } | 412 | get { return String.Empty; } |
413 | set { } | ||
406 | } | 414 | } |
407 | 415 | ||
408 | public ulong ActiveGroupPowers | 416 | public ulong ActiveGroupPowers |
409 | { | 417 | { |
410 | get { return 0; } | 418 | get { return 0; } |
419 | set { } | ||
411 | } | 420 | } |
412 | 421 | ||
413 | public bool IsGroupMember(UUID groupID) | 422 | public bool IsGroupMember(UUID groupID) |
@@ -415,6 +424,13 @@ namespace OpenSim.Tests.Common | |||
415 | return false; | 424 | return false; |
416 | } | 425 | } |
417 | 426 | ||
427 | public Dictionary<UUID, ulong> GetGroupPowers() | ||
428 | { | ||
429 | return new Dictionary<UUID, ulong>(); | ||
430 | } | ||
431 | |||
432 | public void SetGroupPowers(Dictionary<UUID, ulong> powers) { } | ||
433 | |||
418 | public ulong GetGroupPowers(UUID groupID) | 434 | public ulong GetGroupPowers(UUID groupID) |
419 | { | 435 | { |
420 | return 0; | 436 | return 0; |
@@ -448,6 +464,8 @@ namespace OpenSim.Tests.Common | |||
448 | get { return new IPEndPoint(IPAddress.Loopback, (ushort)m_circuitCode); } | 464 | get { return new IPEndPoint(IPAddress.Loopback, (ushort)m_circuitCode); } |
449 | } | 465 | } |
450 | 466 | ||
467 | public List<uint> SelectedObjects {get; private set;} | ||
468 | |||
451 | /// <summary> | 469 | /// <summary> |
452 | /// Constructor | 470 | /// Constructor |
453 | /// </summary> | 471 | /// </summary> |
@@ -570,10 +588,27 @@ namespace OpenSim.Tests.Common | |||
570 | ReceivedKills.AddRange(localID); | 588 | ReceivedKills.AddRange(localID); |
571 | } | 589 | } |
572 | 590 | ||
591 | public void SendPartFullUpdate(ISceneEntity ent, uint? parentID) | ||
592 | { | ||
593 | } | ||
594 | |||
573 | public virtual void SetChildAgentThrottle(byte[] throttle) | 595 | public virtual void SetChildAgentThrottle(byte[] throttle) |
574 | { | 596 | { |
575 | } | 597 | } |
576 | 598 | ||
599 | public virtual void SetChildAgentThrottle(byte[] throttle, float factor) | ||
600 | { | ||
601 | } | ||
602 | |||
603 | public void SetAgentThrottleSilent(int throttle, int setting) | ||
604 | { | ||
605 | } | ||
606 | |||
607 | public int GetAgentThrottleSilent(int throttle) | ||
608 | { | ||
609 | return 0; | ||
610 | } | ||
611 | |||
577 | public byte[] GetThrottlesPacked(float multiplier) | 612 | public byte[] GetThrottlesPacked(float multiplier) |
578 | { | 613 | { |
579 | return new byte[0]; | 614 | return new byte[0]; |
@@ -608,6 +643,11 @@ namespace OpenSim.Tests.Common | |||
608 | 643 | ||
609 | } | 644 | } |
610 | 645 | ||
646 | public virtual bool CanSendLayerData() | ||
647 | { | ||
648 | return false; | ||
649 | } | ||
650 | |||
611 | public virtual void SendLayerData(float[] map) | 651 | public virtual void SendLayerData(float[] map) |
612 | { | 652 | { |
613 | } | 653 | } |
@@ -619,9 +659,9 @@ namespace OpenSim.Tests.Common | |||
619 | { | 659 | { |
620 | } | 660 | } |
621 | 661 | ||
622 | public virtual void SendWindData(Vector2[] windSpeeds) { } | 662 | public virtual void SendWindData(int version, Vector2[] windSpeeds) { } |
623 | 663 | ||
624 | public virtual void SendCloudData(float[] cloudCover) { } | 664 | public virtual void SendCloudData(int version, float[] cloudCover) { } |
625 | 665 | ||
626 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) | 666 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) |
627 | { | 667 | { |
@@ -633,7 +673,7 @@ namespace OpenSim.Tests.Common | |||
633 | { | 673 | { |
634 | AgentCircuitData agentData = new AgentCircuitData(); | 674 | AgentCircuitData agentData = new AgentCircuitData(); |
635 | agentData.AgentID = AgentId; | 675 | agentData.AgentID = AgentId; |
636 | agentData.SessionID = SessionId; | 676 | agentData.SessionID = SessionId; |
637 | agentData.SecureSessionID = UUID.Zero; | 677 | agentData.SecureSessionID = UUID.Zero; |
638 | agentData.circuitcode = m_circuitCode; | 678 | agentData.circuitcode = m_circuitCode; |
639 | agentData.child = false; | 679 | agentData.child = false; |
@@ -673,7 +713,7 @@ namespace OpenSim.Tests.Common | |||
673 | public virtual void SendTeleportFailed(string reason) | 713 | public virtual void SendTeleportFailed(string reason) |
674 | { | 714 | { |
675 | m_log.DebugFormat( | 715 | m_log.DebugFormat( |
676 | "[TEST CLIENT]: Teleport failed for {0} {1} on {2} with reason {3}", | 716 | "[TEST CLIENT]: Teleport failed for {0} {1} on {2} with reason {3}", |
677 | m_firstName, m_lastName, m_scene.Name, reason); | 717 | m_firstName, m_lastName, m_scene.Name, reason); |
678 | } | 718 | } |
679 | 719 | ||
@@ -720,7 +760,11 @@ namespace OpenSim.Tests.Common | |||
720 | { | 760 | { |
721 | } | 761 | } |
722 | 762 | ||
723 | public void SendAvatarDataImmediate(ISceneEntity avatar) | 763 | public void SendEntityFullUpdateImmediate(ISceneEntity ent) |
764 | { | ||
765 | } | ||
766 | |||
767 | public void SendEntityTerseUpdateImmediate(ISceneEntity ent) | ||
724 | { | 768 | { |
725 | } | 769 | } |
726 | 770 | ||
@@ -741,7 +785,7 @@ namespace OpenSim.Tests.Common | |||
741 | public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID, | 785 | public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID, |
742 | List<InventoryItemBase> items, | 786 | List<InventoryItemBase> items, |
743 | List<InventoryFolderBase> folders, | 787 | List<InventoryFolderBase> folders, |
744 | int version, | 788 | int version, |
745 | bool fetchFolders, | 789 | bool fetchFolders, |
746 | bool fetchItems) | 790 | bool fetchItems) |
747 | { | 791 | { |
@@ -755,6 +799,10 @@ namespace OpenSim.Tests.Common | |||
755 | { | 799 | { |
756 | } | 800 | } |
757 | 801 | ||
802 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) | ||
803 | { | ||
804 | } | ||
805 | |||
758 | public virtual void SendRemoveInventoryItem(UUID itemID) | 806 | public virtual void SendRemoveInventoryItem(UUID itemID) |
759 | { | 807 | { |
760 | } | 808 | } |
@@ -771,7 +819,7 @@ namespace OpenSim.Tests.Common | |||
771 | { | 819 | { |
772 | } | 820 | } |
773 | 821 | ||
774 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) | 822 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) |
775 | { | 823 | { |
776 | } | 824 | } |
777 | 825 | ||
@@ -817,6 +865,10 @@ namespace OpenSim.Tests.Common | |||
817 | { | 865 | { |
818 | } | 866 | } |
819 | 867 | ||
868 | public void SendAlertMessage(string message, string info) | ||
869 | { | ||
870 | } | ||
871 | |||
820 | public void SendSystemAlertMessage(string message) | 872 | public void SendSystemAlertMessage(string message) |
821 | { | 873 | { |
822 | } | 874 | } |
@@ -833,7 +885,7 @@ namespace OpenSim.Tests.Common | |||
833 | OnRegionHandShakeReply(this); | 885 | OnRegionHandShakeReply(this); |
834 | } | 886 | } |
835 | } | 887 | } |
836 | 888 | ||
837 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) | 889 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) |
838 | { | 890 | { |
839 | } | 891 | } |
@@ -910,8 +962,13 @@ namespace OpenSim.Tests.Common | |||
910 | ReceivedOnlineNotifications.AddRange(agentIDs); | 962 | ReceivedOnlineNotifications.AddRange(agentIDs); |
911 | } | 963 | } |
912 | 964 | ||
913 | public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, | 965 | public void SendFindAgent(UUID HunterID, UUID PreyID, double GlobalX, double GlobalY) |
914 | Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) | 966 | { |
967 | } | ||
968 | |||
969 | public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, | ||
970 | Quaternion SitOrientation, bool autopilot, | ||
971 | Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) | ||
915 | { | 972 | { |
916 | } | 973 | } |
917 | 974 | ||
@@ -937,7 +994,7 @@ namespace OpenSim.Tests.Common | |||
937 | { | 994 | { |
938 | } | 995 | } |
939 | 996 | ||
940 | public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, | 997 | public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, |
941 | string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, | 998 | string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, |
942 | UUID partnerID) | 999 | UUID partnerID) |
943 | { | 1000 | { |
@@ -966,10 +1023,10 @@ namespace OpenSim.Tests.Common | |||
966 | 1023 | ||
967 | public void Close() | 1024 | public void Close() |
968 | { | 1025 | { |
969 | Close(false); | 1026 | Close(true, false); |
970 | } | 1027 | } |
971 | 1028 | ||
972 | public void Close(bool force) | 1029 | public void Close(bool sendStop, bool force) |
973 | { | 1030 | { |
974 | // Fire the callback for this connection closing | 1031 | // Fire the callback for this connection closing |
975 | // This is necesary to get the presence detector to notice that a client has logged out. | 1032 | // This is necesary to get the presence detector to notice that a client has logged out. |
@@ -1175,6 +1232,10 @@ namespace OpenSim.Tests.Common | |||
1175 | { | 1232 | { |
1176 | } | 1233 | } |
1177 | 1234 | ||
1235 | public void SendAgentGroupDataUpdate(UUID avatarID, GroupMembershipData[] data) | ||
1236 | { | ||
1237 | } | ||
1238 | |||
1178 | public void SendJoinGroupReply(UUID groupID, bool success) | 1239 | public void SendJoinGroupReply(UUID groupID, bool success) |
1179 | { | 1240 | { |
1180 | } | 1241 | } |
@@ -1238,14 +1299,30 @@ namespace OpenSim.Tests.Common | |||
1238 | { | 1299 | { |
1239 | } | 1300 | } |
1240 | 1301 | ||
1302 | public void UpdateGroupMembership(GroupMembershipData[] data) | ||
1303 | { | ||
1304 | } | ||
1305 | |||
1306 | public void GroupMembershipRemove(UUID GroupID) | ||
1307 | { | ||
1308 | } | ||
1309 | |||
1310 | public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) | ||
1311 | { | ||
1312 | } | ||
1313 | |||
1241 | public void SendUseCachedMuteList() | 1314 | public void SendUseCachedMuteList() |
1242 | { | 1315 | { |
1243 | } | 1316 | } |
1244 | 1317 | ||
1318 | public void SendEmpytMuteList() | ||
1319 | { | ||
1320 | } | ||
1321 | |||
1245 | public void SendMuteListUpdate(string filename) | 1322 | public void SendMuteListUpdate(string filename) |
1246 | { | 1323 | { |
1247 | } | 1324 | } |
1248 | 1325 | ||
1249 | public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled) | 1326 | public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled) |
1250 | { | 1327 | { |
1251 | } | 1328 | } |
@@ -1265,7 +1342,7 @@ namespace OpenSim.Tests.Common | |||
1265 | { | 1342 | { |
1266 | } | 1343 | } |
1267 | 1344 | ||
1268 | public void Disconnect() | 1345 | public void Disconnect() |
1269 | { | 1346 | { |
1270 | } | 1347 | } |
1271 | 1348 | ||
@@ -1274,19 +1351,19 @@ namespace OpenSim.Tests.Common | |||
1274 | if (OnReceivedSendRebakeAvatarTextures != null) | 1351 | if (OnReceivedSendRebakeAvatarTextures != null) |
1275 | OnReceivedSendRebakeAvatarTextures(textureID); | 1352 | OnReceivedSendRebakeAvatarTextures(textureID); |
1276 | } | 1353 | } |
1277 | 1354 | ||
1278 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) | 1355 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) |
1279 | { | 1356 | { |
1280 | } | 1357 | } |
1281 | 1358 | ||
1282 | public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) | 1359 | public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) |
1283 | { | 1360 | { |
1284 | } | 1361 | } |
1285 | 1362 | ||
1286 | public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) | 1363 | public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) |
1287 | { | 1364 | { |
1288 | } | 1365 | } |
1289 | 1366 | ||
1290 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1367 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1291 | { | 1368 | { |
1292 | } | 1369 | } |
@@ -1315,9 +1392,12 @@ namespace OpenSim.Tests.Common | |||
1315 | { | 1392 | { |
1316 | } | 1393 | } |
1317 | 1394 | ||
1318 | public void SendPartPhysicsProprieties(ISceneEntity entity) | 1395 | public void SendSelectedPartsProprieties(List<ISceneEntity> parts) |
1319 | { | 1396 | { |
1320 | } | 1397 | } |
1321 | 1398 | ||
1399 | public void SendPartPhysicsProprieties(ISceneEntity entity) | ||
1400 | { | ||
1401 | } | ||
1322 | } | 1402 | } |
1323 | } | 1403 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index f2bae58..f2ce064 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Tests.Common | |||
46 | { | 46 | { |
47 | public class TestEventQueueGetModule : IEventQueue, INonSharedRegionModule | 47 | public class TestEventQueueGetModule : IEventQueue, INonSharedRegionModule |
48 | { | 48 | { |
49 | public class Event | 49 | public class Event |
50 | { | 50 | { |
51 | public string Name { get; set; } | 51 | public string Name { get; set; } |
52 | public object[] Args { get; set; } | 52 | public object[] Args { get; set; } |
@@ -64,7 +64,7 @@ namespace OpenSim.Tests.Common | |||
64 | 64 | ||
65 | public void Close() {} | 65 | public void Close() {} |
66 | 66 | ||
67 | public void AddRegion(Scene scene) | 67 | public void AddRegion(Scene scene) |
68 | { | 68 | { |
69 | Events = new Dictionary<UUID, List<Event>>(); | 69 | Events = new Dictionary<UUID, List<Event>>(); |
70 | scene.RegisterModuleInterface<IEventQueue>(this); | 70 | scene.RegisterModuleInterface<IEventQueue>(this); |
@@ -108,12 +108,12 @@ namespace OpenSim.Tests.Common | |||
108 | AddEvent(avatarID, "Enqueue", o); | 108 | AddEvent(avatarID, "Enqueue", o); |
109 | return true; | 109 | return true; |
110 | } | 110 | } |
111 | 111 | /* | |
112 | public void DisableSimulator(ulong handle, UUID avatarID) | 112 | public void DisableSimulator(ulong handle, UUID avatarID) |
113 | { | 113 | { |
114 | AddEvent(avatarID, "DisableSimulator", handle); | 114 | AddEvent(avatarID, "DisableSimulator", handle); |
115 | } | 115 | } |
116 | 116 | */ | |
117 | public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) | 117 | public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) |
118 | { | 118 | { |
119 | AddEvent(avatarID, "EnableSimulator", handle); | 119 | AddEvent(avatarID, "EnableSimulator", handle); |
@@ -138,18 +138,23 @@ namespace OpenSim.Tests.Common | |||
138 | } | 138 | } |
139 | 139 | ||
140 | public void ChatterboxInvitation( | 140 | public void ChatterboxInvitation( |
141 | UUID sessionID, string sessionName, UUID fromAgent, string message, UUID toAgent, string fromName, | 141 | UUID sessionID, string sessionName, UUID fromAgent, string message, UUID toAgent, string fromName, |
142 | byte dialog, uint timeStamp, bool offline, int parentEstateID, Vector3 position, uint ttl, | 142 | byte dialog, uint timeStamp, bool offline, int parentEstateID, Vector3 position, uint ttl, |
143 | UUID transactionID, bool fromGroup, byte[] binaryBucket) | 143 | UUID transactionID, bool fromGroup, byte[] binaryBucket) |
144 | { | 144 | { |
145 | AddEvent( | 145 | AddEvent( |
146 | toAgent, "ChatterboxInvitation", sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog, | 146 | toAgent, "ChatterboxInvitation", sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog, |
147 | timeStamp, offline, parentEstateID, position, ttl, transactionID, fromGroup, binaryBucket); | 147 | timeStamp, offline, parentEstateID, position, ttl, transactionID, fromGroup, binaryBucket); |
148 | } | 148 | } |
149 | 149 | ||
150 | public void ChatterBoxSessionAgentListUpdates (UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, bool isModerator, bool textMute) | 150 | public void ChatterBoxSessionAgentListUpdates (UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, bool isModerator, bool textMute , bool isEnterorLeave) |
151 | { | ||
152 | AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute, isEnterorLeave); | ||
153 | } | ||
154 | |||
155 | public void ChatterBoxForceClose (UUID toAgent, UUID sessionID, string reason) | ||
151 | { | 156 | { |
152 | AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute); | 157 | AddEvent(toAgent, "ForceCloseChatterBoxSession", sessionID, reason); |
153 | } | 158 | } |
154 | 159 | ||
155 | public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) | 160 | public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) |
@@ -157,9 +162,9 @@ namespace OpenSim.Tests.Common | |||
157 | AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); | 162 | AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); |
158 | } | 163 | } |
159 | 164 | ||
160 | public void GroupMembership (OpenMetaverse.Packets.AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) | 165 | public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) |
161 | { | 166 | { |
162 | AddEvent(avatarID, "GroupMembership", groupUpdate); | 167 | AddEvent(receiverAgent, "AgentGroupDataUpdate", data); |
163 | } | 168 | } |
164 | 169 | ||
165 | public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono) | 170 | public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono) |
diff --git a/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs new file mode 100644 index 0000000..8e2d8e6 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs | |||
@@ -0,0 +1,339 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Linq; | ||
4 | using System.Text; | ||
5 | |||
6 | using OpenMetaverse; | ||
7 | using OpenSim.Data; | ||
8 | |||
9 | namespace OpenSim.Tests.Common.Mock | ||
10 | { | ||
11 | public class TestGroupsDataPlugin : IGroupsData | ||
12 | { | ||
13 | class CompositeKey | ||
14 | { | ||
15 | private readonly string _key; | ||
16 | public string Key | ||
17 | { | ||
18 | get { return _key; } | ||
19 | } | ||
20 | |||
21 | public CompositeKey(UUID _k1, string _k2) | ||
22 | { | ||
23 | _key = _k1.ToString() + _k2; | ||
24 | } | ||
25 | |||
26 | public CompositeKey(UUID _k1, string _k2, string _k3) | ||
27 | { | ||
28 | _key = _k1.ToString() + _k2 + _k3; | ||
29 | } | ||
30 | |||
31 | public override bool Equals(object obj) | ||
32 | { | ||
33 | if (obj is CompositeKey) | ||
34 | { | ||
35 | return Key == ((CompositeKey)obj).Key; | ||
36 | } | ||
37 | return false; | ||
38 | } | ||
39 | |||
40 | public override int GetHashCode() | ||
41 | { | ||
42 | return base.GetHashCode(); | ||
43 | } | ||
44 | |||
45 | public override string ToString() | ||
46 | { | ||
47 | return Key; | ||
48 | } | ||
49 | } | ||
50 | |||
51 | private Dictionary<UUID, GroupData> m_Groups; | ||
52 | private Dictionary<CompositeKey, MembershipData> m_Membership; | ||
53 | private Dictionary<CompositeKey, RoleData> m_Roles; | ||
54 | private Dictionary<CompositeKey, RoleMembershipData> m_RoleMembership; | ||
55 | private Dictionary<UUID, InvitationData> m_Invites; | ||
56 | private Dictionary<UUID, NoticeData> m_Notices; | ||
57 | private Dictionary<string, PrincipalData> m_Principals; | ||
58 | |||
59 | public TestGroupsDataPlugin(string connectionString, string realm) | ||
60 | { | ||
61 | m_Groups = new Dictionary<UUID, GroupData>(); | ||
62 | m_Membership = new Dictionary<CompositeKey, MembershipData>(); | ||
63 | m_Roles = new Dictionary<CompositeKey, RoleData>(); | ||
64 | m_RoleMembership = new Dictionary<CompositeKey, RoleMembershipData>(); | ||
65 | m_Invites = new Dictionary<UUID, InvitationData>(); | ||
66 | m_Notices = new Dictionary<UUID, NoticeData>(); | ||
67 | m_Principals = new Dictionary<string, PrincipalData>(); | ||
68 | } | ||
69 | |||
70 | #region groups table | ||
71 | public bool StoreGroup(GroupData data) | ||
72 | { | ||
73 | return false; | ||
74 | } | ||
75 | |||
76 | public GroupData RetrieveGroup(UUID groupID) | ||
77 | { | ||
78 | if (m_Groups.ContainsKey(groupID)) | ||
79 | return m_Groups[groupID]; | ||
80 | |||
81 | return null; | ||
82 | } | ||
83 | |||
84 | public GroupData RetrieveGroup(string name) | ||
85 | { | ||
86 | return m_Groups.Values.First(g => g.Data.ContainsKey("Name") && g.Data["Name"] == name); | ||
87 | } | ||
88 | |||
89 | public GroupData[] RetrieveGroups(string pattern) | ||
90 | { | ||
91 | if (string.IsNullOrEmpty(pattern)) | ||
92 | pattern = "1"; | ||
93 | |||
94 | IEnumerable<GroupData> groups = m_Groups.Values.Where(g => g.Data.ContainsKey("Name") && (g.Data["Name"].StartsWith(pattern) || g.Data["Name"].EndsWith(pattern))); | ||
95 | |||
96 | return (groups != null) ? groups.ToArray() : new GroupData[0]; | ||
97 | } | ||
98 | |||
99 | public bool DeleteGroup(UUID groupID) | ||
100 | { | ||
101 | return m_Groups.Remove(groupID); | ||
102 | } | ||
103 | |||
104 | public int GroupsCount() | ||
105 | { | ||
106 | return m_Groups.Count; | ||
107 | } | ||
108 | #endregion | ||
109 | |||
110 | #region membership table | ||
111 | public MembershipData RetrieveMember(UUID groupID, string pricipalID) | ||
112 | { | ||
113 | CompositeKey dkey = new CompositeKey(groupID, pricipalID); | ||
114 | if (m_Membership.ContainsKey(dkey)) | ||
115 | return m_Membership[dkey]; | ||
116 | |||
117 | return null; | ||
118 | } | ||
119 | |||
120 | public MembershipData[] RetrieveMembers(UUID groupID) | ||
121 | { | ||
122 | IEnumerable<CompositeKey> keys = m_Membership.Keys.Where(k => k.Key.StartsWith(groupID.ToString())); | ||
123 | return keys.Where(m_Membership.ContainsKey).Select(x => m_Membership[x]).ToArray(); | ||
124 | } | ||
125 | |||
126 | public MembershipData[] RetrieveMemberships(string principalID) | ||
127 | { | ||
128 | IEnumerable<CompositeKey> keys = m_Membership.Keys.Where(k => k.Key.EndsWith(principalID.ToString())); | ||
129 | return keys.Where(m_Membership.ContainsKey).Select(x => m_Membership[x]).ToArray(); | ||
130 | } | ||
131 | |||
132 | public MembershipData[] RetrievePrincipalGroupMemberships(string principalID) | ||
133 | { | ||
134 | return RetrieveMemberships(principalID); | ||
135 | } | ||
136 | |||
137 | public MembershipData RetrievePrincipalGroupMembership(string principalID, UUID groupID) | ||
138 | { | ||
139 | CompositeKey dkey = new CompositeKey(groupID, principalID); | ||
140 | if (m_Membership.ContainsKey(dkey)) | ||
141 | return m_Membership[dkey]; | ||
142 | return null; | ||
143 | } | ||
144 | |||
145 | public bool StoreMember(MembershipData data) | ||
146 | { | ||
147 | CompositeKey dkey = new CompositeKey(data.GroupID, data.PrincipalID); | ||
148 | m_Membership[dkey] = data; | ||
149 | return true; | ||
150 | } | ||
151 | |||
152 | public bool DeleteMember(UUID groupID, string principalID) | ||
153 | { | ||
154 | CompositeKey dkey = new CompositeKey(groupID, principalID); | ||
155 | if (m_Membership.ContainsKey(dkey)) | ||
156 | return m_Membership.Remove(dkey); | ||
157 | |||
158 | return false; | ||
159 | } | ||
160 | |||
161 | public int MemberCount(UUID groupID) | ||
162 | { | ||
163 | return m_Membership.Count; | ||
164 | } | ||
165 | #endregion | ||
166 | |||
167 | #region roles table | ||
168 | public bool StoreRole(RoleData data) | ||
169 | { | ||
170 | CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString()); | ||
171 | m_Roles[dkey] = data; | ||
172 | return true; | ||
173 | } | ||
174 | |||
175 | public RoleData RetrieveRole(UUID groupID, UUID roleID) | ||
176 | { | ||
177 | CompositeKey dkey = new CompositeKey(groupID, roleID.ToString()); | ||
178 | if (m_Roles.ContainsKey(dkey)) | ||
179 | return m_Roles[dkey]; | ||
180 | |||
181 | return null; | ||
182 | } | ||
183 | |||
184 | public RoleData[] RetrieveRoles(UUID groupID) | ||
185 | { | ||
186 | IEnumerable<CompositeKey> keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString())); | ||
187 | return keys.Where(m_Roles.ContainsKey).Select(x => m_Roles[x]).ToArray(); | ||
188 | } | ||
189 | |||
190 | public bool DeleteRole(UUID groupID, UUID roleID) | ||
191 | { | ||
192 | CompositeKey dkey = new CompositeKey(groupID, roleID.ToString()); | ||
193 | if (m_Roles.ContainsKey(dkey)) | ||
194 | return m_Roles.Remove(dkey); | ||
195 | |||
196 | return false; | ||
197 | } | ||
198 | |||
199 | public int RoleCount(UUID groupID) | ||
200 | { | ||
201 | return m_Roles.Count; | ||
202 | } | ||
203 | #endregion | ||
204 | |||
205 | #region rolememberhip table | ||
206 | public RoleMembershipData[] RetrieveRolesMembers(UUID groupID) | ||
207 | { | ||
208 | IEnumerable<CompositeKey> keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString())); | ||
209 | return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray(); | ||
210 | } | ||
211 | |||
212 | public RoleMembershipData[] RetrieveRoleMembers(UUID groupID, UUID roleID) | ||
213 | { | ||
214 | IEnumerable<CompositeKey> keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString() + roleID.ToString())); | ||
215 | return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray(); | ||
216 | } | ||
217 | |||
218 | public RoleMembershipData[] RetrieveMemberRoles(UUID groupID, string principalID) | ||
219 | { | ||
220 | IEnumerable<CompositeKey> keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString()) && k.Key.EndsWith(principalID)); | ||
221 | return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray(); | ||
222 | } | ||
223 | |||
224 | public RoleMembershipData RetrieveRoleMember(UUID groupID, UUID roleID, string principalID) | ||
225 | { | ||
226 | CompositeKey dkey = new CompositeKey(groupID, roleID.ToString(), principalID); | ||
227 | if (m_RoleMembership.ContainsKey(dkey)) | ||
228 | return m_RoleMembership[dkey]; | ||
229 | |||
230 | return null; | ||
231 | } | ||
232 | |||
233 | public int RoleMemberCount(UUID groupID, UUID roleID) | ||
234 | { | ||
235 | return m_RoleMembership.Count; | ||
236 | } | ||
237 | |||
238 | public bool StoreRoleMember(RoleMembershipData data) | ||
239 | { | ||
240 | CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString(), data.PrincipalID); | ||
241 | m_RoleMembership[dkey] = data; | ||
242 | return true; | ||
243 | } | ||
244 | |||
245 | public bool DeleteRoleMember(RoleMembershipData data) | ||
246 | { | ||
247 | CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString(), data.PrincipalID); | ||
248 | if (m_RoleMembership.ContainsKey(dkey)) | ||
249 | return m_RoleMembership.Remove(dkey); | ||
250 | |||
251 | return false; | ||
252 | } | ||
253 | |||
254 | public bool DeleteMemberAllRoles(UUID groupID, string principalID) | ||
255 | { | ||
256 | List<CompositeKey> keys = m_RoleMembership.Keys.Where(k => k.Key.StartsWith(groupID.ToString()) && k.Key.EndsWith(principalID)).ToList(); | ||
257 | foreach (CompositeKey k in keys) | ||
258 | m_RoleMembership.Remove(k); | ||
259 | return true; | ||
260 | } | ||
261 | #endregion | ||
262 | |||
263 | #region principals table | ||
264 | public bool StorePrincipal(PrincipalData data) | ||
265 | { | ||
266 | m_Principals[data.PrincipalID] = data; | ||
267 | return true; | ||
268 | } | ||
269 | |||
270 | public PrincipalData RetrievePrincipal(string principalID) | ||
271 | { | ||
272 | if (m_Principals.ContainsKey(principalID)) | ||
273 | return m_Principals[principalID]; | ||
274 | |||
275 | return null; | ||
276 | } | ||
277 | |||
278 | public bool DeletePrincipal(string principalID) | ||
279 | { | ||
280 | if (m_Principals.ContainsKey(principalID)) | ||
281 | return m_Principals.Remove(principalID); | ||
282 | return false; | ||
283 | } | ||
284 | #endregion | ||
285 | |||
286 | #region invites table | ||
287 | public bool StoreInvitation(InvitationData data) | ||
288 | { | ||
289 | return false; | ||
290 | } | ||
291 | |||
292 | public InvitationData RetrieveInvitation(UUID inviteID) | ||
293 | { | ||
294 | return null; | ||
295 | } | ||
296 | |||
297 | public InvitationData RetrieveInvitation(UUID groupID, string principalID) | ||
298 | { | ||
299 | return null; | ||
300 | } | ||
301 | |||
302 | public bool DeleteInvite(UUID inviteID) | ||
303 | { | ||
304 | return false; | ||
305 | } | ||
306 | |||
307 | public void DeleteOldInvites() | ||
308 | { | ||
309 | } | ||
310 | #endregion | ||
311 | |||
312 | #region notices table | ||
313 | public bool StoreNotice(NoticeData data) | ||
314 | { | ||
315 | return false; | ||
316 | } | ||
317 | |||
318 | public NoticeData RetrieveNotice(UUID noticeID) | ||
319 | { | ||
320 | return null; | ||
321 | } | ||
322 | |||
323 | public NoticeData[] RetrieveNotices(UUID groupID) | ||
324 | { | ||
325 | return new NoticeData[0]; | ||
326 | } | ||
327 | |||
328 | public bool DeleteNotice(UUID noticeID) | ||
329 | { | ||
330 | return false; | ||
331 | } | ||
332 | |||
333 | public void DeleteOldNotices() | ||
334 | { | ||
335 | } | ||
336 | #endregion | ||
337 | |||
338 | } | ||
339 | } | ||
diff --git a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs index 5a55b09..7b20b8c 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs | |||
@@ -36,13 +36,14 @@ using OpenSim.Framework; | |||
36 | 36 | ||
37 | namespace OpenSim.Tests.Common | 37 | namespace OpenSim.Tests.Common |
38 | { | 38 | { |
39 | /* | ||
39 | public class TestHttpClientContext: IHttpClientContext | 40 | public class TestHttpClientContext: IHttpClientContext |
40 | { | 41 | { |
41 | /// <summary> | 42 | /// <summary> |
42 | /// Bodies of responses from the server. | 43 | /// Bodies of responses from the server. |
43 | /// </summary> | 44 | /// </summary> |
44 | public string ResponseBody | 45 | public string ResponseBody |
45 | { | 46 | { |
46 | get { return Encoding.UTF8.GetString(m_responseStream.ToArray()); } | 47 | get { return Encoding.UTF8.GetString(m_responseStream.ToArray()); } |
47 | } | 48 | } |
48 | 49 | ||
@@ -55,8 +56,8 @@ namespace OpenSim.Tests.Common | |||
55 | 56 | ||
56 | public bool IsSecured { get; set; } | 57 | public bool IsSecured { get; set; } |
57 | 58 | ||
58 | public bool Secured | 59 | public bool Secured |
59 | { | 60 | { |
60 | get { return IsSecured; } | 61 | get { return IsSecured; } |
61 | set { IsSecured = value; } | 62 | set { IsSecured = value; } |
62 | } | 63 | } |
@@ -66,7 +67,7 @@ namespace OpenSim.Tests.Common | |||
66 | Secured = secured; | 67 | Secured = secured; |
67 | } | 68 | } |
68 | 69 | ||
69 | public void Disconnect(SocketError error) | 70 | public void Disconnect(SocketError error) |
70 | { | 71 | { |
71 | // Console.WriteLine("TestHttpClientContext.Disconnect Received disconnect with status {0}", error); | 72 | // Console.WriteLine("TestHttpClientContext.Disconnect Received disconnect with status {0}", error); |
72 | } | 73 | } |
@@ -75,18 +76,18 @@ namespace OpenSim.Tests.Common | |||
75 | public void Respond(string httpVersion, HttpStatusCode statusCode, string reason) {Console.WriteLine("xx");} | 76 | public void Respond(string httpVersion, HttpStatusCode statusCode, string reason) {Console.WriteLine("xx");} |
76 | public void Respond(string body) { Console.WriteLine("xxx");} | 77 | public void Respond(string body) { Console.WriteLine("xxx");} |
77 | 78 | ||
78 | public void Send(byte[] buffer) | 79 | public void Send(byte[] buffer) |
79 | { | 80 | { |
80 | // Getting header data here | 81 | // Getting header data here |
81 | // Console.WriteLine("xxxx: Got {0}", Encoding.UTF8.GetString(buffer)); | 82 | // Console.WriteLine("xxxx: Got {0}", Encoding.UTF8.GetString(buffer)); |
82 | } | 83 | } |
83 | 84 | ||
84 | public void Send(byte[] buffer, int offset, int size) | 85 | public void Send(byte[] buffer, int offset, int size) |
85 | { | 86 | { |
86 | // Util.PrintCallStack(); | 87 | // Util.PrintCallStack(); |
87 | // | 88 | // |
88 | // Console.WriteLine( | 89 | // Console.WriteLine( |
89 | // "TestHttpClientContext.Send(byte[], int, int) got offset={0}, size={1}, buffer={2}", | 90 | // "TestHttpClientContext.Send(byte[], int, int) got offset={0}, size={1}, buffer={2}", |
90 | // offset, size, Encoding.UTF8.GetString(buffer)); | 91 | // offset, size, Encoding.UTF8.GetString(buffer)); |
91 | 92 | ||
92 | m_responseStream.Write(buffer, offset, size); | 93 | m_responseStream.Write(buffer, offset, size); |
@@ -107,4 +108,5 @@ namespace OpenSim.Tests.Common | |||
107 | /// </summary> | 108 | /// </summary> |
108 | public event EventHandler<RequestEventArgs> RequestReceived = delegate { }; | 109 | public event EventHandler<RequestEventArgs> RequestReceived = delegate { }; |
109 | } | 110 | } |
111 | */ | ||
110 | } \ No newline at end of file | 112 | } \ No newline at end of file |
diff --git a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs index b868895..4c5ea4a 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs | |||
@@ -33,88 +33,89 @@ using HttpServer.FormDecoders; | |||
33 | 33 | ||
34 | namespace OpenSim.Tests.Common | 34 | namespace OpenSim.Tests.Common |
35 | { | 35 | { |
36 | /* | ||
36 | public class TestHttpRequest: IHttpRequest | 37 | public class TestHttpRequest: IHttpRequest |
37 | { | 38 | { |
38 | private string _uriPath; | 39 | private string _uriPath; |
39 | public bool BodyIsComplete | 40 | public bool BodyIsComplete |
40 | { | 41 | { |
41 | get { return true; } | 42 | get { return true; } |
42 | } | 43 | } |
43 | public string[] AcceptTypes | 44 | public string[] AcceptTypes |
44 | { | 45 | { |
45 | get {return _acceptTypes; } | 46 | get {return _acceptTypes; } |
46 | } | 47 | } |
47 | private string[] _acceptTypes; | 48 | private string[] _acceptTypes; |
48 | public Stream Body | 49 | public Stream Body |
49 | { | 50 | { |
50 | get { return _body; } | 51 | get { return _body; } |
51 | set { _body = value;} | 52 | set { _body = value;} |
52 | } | 53 | } |
53 | private Stream _body; | 54 | private Stream _body; |
54 | public ConnectionType Connection | 55 | public ConnectionType Connection |
55 | { | 56 | { |
56 | get { return _connection; } | 57 | get { return _connection; } |
57 | set { _connection = value; } | 58 | set { _connection = value; } |
58 | } | 59 | } |
59 | private ConnectionType _connection; | 60 | private ConnectionType _connection; |
60 | public int ContentLength | 61 | public int ContentLength |
61 | { | 62 | { |
62 | get { return _contentLength; } | 63 | get { return _contentLength; } |
63 | set { _contentLength = value; } | 64 | set { _contentLength = value; } |
64 | } | 65 | } |
65 | private int _contentLength; | 66 | private int _contentLength; |
66 | public NameValueCollection Headers | 67 | public NameValueCollection Headers |
67 | { | 68 | { |
68 | get { return _headers; } | 69 | get { return _headers; } |
69 | } | 70 | } |
70 | private NameValueCollection _headers = new NameValueCollection(); | 71 | private NameValueCollection _headers = new NameValueCollection(); |
71 | 72 | ||
72 | public string HttpVersion { get; set; } | 73 | public string HttpVersion { get; set; } |
73 | 74 | ||
74 | public string Method | 75 | public string Method |
75 | { | 76 | { |
76 | get { return _method; } | 77 | get { return _method; } |
77 | set { _method = value; } | 78 | set { _method = value; } |
78 | } | 79 | } |
79 | private string _method = null; | 80 | private string _method = null; |
80 | public HttpInput QueryString | 81 | public HttpInput QueryString |
81 | { | 82 | { |
82 | get { return _queryString; } | 83 | get { return _queryString; } |
83 | } | 84 | } |
84 | private HttpInput _queryString = null; | 85 | private HttpInput _queryString = null; |
85 | public Uri Uri | 86 | public Uri Uri |
86 | { | 87 | { |
87 | get { return _uri; } | 88 | get { return _uri; } |
88 | set { _uri = value; } | 89 | set { _uri = value; } |
89 | } | 90 | } |
90 | private Uri _uri = null; | 91 | private Uri _uri = null; |
91 | public string[] UriParts | 92 | public string[] UriParts |
92 | { | 93 | { |
93 | get { return _uri.Segments; } | 94 | get { return _uri.Segments; } |
94 | } | 95 | } |
95 | public HttpParam Param | 96 | public HttpParam Param |
96 | { | 97 | { |
97 | get { return null; } | 98 | get { return null; } |
98 | } | 99 | } |
99 | public HttpForm Form | 100 | public HttpForm Form |
100 | { | 101 | { |
101 | get { return null; } | 102 | get { return null; } |
102 | } | 103 | } |
103 | public bool IsAjax | 104 | public bool IsAjax |
104 | { | 105 | { |
105 | get { return false; } | 106 | get { return false; } |
106 | } | 107 | } |
107 | public RequestCookies Cookies | 108 | public RequestCookies Cookies |
108 | { | 109 | { |
109 | get { return null; } | 110 | get { return null; } |
110 | } | 111 | } |
111 | 112 | ||
112 | public TestHttpRequest() | 113 | public TestHttpRequest() |
113 | { | 114 | { |
114 | HttpVersion = "HTTP/1.1"; | 115 | HttpVersion = "HTTP/1.1"; |
115 | } | 116 | } |
116 | 117 | ||
117 | public TestHttpRequest(string contentEncoding, string contentType, string userAgent, | 118 | public TestHttpRequest(string contentEncoding, string contentType, string userAgent, |
118 | string remoteAddr, string remotePort, string[] acceptTypes, | 119 | string remoteAddr, string remotePort, string[] acceptTypes, |
119 | ConnectionType connectionType, int contentLength, Uri uri) : base() | 120 | ConnectionType connectionType, int contentLength, Uri uri) : base() |
120 | { | 121 | { |
@@ -136,7 +137,7 @@ namespace OpenSim.Tests.Common | |||
136 | { | 137 | { |
137 | _headers.Add(name, value); | 138 | _headers.Add(name, value); |
138 | } | 139 | } |
139 | public int AddToBody(byte[] bytes, int offset, int length) | 140 | public int AddToBody(byte[] bytes, int offset, int length) |
140 | { | 141 | { |
141 | return 0; | 142 | return 0; |
142 | } | 143 | } |
@@ -167,8 +168,9 @@ namespace OpenSim.Tests.Common | |||
167 | set | 168 | set |
168 | { | 169 | { |
169 | _uriPath = value; | 170 | _uriPath = value; |
170 | 171 | ||
171 | } | 172 | } |
172 | } | 173 | } |
173 | } | 174 | } |
175 | */ | ||
174 | } \ No newline at end of file | 176 | } \ No newline at end of file |
diff --git a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs index ff47c10..190f6d5 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs | |||
@@ -33,9 +33,10 @@ using HttpServer; | |||
33 | 33 | ||
34 | namespace OpenSim.Tests.Common | 34 | namespace OpenSim.Tests.Common |
35 | { | 35 | { |
36 | /* | ||
36 | public class TestHttpResponse: IHttpResponse | 37 | public class TestHttpResponse: IHttpResponse |
37 | { | 38 | { |
38 | public Stream Body | 39 | public Stream Body |
39 | { | 40 | { |
40 | get { return _body; } | 41 | get { return _body; } |
41 | 42 | ||
@@ -43,14 +44,14 @@ namespace OpenSim.Tests.Common | |||
43 | } | 44 | } |
44 | private Stream _body; | 45 | private Stream _body; |
45 | 46 | ||
46 | public string ProtocolVersion | 47 | public string ProtocolVersion |
47 | { | 48 | { |
48 | get { return _protocolVersion; } | 49 | get { return _protocolVersion; } |
49 | set { _protocolVersion = value; } | 50 | set { _protocolVersion = value; } |
50 | } | 51 | } |
51 | private string _protocolVersion; | 52 | private string _protocolVersion; |
52 | 53 | ||
53 | public bool Chunked | 54 | public bool Chunked |
54 | { | 55 | { |
55 | get { return _chunked; } | 56 | get { return _chunked; } |
56 | 57 | ||
@@ -58,7 +59,7 @@ namespace OpenSim.Tests.Common | |||
58 | } | 59 | } |
59 | private bool _chunked; | 60 | private bool _chunked; |
60 | 61 | ||
61 | public ConnectionType Connection | 62 | public ConnectionType Connection |
62 | { | 63 | { |
63 | get { return _connection; } | 64 | get { return _connection; } |
64 | 65 | ||
@@ -66,7 +67,7 @@ namespace OpenSim.Tests.Common | |||
66 | } | 67 | } |
67 | private ConnectionType _connection; | 68 | private ConnectionType _connection; |
68 | 69 | ||
69 | public Encoding Encoding | 70 | public Encoding Encoding |
70 | { | 71 | { |
71 | get { return _encoding; } | 72 | get { return _encoding; } |
72 | 73 | ||
@@ -74,7 +75,7 @@ namespace OpenSim.Tests.Common | |||
74 | } | 75 | } |
75 | private Encoding _encoding; | 76 | private Encoding _encoding; |
76 | 77 | ||
77 | public int KeepAlive | 78 | public int KeepAlive |
78 | { | 79 | { |
79 | get { return _keepAlive; } | 80 | get { return _keepAlive; } |
80 | 81 | ||
@@ -82,7 +83,7 @@ namespace OpenSim.Tests.Common | |||
82 | } | 83 | } |
83 | private int _keepAlive; | 84 | private int _keepAlive; |
84 | 85 | ||
85 | public HttpStatusCode Status | 86 | public HttpStatusCode Status |
86 | { | 87 | { |
87 | get { return _status; } | 88 | get { return _status; } |
88 | 89 | ||
@@ -90,7 +91,7 @@ namespace OpenSim.Tests.Common | |||
90 | } | 91 | } |
91 | private HttpStatusCode _status; | 92 | private HttpStatusCode _status; |
92 | 93 | ||
93 | public string Reason | 94 | public string Reason |
94 | { | 95 | { |
95 | get { return _reason; } | 96 | get { return _reason; } |
96 | 97 | ||
@@ -98,7 +99,7 @@ namespace OpenSim.Tests.Common | |||
98 | } | 99 | } |
99 | private string _reason; | 100 | private string _reason; |
100 | 101 | ||
101 | public long ContentLength | 102 | public long ContentLength |
102 | { | 103 | { |
103 | get { return _contentLength; } | 104 | get { return _contentLength; } |
104 | 105 | ||
@@ -106,7 +107,7 @@ namespace OpenSim.Tests.Common | |||
106 | } | 107 | } |
107 | private long _contentLength; | 108 | private long _contentLength; |
108 | 109 | ||
109 | public string ContentType | 110 | public string ContentType |
110 | { | 111 | { |
111 | get { return _contentType; } | 112 | get { return _contentType; } |
112 | 113 | ||
@@ -114,19 +115,19 @@ namespace OpenSim.Tests.Common | |||
114 | } | 115 | } |
115 | private string _contentType; | 116 | private string _contentType; |
116 | 117 | ||
117 | public bool HeadersSent | 118 | public bool HeadersSent |
118 | { | 119 | { |
119 | get { return _headersSent; } | 120 | get { return _headersSent; } |
120 | } | 121 | } |
121 | private bool _headersSent; | 122 | private bool _headersSent; |
122 | 123 | ||
123 | public bool Sent | 124 | public bool Sent |
124 | { | 125 | { |
125 | get { return _sent; } | 126 | get { return _sent; } |
126 | } | 127 | } |
127 | private bool _sent; | 128 | private bool _sent; |
128 | 129 | ||
129 | public ResponseCookies Cookies | 130 | public ResponseCookies Cookies |
130 | { | 131 | { |
131 | get { return _cookies; } | 132 | get { return _cookies; } |
132 | } | 133 | } |
@@ -140,26 +141,26 @@ namespace OpenSim.Tests.Common | |||
140 | 141 | ||
141 | public void AddHeader(string name, string value) {} | 142 | public void AddHeader(string name, string value) {} |
142 | 143 | ||
143 | public void Send() | 144 | public void Send() |
144 | { | 145 | { |
145 | if (!_headersSent) SendHeaders(); | 146 | if (!_headersSent) SendHeaders(); |
146 | if (_sent) throw new InvalidOperationException("stuff already sent"); | 147 | if (_sent) throw new InvalidOperationException("stuff already sent"); |
147 | _sent = true; | 148 | _sent = true; |
148 | } | 149 | } |
149 | 150 | ||
150 | public void SendBody(byte[] buffer, int offset, int count) | 151 | public void SendBody(byte[] buffer, int offset, int count) |
151 | { | 152 | { |
152 | if (!_headersSent) SendHeaders(); | 153 | if (!_headersSent) SendHeaders(); |
153 | _sent = true; | 154 | _sent = true; |
154 | } | 155 | } |
155 | 156 | ||
156 | public void SendBody(byte[] buffer) | 157 | public void SendBody(byte[] buffer) |
157 | { | 158 | { |
158 | if (!_headersSent) SendHeaders(); | 159 | if (!_headersSent) SendHeaders(); |
159 | _sent = true; | 160 | _sent = true; |
160 | } | 161 | } |
161 | 162 | ||
162 | public void SendHeaders() | 163 | public void SendHeaders() |
163 | { | 164 | { |
164 | if (_headersSent) throw new InvalidOperationException("headers already sent"); | 165 | if (_headersSent) throw new InvalidOperationException("headers already sent"); |
165 | _headersSent = true; | 166 | _headersSent = true; |
@@ -168,4 +169,5 @@ namespace OpenSim.Tests.Common | |||
168 | public void Redirect(Uri uri) {} | 169 | public void Redirect(Uri uri) {} |
169 | public void Redirect(string url) {} | 170 | public void Redirect(string url) {} |
170 | } | 171 | } |
172 | */ | ||
171 | } \ No newline at end of file | 173 | } \ No newline at end of file |
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index c97a765..0ff6f7f 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common | |||
43 | public class TestInventoryDataPlugin : IInventoryDataPlugin | 43 | public class TestInventoryDataPlugin : IInventoryDataPlugin |
44 | { | 44 | { |
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | /// <value> | 47 | /// <value> |
48 | /// Inventory folders | 48 | /// Inventory folders |
49 | /// </value> | 49 | /// </value> |
@@ -85,9 +85,9 @@ namespace OpenSim.Tests.Common | |||
85 | public List<InventoryItemBase> getInventoryInFolder(UUID folderID) | 85 | public List<InventoryItemBase> getInventoryInFolder(UUID folderID) |
86 | { | 86 | { |
87 | // InventoryFolderBase folder = m_folders[folderID]; | 87 | // InventoryFolderBase folder = m_folders[folderID]; |
88 | 88 | ||
89 | // m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); | 89 | // m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); |
90 | 90 | ||
91 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | 91 | List<InventoryItemBase> items = new List<InventoryItemBase>(); |
92 | 92 | ||
93 | foreach (InventoryItemBase item in m_items.Values) | 93 | foreach (InventoryItemBase item in m_items.Values) |
@@ -98,7 +98,7 @@ namespace OpenSim.Tests.Common | |||
98 | items.Add(item); | 98 | items.Add(item); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | 101 | ||
102 | return items; | 102 | return items; |
103 | } | 103 | } |
104 | 104 | ||
@@ -107,7 +107,7 @@ namespace OpenSim.Tests.Common | |||
107 | public InventoryFolderBase getUserRootFolder(UUID user) | 107 | public InventoryFolderBase getUserRootFolder(UUID user) |
108 | { | 108 | { |
109 | // m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); | 109 | // m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); |
110 | 110 | ||
111 | InventoryFolderBase folder = null; | 111 | InventoryFolderBase folder = null; |
112 | m_rootFolders.TryGetValue(user, out folder); | 112 | m_rootFolders.TryGetValue(user, out folder); |
113 | 113 | ||
@@ -117,9 +117,9 @@ namespace OpenSim.Tests.Common | |||
117 | public List<InventoryFolderBase> getInventoryFolders(UUID parentID) | 117 | public List<InventoryFolderBase> getInventoryFolders(UUID parentID) |
118 | { | 118 | { |
119 | // InventoryFolderBase parentFolder = m_folders[parentID]; | 119 | // InventoryFolderBase parentFolder = m_folders[parentID]; |
120 | 120 | ||
121 | // m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); | 121 | // m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); |
122 | 122 | ||
123 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 123 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
124 | 124 | ||
125 | foreach (InventoryFolderBase folder in m_folders.Values) | 125 | foreach (InventoryFolderBase folder in m_folders.Values) |
@@ -127,9 +127,9 @@ namespace OpenSim.Tests.Common | |||
127 | if (folder.ParentID == parentID) | 127 | if (folder.ParentID == parentID) |
128 | { | 128 | { |
129 | // m_log.DebugFormat( | 129 | // m_log.DebugFormat( |
130 | // "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", | 130 | // "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", |
131 | // folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); | 131 | // folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); |
132 | 132 | ||
133 | folders.Add(folder); | 133 | folders.Add(folder); |
134 | } | 134 | } |
135 | } | 135 | } |
@@ -153,9 +153,9 @@ namespace OpenSim.Tests.Common | |||
153 | public void addInventoryFolder(InventoryFolderBase folder) | 153 | public void addInventoryFolder(InventoryFolderBase folder) |
154 | { | 154 | { |
155 | // m_log.DebugFormat( | 155 | // m_log.DebugFormat( |
156 | // "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", | 156 | // "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", |
157 | // folder.Name, folder.ID, (AssetType)folder.Type); | 157 | // folder.Name, folder.ID, (AssetType)folder.Type); |
158 | 158 | ||
159 | m_folders[folder.ID] = folder; | 159 | m_folders[folder.ID] = folder; |
160 | 160 | ||
161 | if (folder.ParentID == UUID.Zero) | 161 | if (folder.ParentID == UUID.Zero) |
@@ -183,30 +183,30 @@ namespace OpenSim.Tests.Common | |||
183 | m_folders.Remove(folderId); | 183 | m_folders.Remove(folderId); |
184 | } | 184 | } |
185 | 185 | ||
186 | public void addInventoryItem(InventoryItemBase item) | 186 | public void addInventoryItem(InventoryItemBase item) |
187 | { | 187 | { |
188 | InventoryFolderBase folder = m_folders[item.Folder]; | 188 | InventoryFolderBase folder = m_folders[item.Folder]; |
189 | 189 | ||
190 | // m_log.DebugFormat( | 190 | // m_log.DebugFormat( |
191 | // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); | 191 | // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); |
192 | 192 | ||
193 | m_items[item.ID] = item; | 193 | m_items[item.ID] = item; |
194 | } | 194 | } |
195 | 195 | ||
196 | public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } | 196 | public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } |
197 | 197 | ||
198 | public void deleteInventoryItem(UUID itemId) | 198 | public void deleteInventoryItem(UUID itemId) |
199 | { | 199 | { |
200 | if (m_items.ContainsKey(itemId)) | 200 | if (m_items.ContainsKey(itemId)) |
201 | m_items.Remove(itemId); | 201 | m_items.Remove(itemId); |
202 | } | 202 | } |
203 | 203 | ||
204 | public InventoryItemBase getInventoryItem(UUID itemId) | 204 | public InventoryItemBase getInventoryItem(UUID itemId) |
205 | { | 205 | { |
206 | if (m_items.ContainsKey(itemId)) | 206 | if (m_items.ContainsKey(itemId)) |
207 | return m_items[itemId]; | 207 | return m_items[itemId]; |
208 | else | 208 | else |
209 | return null; | 209 | return null; |
210 | } | 210 | } |
211 | 211 | ||
212 | public InventoryItemBase queryInventoryItem(UUID item) | 212 | public InventoryItemBase queryInventoryItem(UUID item) |
diff --git a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs index 26887c9..388b56b 100644 --- a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs +++ b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs | |||
@@ -43,8 +43,8 @@ namespace OpenSim.Tests.Common | |||
43 | { | 43 | { |
44 | public List<Packet> PacketsSent { get; private set; } | 44 | public List<Packet> PacketsSent { get; private set; } |
45 | 45 | ||
46 | public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) | 46 | public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager) |
47 | : base(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager) | 47 | : base(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager) |
48 | { | 48 | { |
49 | PacketsSent = new List<Packet>(); | 49 | PacketsSent = new List<Packet>(); |
50 | } | 50 | } |
@@ -73,7 +73,7 @@ namespace OpenSim.Tests.Common | |||
73 | //// /// The chunks of data to pass to the LLUDPServer when it calls EndReceive | 73 | //// /// The chunks of data to pass to the LLUDPServer when it calls EndReceive |
74 | //// /// </summary> | 74 | //// /// </summary> |
75 | //// protected Queue<ChunkSenderTuple> m_chunksToLoad = new Queue<ChunkSenderTuple>(); | 75 | //// protected Queue<ChunkSenderTuple> m_chunksToLoad = new Queue<ChunkSenderTuple>(); |
76 | // | 76 | // |
77 | //// protected override void BeginReceive() | 77 | //// protected override void BeginReceive() |
78 | //// { | 78 | //// { |
79 | //// if (m_chunksToLoad.Count > 0 && m_chunksToLoad.Peek().BeginReceiveException) | 79 | //// if (m_chunksToLoad.Count > 0 && m_chunksToLoad.Peek().BeginReceiveException) |
@@ -83,29 +83,29 @@ namespace OpenSim.Tests.Common | |||
83 | //// throw new SocketException(); | 83 | //// throw new SocketException(); |
84 | //// } | 84 | //// } |
85 | //// } | 85 | //// } |
86 | // | 86 | // |
87 | //// protected override bool EndReceive(out int numBytes, IAsyncResult result, ref EndPoint epSender) | 87 | //// protected override bool EndReceive(out int numBytes, IAsyncResult result, ref EndPoint epSender) |
88 | //// { | 88 | //// { |
89 | //// numBytes = 0; | 89 | //// numBytes = 0; |
90 | //// | 90 | //// |
91 | //// //m_log.Debug("Queue size " + m_chunksToLoad.Count); | 91 | //// //m_log.Debug("Queue size " + m_chunksToLoad.Count); |
92 | //// | 92 | //// |
93 | //// if (m_chunksToLoad.Count <= 0) | 93 | //// if (m_chunksToLoad.Count <= 0) |
94 | //// return false; | 94 | //// return false; |
95 | //// | 95 | //// |
96 | //// ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); | 96 | //// ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); |
97 | //// RecvBuffer = tuple.Data; | 97 | //// RecvBuffer = tuple.Data; |
98 | //// numBytes = tuple.Data.Length; | 98 | //// numBytes = tuple.Data.Length; |
99 | //// epSender = tuple.Sender; | 99 | //// epSender = tuple.Sender; |
100 | //// | 100 | //// |
101 | //// return true; | 101 | //// return true; |
102 | //// } | 102 | //// } |
103 | // | 103 | // |
104 | //// public override void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) | 104 | //// public override void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) |
105 | //// { | 105 | //// { |
106 | //// // Don't do anything just yet | 106 | //// // Don't do anything just yet |
107 | //// } | 107 | //// } |
108 | // | 108 | // |
109 | // /// <summary> | 109 | // /// <summary> |
110 | // /// Signal that this chunk should throw an exception on Socket.BeginReceive() | 110 | // /// Signal that this chunk should throw an exception on Socket.BeginReceive() |
111 | // /// </summary> | 111 | // /// </summary> |
@@ -116,7 +116,7 @@ namespace OpenSim.Tests.Common | |||
116 | // tuple.BeginReceiveException = true; | 116 | // tuple.BeginReceiveException = true; |
117 | // m_chunksToLoad.Enqueue(tuple); | 117 | // m_chunksToLoad.Enqueue(tuple); |
118 | // } | 118 | // } |
119 | // | 119 | // |
120 | // /// <summary> | 120 | // /// <summary> |
121 | // /// Load some data to be received by the LLUDPServer on the next receive call | 121 | // /// Load some data to be received by the LLUDPServer on the next receive call |
122 | // /// </summary> | 122 | // /// </summary> |
@@ -126,7 +126,7 @@ namespace OpenSim.Tests.Common | |||
126 | // { | 126 | // { |
127 | // m_chunksToLoad.Enqueue(new ChunkSenderTuple(data, epSender)); | 127 | // m_chunksToLoad.Enqueue(new ChunkSenderTuple(data, epSender)); |
128 | // } | 128 | // } |
129 | // | 129 | // |
130 | // /// <summary> | 130 | // /// <summary> |
131 | // /// Load a packet to be received by the LLUDPServer on the next receive call | 131 | // /// Load a packet to be received by the LLUDPServer on the next receive call |
132 | // /// </summary> | 132 | // /// </summary> |
@@ -135,7 +135,7 @@ namespace OpenSim.Tests.Common | |||
135 | // { | 135 | // { |
136 | // LoadReceive(packet.ToBytes(), epSender); | 136 | // LoadReceive(packet.ToBytes(), epSender); |
137 | // } | 137 | // } |
138 | // | 138 | // |
139 | // /// <summary> | 139 | // /// <summary> |
140 | // /// Calls the protected asynchronous result method. This fires out all data chunks currently queued for send | 140 | // /// Calls the protected asynchronous result method. This fires out all data chunks currently queued for send |
141 | // /// </summary> | 141 | // /// </summary> |
@@ -147,7 +147,7 @@ namespace OpenSim.Tests.Common | |||
147 | //// OnReceivedData(result); | 147 | //// OnReceivedData(result); |
148 | // } | 148 | // } |
149 | } | 149 | } |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// Record the data and sender tuple | 152 | /// Record the data and sender tuple |
153 | /// </summary> | 153 | /// </summary> |
@@ -156,13 +156,13 @@ namespace OpenSim.Tests.Common | |||
156 | public byte[] Data; | 156 | public byte[] Data; |
157 | public EndPoint Sender; | 157 | public EndPoint Sender; |
158 | public bool BeginReceiveException; | 158 | public bool BeginReceiveException; |
159 | 159 | ||
160 | public ChunkSenderTuple(byte[] data, EndPoint sender) | 160 | public ChunkSenderTuple(byte[] data, EndPoint sender) |
161 | { | 161 | { |
162 | Data = data; | 162 | Data = data; |
163 | Sender = sender; | 163 | Sender = sender; |
164 | } | 164 | } |
165 | 165 | ||
166 | public ChunkSenderTuple(EndPoint sender) | 166 | public ChunkSenderTuple(EndPoint sender) |
167 | { | 167 | { |
168 | Sender = sender; | 168 | Sender = sender; |
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 89ebcd5..05db03fe 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common | |||
65 | { | 65 | { |
66 | return m_parcels; | 66 | return m_parcels; |
67 | } | 67 | } |
68 | 68 | ||
69 | public void Clear(bool setupDefaultParcel) | 69 | public void Clear(bool setupDefaultParcel) |
70 | { | 70 | { |
71 | m_parcels.Clear(); | 71 | m_parcels.Clear(); |
@@ -96,6 +96,11 @@ namespace OpenSim.Tests.Common | |||
96 | return GetNoLand(); | 96 | return GetNoLand(); |
97 | } | 97 | } |
98 | 98 | ||
99 | public ILandObject GetLandObject(UUID ID) | ||
100 | { | ||
101 | return GetNoLand(); | ||
102 | } | ||
103 | |||
99 | public ILandObject GetLandObject(float x, float y) | 104 | public ILandObject GetLandObject(float x, float y) |
100 | { | 105 | { |
101 | return GetNoLand(); | 106 | return GetNoLand(); |
@@ -104,6 +109,7 @@ namespace OpenSim.Tests.Common | |||
104 | public bool IsLandPrimCountTainted() { return false; } | 109 | public bool IsLandPrimCountTainted() { return false; } |
105 | public bool IsForcefulBansAllowed() { return false; } | 110 | public bool IsForcefulBansAllowed() { return false; } |
106 | public void UpdateLandObject(int localID, LandData data) {} | 111 | public void UpdateLandObject(int localID, LandData data) {} |
112 | public void SendParcelsOverlay(IClientAPI client) {} | ||
107 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) {} | 113 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) {} |
108 | public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) {} | 114 | public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) {} |
109 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) {} | 115 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) {} |
@@ -111,5 +117,6 @@ namespace OpenSim.Tests.Common | |||
111 | 117 | ||
112 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} | 118 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} |
113 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} | 119 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} |
120 | public void sendClientInitialLandInfo(IClientAPI remoteClient) { } | ||
114 | } | 121 | } |
115 | } \ No newline at end of file | 122 | } \ No newline at end of file |
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 1a93c9f..0b3d446 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Tests.Common | |||
41 | public class TestScene : Scene | 41 | public class TestScene : Scene |
42 | { | 42 | { |
43 | public TestScene( | 43 | public TestScene( |
44 | RegionInfo regInfo, AgentCircuitManager authen, | 44 | RegionInfo regInfo, AgentCircuitManager authen, |
45 | ISimulationDataService simDataService, IEstateDataService estateDataService, | 45 | ISimulationDataService simDataService, IEstateDataService estateDataService, |
46 | IConfigSource config, string simulatorVersion) | 46 | IConfigSource config, string simulatorVersion) |
47 | : base(regInfo, authen, simDataService, estateDataService, | 47 | : base(regInfo, authen, simDataService, estateDataService, |
@@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common | |||
54 | //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); | 54 | //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); |
55 | Console.WriteLine("TestScene destructor called"); | 55 | Console.WriteLine("TestScene destructor called"); |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Temporarily override session authentication for tests (namely teleport). | 59 | /// Temporarily override session authentication for tests (namely teleport). |
60 | /// </summary> | 60 | /// </summary> |
@@ -68,7 +68,7 @@ namespace OpenSim.Tests.Common | |||
68 | reason = String.Empty; | 68 | reason = String.Empty; |
69 | return true; | 69 | return true; |
70 | } | 70 | } |
71 | 71 | ||
72 | public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter | 72 | public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter |
73 | { | 73 | { |
74 | get { return m_asyncSceneObjectDeleter; } | 74 | get { return m_asyncSceneObjectDeleter; } |
diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index 2b272e6..77f1793 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Tests.Common | |||
89 | m_allItems[item.inventoryID] = item.Clone(); | 89 | m_allItems[item.inventoryID] = item.Clone(); |
90 | 90 | ||
91 | // Console.WriteLine( | 91 | // Console.WriteLine( |
92 | // "Added item {0} {1}, folder {2}, creator {3}, owner {4}", | 92 | // "Added item {0} {1}, folder {2}, creator {3}, owner {4}", |
93 | // item.inventoryName, item.inventoryID, item.parentFolderID, item.creatorID, item.avatarID); | 93 | // item.inventoryName, item.inventoryID, item.parentFolderID, item.creatorID, item.avatarID); |
94 | 94 | ||
95 | return true; | 95 | return true; |
@@ -123,8 +123,8 @@ namespace OpenSim.Tests.Common | |||
123 | 123 | ||
124 | public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } | 124 | public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } |
125 | 125 | ||
126 | public bool MoveFolder(string id, string newParent) | 126 | public bool MoveFolder(string id, string newParent) |
127 | { | 127 | { |
128 | // Don't use GetFolders() here - it takes a clone! | 128 | // Don't use GetFolders() here - it takes a clone! |
129 | XInventoryFolder folder = m_allFolders[new UUID(id)]; | 129 | XInventoryFolder folder = m_allFolders[new UUID(id)]; |
130 | 130 | ||
@@ -133,11 +133,11 @@ namespace OpenSim.Tests.Common | |||
133 | 133 | ||
134 | folder.parentFolderID = new UUID(newParent); | 134 | folder.parentFolderID = new UUID(newParent); |
135 | 135 | ||
136 | // XInventoryFolder[] newParentFolders | 136 | // XInventoryFolder[] newParentFolders |
137 | // = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); | 137 | // = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); |
138 | 138 | ||
139 | // Console.WriteLine( | 139 | // Console.WriteLine( |
140 | // "Moved folder {0} {1}, to {2} {3}", | 140 | // "Moved folder {0} {1}, to {2} {3}", |
141 | // folder.folderName, folder.folderID, newParentFolders[0].folderName, folder.parentFolderID); | 141 | // folder.folderName, folder.folderID, newParentFolders[0].folderName, folder.parentFolderID); |
142 | 142 | ||
143 | // TODO: Really need to implement folder version incrementing, though this should be common code anyway, | 143 | // TODO: Really need to implement folder version incrementing, though this should be common code anyway, |
diff --git a/OpenSim/Tests/Common/TestHelpers.cs b/OpenSim/Tests/Common/TestHelpers.cs index 6bf23f8..2b2af34 100644 --- a/OpenSim/Tests/Common/TestHelpers.cs +++ b/OpenSim/Tests/Common/TestHelpers.cs | |||
@@ -81,9 +81,9 @@ namespace OpenSim.Tests.Common | |||
81 | 81 | ||
82 | return false; | 82 | return false; |
83 | } | 83 | } |
84 | 84 | ||
85 | /// <summary> | 85 | /// <summary> |
86 | /// A debugging method that can be used to print out which test method you are in | 86 | /// A debugging method that can be used to print out which test method you are in |
87 | /// </summary> | 87 | /// </summary> |
88 | public static void InMethod() | 88 | public static void InMethod() |
89 | { | 89 | { |
@@ -129,7 +129,7 @@ namespace OpenSim.Tests.Common | |||
129 | { | 129 | { |
130 | string rawUuid = stem.PadRight(32, '0'); | 130 | string rawUuid = stem.PadRight(32, '0'); |
131 | 131 | ||
132 | return UUID.Parse(rawUuid); | 132 | return UUID.Parse(rawUuid); |
133 | } | 133 | } |
134 | 134 | ||
135 | /// <summary> | 135 | /// <summary> |
@@ -158,7 +158,7 @@ namespace OpenSim.Tests.Common | |||
158 | { | 158 | { |
159 | string rawUuid = stem.PadLeft(32, '0'); | 159 | string rawUuid = stem.PadLeft(32, '0'); |
160 | 160 | ||
161 | return UUID.Parse(rawUuid); | 161 | return UUID.Parse(rawUuid); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | } | 164 | } |
diff --git a/OpenSim/Tests/Performance/NPCPerformanceTests.cs b/OpenSim/Tests/Performance/NPCPerformanceTests.cs index ca6ae42..e41f5d1 100644 --- a/OpenSim/Tests/Performance/NPCPerformanceTests.cs +++ b/OpenSim/Tests/Performance/NPCPerformanceTests.cs | |||
@@ -143,8 +143,7 @@ namespace OpenSim.Tests.Performance | |||
143 | // ScenePresence.SendInitialData() to reset our entire appearance. | 143 | // ScenePresence.SendInitialData() to reset our entire appearance. |
144 | scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); | 144 | scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); |
145 | 145 | ||
146 | /* | 146 | afm.SetAppearance(sp, originalTe, null, new WearableCacheItem[0]); |
147 | afm.SetAppearance(sp, originalTe, null); | ||
148 | 147 | ||
149 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 148 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
150 | 149 | ||
@@ -185,7 +184,6 @@ namespace OpenSim.Tests.Performance | |||
185 | endGcMemory / 1024 / 1024, | 184 | endGcMemory / 1024 / 1024, |
186 | startGcMemory / 1024 / 1024, | 185 | startGcMemory / 1024 / 1024, |
187 | (endGcMemory - startGcMemory) / 1024 / 1024); | 186 | (endGcMemory - startGcMemory) / 1024 / 1024); |
188 | */ | ||
189 | } | 187 | } |
190 | } | 188 | } |
191 | } | 189 | } |
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs new file mode 100644 index 0000000..4ecce38 --- /dev/null +++ b/OpenSim/Tests/Permissions/Common.cs | |||
@@ -0,0 +1,374 @@ | |||
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 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Threading; | ||
30 | using Nini.Config; | ||
31 | using NUnit.Framework; | ||
32 | using OpenMetaverse; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.Framework.Scenes; | ||
35 | using OpenSim.Region.CoreModules.World.Permissions; | ||
36 | using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; | ||
37 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | ||
38 | using OpenSim.Services.Interfaces; | ||
39 | using OpenSim.Tests.Common; | ||
40 | using PermissionMask = OpenSim.Framework.PermissionMask; | ||
41 | |||
42 | namespace OpenSim.Tests.Permissions | ||
43 | { | ||
44 | [SetUpFixture] | ||
45 | public class Common : OpenSimTestCase | ||
46 | { | ||
47 | public static Common TheInstance; | ||
48 | |||
49 | public static TestScene TheScene | ||
50 | { | ||
51 | get { return TheInstance.m_Scene; } | ||
52 | } | ||
53 | |||
54 | public static ScenePresence[] TheAvatars | ||
55 | { | ||
56 | get { return TheInstance.m_Avatars; } | ||
57 | } | ||
58 | |||
59 | private static string Perms = "Owner: {0}; Group: {1}; Everyone: {2}; Next: {3}"; | ||
60 | private TestScene m_Scene; | ||
61 | private ScenePresence[] m_Avatars = new ScenePresence[3]; | ||
62 | |||
63 | [SetUp] | ||
64 | public override void SetUp() | ||
65 | { | ||
66 | if (TheInstance == null) | ||
67 | TheInstance = this; | ||
68 | |||
69 | base.SetUp(); | ||
70 | TestHelpers.EnableLogging(); | ||
71 | |||
72 | IConfigSource config = new IniConfigSource(); | ||
73 | config.AddConfig("Messaging"); | ||
74 | config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); | ||
75 | |||
76 | config.AddConfig("Modules"); | ||
77 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); | ||
78 | |||
79 | config.AddConfig("InventoryService"); | ||
80 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService"); | ||
81 | config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin"); | ||
82 | |||
83 | config.AddConfig("Groups"); | ||
84 | config.Configs["Groups"].Set("Enabled", "true"); | ||
85 | config.Configs["Groups"].Set("Module", "Groups Module V2"); | ||
86 | config.Configs["Groups"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestGroupsDataPlugin"); | ||
87 | config.Configs["Groups"].Set("ServicesConnectorModule", "Groups Local Service Connector"); | ||
88 | config.Configs["Groups"].Set("LocalService", "local"); | ||
89 | |||
90 | m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config); | ||
91 | // Add modules | ||
92 | SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule()); | ||
93 | |||
94 | SetUpBasicEnvironment(); | ||
95 | } | ||
96 | |||
97 | /// <summary> | ||
98 | /// The basic environment consists of: | ||
99 | /// - 3 avatars: A1, A2, A3 | ||
100 | /// - 6 simple boxes inworld belonging to A0 and with Next Owner perms: | ||
101 | /// C, CT, MC, MCT, MT, T | ||
102 | /// - Copies of all of these boxes in A0's inventory in the Objects folder | ||
103 | /// - One additional box inworld and in A0's inventory which is a copy of MCT, but | ||
104 | /// with C removed in inventory. This one is called MCT-C | ||
105 | /// </summary> | ||
106 | private void SetUpBasicEnvironment() | ||
107 | { | ||
108 | Console.WriteLine("===> SetUpBasicEnvironment <==="); | ||
109 | |||
110 | // Add 3 avatars | ||
111 | for (int i = 0; i < 3; i++) | ||
112 | { | ||
113 | UUID id = TestHelpers.ParseTail(i + 1); | ||
114 | |||
115 | m_Avatars[i] = AddScenePresence("Bot", "Bot_" + (i+1), id); | ||
116 | Assert.That(m_Avatars[i], Is.Not.Null); | ||
117 | Assert.That(m_Avatars[i].IsChildAgent, Is.False); | ||
118 | Assert.That(m_Avatars[i].UUID, Is.EqualTo(id)); | ||
119 | Assert.That(m_Scene.GetScenePresences().Count, Is.EqualTo(i + 1)); | ||
120 | } | ||
121 | |||
122 | AddA1Object("Box C", 10, PermissionMask.Copy); | ||
123 | AddA1Object("Box CT", 11, PermissionMask.Copy | PermissionMask.Transfer); | ||
124 | AddA1Object("Box MC", 12, PermissionMask.Modify | PermissionMask.Copy); | ||
125 | AddA1Object("Box MCT", 13, PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer); | ||
126 | AddA1Object("Box MT", 14, PermissionMask.Modify | PermissionMask.Transfer); | ||
127 | AddA1Object("Box T", 15, PermissionMask.Transfer); | ||
128 | |||
129 | // MCT-C | ||
130 | AddA1Object("Box MCT-C", 16, PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer); | ||
131 | |||
132 | Thread.Sleep(5000); | ||
133 | |||
134 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[0].UUID, "Objects"); | ||
135 | List<InventoryItemBase> items = m_Scene.InventoryService.GetFolderItems(m_Avatars[0].UUID, objsFolder.ID); | ||
136 | Assert.That(items.Count, Is.EqualTo(7)); | ||
137 | |||
138 | RevokePermission(0, "Box MCT-C", PermissionMask.Copy); | ||
139 | } | ||
140 | |||
141 | private ScenePresence AddScenePresence(string first, string last, UUID id) | ||
142 | { | ||
143 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_Scene, first, last, id, "pw"); | ||
144 | ScenePresence sp = SceneHelpers.AddScenePresence(m_Scene, id); | ||
145 | Assert.That(m_Scene.AuthenticateHandler.GetAgentCircuitData(id), Is.Not.Null); | ||
146 | |||
147 | return sp; | ||
148 | } | ||
149 | |||
150 | private void AddA1Object(string name, int suffix, PermissionMask nextOwnerPerms) | ||
151 | { | ||
152 | // Create a Box. Default permissions are just T | ||
153 | SceneObjectGroup box = AddSceneObject(name, suffix, 1, m_Avatars[0].UUID); | ||
154 | Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Copy) == 0); | ||
155 | Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Modify) == 0); | ||
156 | Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Transfer) != 0); | ||
157 | |||
158 | // field = 16 is NextOwner | ||
159 | // set = 1 means add the permission; set = 0 means remove permission | ||
160 | |||
161 | if ((nextOwnerPerms & PermissionMask.Copy) != 0) | ||
162 | m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, | ||
163 | ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Copy, 1); | ||
164 | |||
165 | if ((nextOwnerPerms & PermissionMask.Modify) != 0) | ||
166 | m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, | ||
167 | ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Modify, 1); | ||
168 | |||
169 | if ((nextOwnerPerms & PermissionMask.Transfer) == 0) | ||
170 | m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, | ||
171 | ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Transfer, 0); | ||
172 | |||
173 | PrintPerms(box); | ||
174 | AssertPermissions(nextOwnerPerms, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name); | ||
175 | |||
176 | TakeCopyToInventory(0, box); | ||
177 | |||
178 | } | ||
179 | |||
180 | public void RevokePermission(int ownerIndex, string name, PermissionMask perm) | ||
181 | { | ||
182 | InventoryItemBase item = Common.TheInstance.GetItemFromInventory(m_Avatars[ownerIndex].UUID, "Objects", name); | ||
183 | Assert.That(item, Is.Not.Null); | ||
184 | |||
185 | // Clone it, so to avoid aliasing -- just like the viewer does. | ||
186 | InventoryItemBase clone = Common.TheInstance.CloneInventoryItem(item); | ||
187 | // Revoke the permission in this copy | ||
188 | clone.NextPermissions &= ~(uint)perm; | ||
189 | Common.TheInstance.AssertPermissions((PermissionMask)clone.NextPermissions & ~perm, | ||
190 | (PermissionMask)clone.NextPermissions, Common.TheInstance.IdStr(clone)); | ||
191 | Assert.That(clone.ID == item.ID); | ||
192 | |||
193 | // Update properties of the item in inventory. This should affect the original item above. | ||
194 | Common.TheScene.UpdateInventoryItemAsset(m_Avatars[ownerIndex].ControllingClient, UUID.Zero, clone.ID, clone); | ||
195 | |||
196 | item = Common.TheInstance.GetItemFromInventory(m_Avatars[ownerIndex].UUID, "Objects", name); | ||
197 | Assert.That(item, Is.Not.Null); | ||
198 | Common.TheInstance.PrintPerms(item); | ||
199 | Common.TheInstance.AssertPermissions((PermissionMask)item.NextPermissions & ~perm, | ||
200 | (PermissionMask)item.NextPermissions, Common.TheInstance.IdStr(item)); | ||
201 | |||
202 | } | ||
203 | |||
204 | public void PrintPerms(SceneObjectGroup sog) | ||
205 | { | ||
206 | Console.WriteLine("SOG " + sog.Name + " (" + sog.OwnerID.ToString().Substring(34) + "): " + | ||
207 | String.Format(Perms, (PermissionMask)sog.EffectiveOwnerPerms, | ||
208 | (PermissionMask)sog.EffectiveGroupPerms, (PermissionMask)sog.EffectiveEveryOnePerms, (PermissionMask)sog.RootPart.NextOwnerMask)); | ||
209 | |||
210 | } | ||
211 | |||
212 | public void PrintPerms(InventoryItemBase item) | ||
213 | { | ||
214 | Console.WriteLine("Inv " + item.Name + " (" + item.Owner.ToString().Substring(34) + "): " + | ||
215 | String.Format(Perms, (PermissionMask)item.BasePermissions, | ||
216 | (PermissionMask)item.GroupPermissions, (PermissionMask)item.EveryOnePermissions, (PermissionMask)item.NextPermissions)); | ||
217 | |||
218 | } | ||
219 | |||
220 | public void AssertPermissions(PermissionMask desired, PermissionMask actual, string message) | ||
221 | { | ||
222 | if ((desired & PermissionMask.Copy) != 0) | ||
223 | Assert.True((actual & PermissionMask.Copy) != 0, message); | ||
224 | else | ||
225 | Assert.True((actual & PermissionMask.Copy) == 0, message); | ||
226 | |||
227 | if ((desired & PermissionMask.Modify) != 0) | ||
228 | Assert.True((actual & PermissionMask.Modify) != 0, message); | ||
229 | else | ||
230 | Assert.True((actual & PermissionMask.Modify) == 0, message); | ||
231 | |||
232 | if ((desired & PermissionMask.Transfer) != 0) | ||
233 | Assert.True((actual & PermissionMask.Transfer) != 0, message); | ||
234 | else | ||
235 | Assert.True((actual & PermissionMask.Transfer) == 0, message); | ||
236 | |||
237 | } | ||
238 | |||
239 | public SceneObjectGroup AddSceneObject(string name, int suffix, int partsToTestCount, UUID ownerID) | ||
240 | { | ||
241 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(partsToTestCount, ownerID, name, suffix); | ||
242 | so.Name = name; | ||
243 | so.Description = name; | ||
244 | |||
245 | Assert.That(m_Scene.AddNewSceneObject(so, false), Is.True); | ||
246 | SceneObjectGroup retrievedSo = m_Scene.GetSceneObjectGroup(so.UUID); | ||
247 | |||
248 | // If the parts have the same UUID then we will consider them as one and the same | ||
249 | Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); | ||
250 | |||
251 | return so; | ||
252 | } | ||
253 | |||
254 | public void TakeCopyToInventory(int userIndex, SceneObjectGroup sog) | ||
255 | { | ||
256 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[userIndex].UUID, "Objects"); | ||
257 | Assert.That(objsFolder, Is.Not.Null); | ||
258 | |||
259 | List<uint> localIds = new List<uint>(); localIds.Add(sog.LocalId); | ||
260 | // This is an async operation | ||
261 | m_Scene.DeRezObjects((IClientAPI)m_Avatars[userIndex].ClientView, localIds, m_Avatars[userIndex].UUID, DeRezAction.TakeCopy, objsFolder.ID); | ||
262 | } | ||
263 | |||
264 | public InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName) | ||
265 | { | ||
266 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, userID, folderName); | ||
267 | Assert.That(objsFolder, Is.Not.Null); | ||
268 | List<InventoryItemBase> items = m_Scene.InventoryService.GetFolderItems(userID, objsFolder.ID); | ||
269 | InventoryItemBase item = items.Find(i => i.Name == itemName); | ||
270 | Assert.That(item, Is.Not.Null); | ||
271 | |||
272 | return item; | ||
273 | } | ||
274 | |||
275 | public InventoryItemBase CloneInventoryItem(InventoryItemBase item) | ||
276 | { | ||
277 | InventoryItemBase clone = new InventoryItemBase(item.ID); | ||
278 | clone.Name = item.Name; | ||
279 | clone.Description = item.Description; | ||
280 | clone.AssetID = item.AssetID; | ||
281 | clone.AssetType = item.AssetType; | ||
282 | clone.BasePermissions = item.BasePermissions; | ||
283 | clone.CreatorId = item.CreatorId; | ||
284 | clone.CurrentPermissions = item.CurrentPermissions; | ||
285 | clone.EveryOnePermissions = item.EveryOnePermissions; | ||
286 | clone.Flags = item.Flags; | ||
287 | clone.Folder = item.Folder; | ||
288 | clone.GroupID = item.GroupID; | ||
289 | clone.GroupOwned = item.GroupOwned; | ||
290 | clone.GroupPermissions = item.GroupPermissions; | ||
291 | clone.InvType = item.InvType; | ||
292 | clone.NextPermissions = item.NextPermissions; | ||
293 | clone.Owner = item.Owner; | ||
294 | |||
295 | return clone; | ||
296 | } | ||
297 | |||
298 | public void DeleteObjectsFolders() | ||
299 | { | ||
300 | // Delete everything in A2 and A3's Objects folders, so we can restart | ||
301 | for (int i = 1; i < 3; i++) | ||
302 | { | ||
303 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects"); | ||
304 | Assert.That(objsFolder, Is.Not.Null); | ||
305 | |||
306 | List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); | ||
307 | List<UUID> ids = new List<UUID>(); | ||
308 | foreach (InventoryItemBase it in items) | ||
309 | ids.Add(it.ID); | ||
310 | |||
311 | Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids); | ||
312 | items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); | ||
313 | Assert.That(items.Count, Is.EqualTo(0), "A" + (i + 1)); | ||
314 | } | ||
315 | |||
316 | } | ||
317 | |||
318 | public string IdStr(InventoryItemBase item) | ||
319 | { | ||
320 | return item.Owner.ToString().Substring(34) + " : " + item.Name; | ||
321 | } | ||
322 | |||
323 | public string IdStr(SceneObjectGroup sog) | ||
324 | { | ||
325 | return sog.OwnerID.ToString().Substring(34) + " : " + sog.Name; | ||
326 | } | ||
327 | |||
328 | public void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp) | ||
329 | { | ||
330 | TestClient giverClient = (TestClient)giverSp.ControllingClient; | ||
331 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | ||
332 | |||
333 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | ||
334 | byte[] giveImBinaryBucket = new byte[17]; | ||
335 | byte[] itemIdBytes = itemId.GetBytes(); | ||
336 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | ||
337 | |||
338 | GridInstantMessage giveIm | ||
339 | = new GridInstantMessage( | ||
340 | m_Scene, | ||
341 | giverSp.UUID, | ||
342 | giverSp.Name, | ||
343 | receiverSp.UUID, | ||
344 | (byte)InstantMessageDialog.InventoryOffered, | ||
345 | false, | ||
346 | "inventory offered msg", | ||
347 | initialSessionId, | ||
348 | false, | ||
349 | Vector3.Zero, | ||
350 | giveImBinaryBucket, | ||
351 | true); | ||
352 | |||
353 | giverClient.HandleImprovedInstantMessage(giveIm); | ||
354 | |||
355 | // These details might not all be correct. | ||
356 | GridInstantMessage acceptIm | ||
357 | = new GridInstantMessage( | ||
358 | m_Scene, | ||
359 | receiverSp.UUID, | ||
360 | receiverSp.Name, | ||
361 | giverSp.UUID, | ||
362 | (byte)InstantMessageDialog.InventoryAccepted, | ||
363 | false, | ||
364 | "inventory accepted msg", | ||
365 | initialSessionId, | ||
366 | false, | ||
367 | Vector3.Zero, | ||
368 | null, | ||
369 | true); | ||
370 | |||
371 | receiverClient.HandleImprovedInstantMessage(acceptIm); | ||
372 | } | ||
373 | } | ||
374 | } | ||
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs new file mode 100644 index 0000000..0f251db --- /dev/null +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs | |||
@@ -0,0 +1,153 @@ | |||
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 NUnit.Framework; | ||
29 | using OpenMetaverse; | ||
30 | using OpenSim.Framework; | ||
31 | using OpenSim.Region.Framework.Scenes; | ||
32 | using OpenSim.Tests.Common; | ||
33 | using PermissionMask = OpenSim.Framework.PermissionMask; | ||
34 | |||
35 | namespace OpenSim.Tests.Permissions | ||
36 | { | ||
37 | /// <summary> | ||
38 | /// Basic scene object tests (create, read and delete but not update). | ||
39 | /// </summary> | ||
40 | [TestFixture] | ||
41 | public class DirectTransferTests | ||
42 | { | ||
43 | |||
44 | [SetUp] | ||
45 | public void SetUp() | ||
46 | { | ||
47 | // In case we're dealing with some older version of nunit | ||
48 | if (Common.TheInstance == null) | ||
49 | { | ||
50 | Common.TheInstance = new Common(); | ||
51 | Common.TheInstance.SetUp(); | ||
52 | } | ||
53 | |||
54 | Common.TheInstance.DeleteObjectsFolders(); | ||
55 | } | ||
56 | |||
57 | /// <summary> | ||
58 | /// Test giving simple objecta with various combinations of next owner perms. | ||
59 | /// </summary> | ||
60 | [Test] | ||
61 | public void TestGiveBox() | ||
62 | { | ||
63 | TestHelpers.InMethod(); | ||
64 | |||
65 | // C, CT, MC, MCT, MT, T | ||
66 | string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T" }; | ||
67 | PermissionMask[] perms = new PermissionMask[6] { | ||
68 | PermissionMask.Copy, | ||
69 | PermissionMask.Copy | PermissionMask.Transfer, | ||
70 | PermissionMask.Modify | PermissionMask.Copy, | ||
71 | PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer, | ||
72 | PermissionMask.Modify | PermissionMask.Transfer, | ||
73 | PermissionMask.Transfer | ||
74 | }; | ||
75 | |||
76 | for (int i = 0; i < 6; i++) | ||
77 | TestOneBox(names[i], perms[i]); | ||
78 | } | ||
79 | |||
80 | private void TestOneBox(string name, PermissionMask mask) | ||
81 | { | ||
82 | InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[0].UUID, "Objects", name); | ||
83 | |||
84 | Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[0], Common.TheAvatars[1]); | ||
85 | |||
86 | item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); | ||
87 | |||
88 | // Check the receiver | ||
89 | Common.TheInstance.PrintPerms(item); | ||
90 | Common.TheInstance.AssertPermissions(mask, (PermissionMask)item.BasePermissions, item.Owner.ToString().Substring(34) + " : " + item.Name); | ||
91 | |||
92 | int nObjects = Common.TheScene.GetSceneObjectGroups().Count; | ||
93 | // Rez it and check perms in scene too | ||
94 | Common.TheScene.RezObject(Common.TheAvatars[1].ControllingClient, item.ID, UUID.Zero, Vector3.One, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero); | ||
95 | Assert.That(Common.TheScene.GetSceneObjectGroups().Count, Is.EqualTo(nObjects + 1)); | ||
96 | |||
97 | SceneObjectGroup box = Common.TheScene.GetSceneObjectGroups().Find(sog => sog.OwnerID == Common.TheAvatars[1].UUID && sog.Name == name); | ||
98 | Common.TheInstance.PrintPerms(box); | ||
99 | Assert.That(box, Is.Not.Null); | ||
100 | |||
101 | // Check Owner permissions | ||
102 | Common.TheInstance.AssertPermissions(mask, (PermissionMask)box.EffectiveOwnerPerms, box.OwnerID.ToString().Substring(34) + " : " + box.Name); | ||
103 | |||
104 | // Check Next Owner permissions | ||
105 | Common.TheInstance.AssertPermissions(mask, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name); | ||
106 | |||
107 | } | ||
108 | |||
109 | /// <summary> | ||
110 | /// Test giving simple objecta with variour combinations of next owner perms. | ||
111 | /// </summary> | ||
112 | [Test] | ||
113 | public void TestDoubleGiveWithChange() | ||
114 | { | ||
115 | TestHelpers.InMethod(); | ||
116 | |||
117 | string name = "Box MCT-C"; | ||
118 | InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[0].UUID, "Objects", name); | ||
119 | |||
120 | // Now give the item to A2. We give the original item, not a clone. | ||
121 | // The giving methods are supposed to duplicate it. | ||
122 | Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[0], Common.TheAvatars[1]); | ||
123 | |||
124 | item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); | ||
125 | |||
126 | // Check the receiver | ||
127 | Common.TheInstance.PrintPerms(item); | ||
128 | Common.TheInstance.AssertPermissions(PermissionMask.Modify | PermissionMask.Transfer, | ||
129 | (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); | ||
130 | |||
131 | // --------------------------- | ||
132 | // Second transfer | ||
133 | //---------------------------- | ||
134 | |||
135 | // A2 revokes M | ||
136 | Common.TheInstance.RevokePermission(1, name, PermissionMask.Modify); | ||
137 | |||
138 | item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); | ||
139 | |||
140 | // Now give the item to A3. We give the original item, not a clone. | ||
141 | // The giving methods are supposed to duplicate it. | ||
142 | Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[1], Common.TheAvatars[2]); | ||
143 | |||
144 | item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[2].UUID, "Objects", name); | ||
145 | |||
146 | // Check the receiver | ||
147 | Common.TheInstance.PrintPerms(item); | ||
148 | Common.TheInstance.AssertPermissions(PermissionMask.Transfer, | ||
149 | (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); | ||
150 | |||
151 | } | ||
152 | } | ||
153 | } \ No newline at end of file | ||
diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs new file mode 100644 index 0000000..fb96b8b --- /dev/null +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs | |||
@@ -0,0 +1,132 @@ | |||
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.Collections.Generic; | ||
29 | using System.Threading; | ||
30 | using NUnit.Framework; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Region.Framework.Scenes; | ||
34 | using OpenSim.Tests.Common; | ||
35 | using PermissionMask = OpenSim.Framework.PermissionMask; | ||
36 | |||
37 | namespace OpenSim.Tests.Permissions | ||
38 | { | ||
39 | /// <summary> | ||
40 | /// Basic scene object tests (create, read and delete but not update). | ||
41 | /// </summary> | ||
42 | [TestFixture] | ||
43 | public class IndirectTransferTests | ||
44 | { | ||
45 | |||
46 | [SetUp] | ||
47 | public void SetUp() | ||
48 | { | ||
49 | // In case we're dealing with some older version of nunit | ||
50 | if (Common.TheInstance == null) | ||
51 | { | ||
52 | Common.TheInstance = new Common(); | ||
53 | Common.TheInstance.SetUp(); | ||
54 | } | ||
55 | Common.TheInstance.DeleteObjectsFolders(); | ||
56 | } | ||
57 | |||
58 | /// <summary> | ||
59 | /// Test giving simple objecta with various combinations of next owner perms. | ||
60 | /// </summary> | ||
61 | [Test] | ||
62 | public void SimpleTakeCopy() | ||
63 | { | ||
64 | TestHelpers.InMethod(); | ||
65 | |||
66 | // The Objects folder of A2 | ||
67 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[1].UUID, "Objects"); | ||
68 | |||
69 | // C, CT, MC, MCT, MT, T | ||
70 | string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T" }; | ||
71 | PermissionMask[] perms = new PermissionMask[6] { | ||
72 | PermissionMask.Copy, | ||
73 | PermissionMask.Copy | PermissionMask.Transfer, | ||
74 | PermissionMask.Modify | PermissionMask.Copy, | ||
75 | PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer, | ||
76 | PermissionMask.Modify | PermissionMask.Transfer, | ||
77 | PermissionMask.Transfer | ||
78 | }; | ||
79 | |||
80 | // Try A2 takes copies of objects that cannot be copied. | ||
81 | for (int i = 0; i < 6; i++) | ||
82 | TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); | ||
83 | // Ad-hoc. Enough time to let the take work. | ||
84 | Thread.Sleep(5000); | ||
85 | |||
86 | List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); | ||
87 | Assert.That(items.Count, Is.EqualTo(0)); | ||
88 | |||
89 | // A1 makes the objects copyable | ||
90 | for (int i = 0; i < 6; i++) | ||
91 | MakeCopyable(Common.TheScene.GetSceneObjectGroups(), names[i]); | ||
92 | |||
93 | // Try A2 takes copies of objects that can be copied. | ||
94 | for (int i = 0; i < 6; i++) | ||
95 | TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); | ||
96 | // Ad-hoc. Enough time to let the take work. | ||
97 | Thread.Sleep(5000); | ||
98 | |||
99 | items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); | ||
100 | Assert.That(items.Count, Is.EqualTo(6)); | ||
101 | |||
102 | for (int i = 0; i < 6; i++) | ||
103 | { | ||
104 | InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", names[i]); | ||
105 | Assert.That(item, Is.Not.Null); | ||
106 | Common.TheInstance.AssertPermissions(perms[i], (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); | ||
107 | } | ||
108 | } | ||
109 | |||
110 | private void TakeOneBox(List<SceneObjectGroup> objs, string name, PermissionMask mask) | ||
111 | { | ||
112 | // Find the object inworld | ||
113 | SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID); | ||
114 | Assert.That(box, Is.Not.Null, name); | ||
115 | |||
116 | // A2's inventory (index 1) | ||
117 | Common.TheInstance.TakeCopyToInventory(1, box); | ||
118 | } | ||
119 | |||
120 | private void MakeCopyable(List<SceneObjectGroup> objs, string name) | ||
121 | { | ||
122 | SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID); | ||
123 | Assert.That(box, Is.Not.Null, name); | ||
124 | |||
125 | // field = 8 is Everyone | ||
126 | // set = 1 means add the permission; set = 0 means remove permission | ||
127 | Common.TheScene.HandleObjectPermissionsUpdate((IClientAPI)Common.TheAvatars[0].ClientView, Common.TheAvatars[0].UUID, | ||
128 | Common.TheAvatars[0].ControllingClient.SessionId, 8, box.LocalId, (uint)PermissionMask.Copy, 1); | ||
129 | Common.TheInstance.PrintPerms(box); | ||
130 | } | ||
131 | } | ||
132 | } \ No newline at end of file | ||
diff --git a/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs b/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs index 671aca7..1549851 100644 --- a/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs +++ b/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs | |||
@@ -95,7 +95,7 @@ namespace Robust.Tests | |||
95 | Assert.AreNotEqual(regions, null, "GetRegionsByName failed"); | 95 | Assert.AreNotEqual(regions, null, "GetRegionsByName failed"); |
96 | Assert.AreEqual(regions.Count, 3, "GetRegionsByName should return 3"); | 96 | Assert.AreEqual(regions.Count, 3, "GetRegionsByName should return 3"); |
97 | 97 | ||
98 | regions = m_Connector.GetRegionRange(UUID.Zero, | 98 | regions = m_Connector.GetRegionRange(UUID.Zero, |
99 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), | 99 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), |
100 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); | 100 | (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); |
101 | Assert.AreNotEqual(regions, null, "GetRegionRange failed"); | 101 | Assert.AreNotEqual(regions, null, "GetRegionRange failed"); |
@@ -126,7 +126,7 @@ namespace Robust.Tests | |||
126 | region.ExternalHostName = "127.0.0.1"; | 126 | region.ExternalHostName = "127.0.0.1"; |
127 | region.HttpPort = 9000; | 127 | region.HttpPort = 9000; |
128 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); | 128 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); |
129 | 129 | ||
130 | return region; | 130 | return region; |
131 | } | 131 | } |
132 | } | 132 | } |
diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 0280b73..fe46a4f 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | |||
@@ -159,8 +159,7 @@ namespace Robust.Tests | |||
159 | XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); | 159 | XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); |
160 | 160 | ||
161 | // Prefetch Notecard 1, will be cached from here on | 161 | // Prefetch Notecard 1, will be cached from here on |
162 | InventoryItemBase item = new InventoryItemBase(new UUID("10000000-0000-0000-0000-000000000001"), m_userID); | 162 | InventoryItemBase item = m_Connector.GetItem(m_userID, new UUID("10000000-0000-0000-0000-000000000001")); |
163 | item = m_Connector.GetItem(item); | ||
164 | Assert.NotNull(item, "Failed to get Notecard 1"); | 163 | Assert.NotNull(item, "Failed to get Notecard 1"); |
165 | Assert.AreEqual("Test Notecard 1", item.Name, "Wrong name for Notecard 1"); | 164 | Assert.AreEqual("Test Notecard 1", item.Name, "Wrong name for Notecard 1"); |
166 | 165 | ||
@@ -177,7 +176,7 @@ namespace Robust.Tests | |||
177 | Assert.NotNull(items, "(Repeat) Failed to get multiple items"); | 176 | Assert.NotNull(items, "(Repeat) Failed to get multiple items"); |
178 | Assert.IsTrue(items.Length == 2, "(Repeat) Requested 2 items, but didn't receive 2 items"); | 177 | Assert.IsTrue(items.Length == 2, "(Repeat) Requested 2 items, but didn't receive 2 items"); |
179 | 178 | ||
180 | // This item doesn't exist, but [0] does, and it's cached. | 179 | // This item doesn't exist, but [0] does, and it's cached. |
181 | uuids[1] = new UUID("bb000000-0000-0000-0000-0000000000bb"); | 180 | uuids[1] = new UUID("bb000000-0000-0000-0000-0000000000bb"); |
182 | // Fetching should return 2 items, but [1] should be null | 181 | // Fetching should return 2 items, but [1] should be null |
183 | items = m_Connector.GetMultipleItems(m_userID, uuids); | 182 | items = m_Connector.GetMultipleItems(m_userID, uuids); |
@@ -186,7 +185,7 @@ namespace Robust.Tests | |||
186 | Assert.AreEqual("Test Notecard 1", items[0].Name, "(Three times) Wrong name for Notecard 1"); | 185 | Assert.AreEqual("Test Notecard 1", items[0].Name, "(Three times) Wrong name for Notecard 1"); |
187 | Assert.IsNull(items[1], "(Three times) Expecting 2nd item to be null"); | 186 | Assert.IsNull(items[1], "(Three times) Expecting 2nd item to be null"); |
188 | 187 | ||
189 | // Now both don't exist | 188 | // Now both don't exist |
190 | uuids[0] = new UUID("aa000000-0000-0000-0000-0000000000aa"); | 189 | uuids[0] = new UUID("aa000000-0000-0000-0000-0000000000aa"); |
191 | items = m_Connector.GetMultipleItems(m_userID, uuids); | 190 | items = m_Connector.GetMultipleItems(m_userID, uuids); |
192 | Assert.Null(items[0], "Request to multiple non-existent items is supposed to return null [0]"); | 191 | Assert.Null(items[0], "Request to multiple non-existent items is supposed to return null [0]"); |
diff --git a/OpenSim/Tests/Robust/Server/DemonServer.cs b/OpenSim/Tests/Robust/Server/DemonServer.cs index 205abfb..41c2185 100644 --- a/OpenSim/Tests/Robust/Server/DemonServer.cs +++ b/OpenSim/Tests/Robust/Server/DemonServer.cs | |||
@@ -48,8 +48,8 @@ namespace Robust.Tests | |||
48 | [SetUp] | 48 | [SetUp] |
49 | public void StartDemon() | 49 | public void StartDemon() |
50 | { | 50 | { |
51 | if (File.Exists("../logs/Robust.Tests.log")) | 51 | if (File.Exists("../../logs/Robust.Tests.log")) |
52 | File.Delete("../logs/Robust.Tests.log"); | 52 | File.Delete("../../logs/Robust.Tests.log"); |
53 | 53 | ||
54 | Console.WriteLine("**** Starting demon Robust server ****"); | 54 | Console.WriteLine("**** Starting demon Robust server ****"); |
55 | m_demon = new Thread( () => Main(new string[] {"-inifile=Robust.Tests.ini"})); | 55 | m_demon = new Thread( () => Main(new string[] {"-inifile=Robust.Tests.ini"})); |
diff --git a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs index 0ab407e..e9767f3 100644 --- a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs +++ b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs | |||
@@ -105,7 +105,7 @@ namespace OpenSim.Tests.Stress | |||
105 | public void Draw() | 105 | public void Draw() |
106 | { | 106 | { |
107 | SceneObjectGroup so = SceneHelpers.AddSceneObject(m_tests.Scene); | 107 | SceneObjectGroup so = SceneHelpers.AddSceneObject(m_tests.Scene); |
108 | 108 | ||
109 | while (Ready) | 109 | while (Ready) |
110 | { | 110 | { |
111 | UUID originalTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | 111 | UUID originalTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; |
@@ -118,9 +118,8 @@ namespace OpenSim.Tests.Stress | |||
118 | so.UUID, | 118 | so.UUID, |
119 | m_tests.Vrm.GetContentType(), | 119 | m_tests.Vrm.GetContentType(), |
120 | string.Format("PenColour BLACK; MoveTo 40,220; FontSize 32; Text {0};", text), | 120 | string.Format("PenColour BLACK; MoveTo 40,220; FontSize 32; Text {0};", text), |
121 | "", | 121 | ""); |
122 | 0); | 122 | |
123 | |||
124 | Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | 123 | Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); |
125 | 124 | ||
126 | Pass++; | 125 | Pass++; |