diff options
author | Sean McNamara | 2011-04-23 18:33:08 -0400 |
---|---|---|
committer | Sean McNamara | 2011-04-23 18:33:08 -0400 |
commit | d287e0ac683acb0cab51bf0dbbc9d1fd08bd6bc9 (patch) | |
tree | 30a24bf66050c66ebe74b68745c4f1764fe09181 /OpenSim/Tests/Common | |
parent | AutoBackup: Removed unneeded imports. (diff) | |
parent | Added MaxAgents configuration option to RegionConfig.ini allowing region host... (diff) | |
download | opensim-SC-d287e0ac683acb0cab51bf0dbbc9d1fd08bd6bc9.zip opensim-SC-d287e0ac683acb0cab51bf0dbbc9d1fd08bd6bc9.tar.gz opensim-SC-d287e0ac683acb0cab51bf0dbbc9d1fd08bd6bc9.tar.bz2 opensim-SC-d287e0ac683acb0cab51bf0dbbc9d1fd08bd6bc9.tar.xz |
Merge git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Tests/Common')
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockAssetService.cs | 109 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockInventoryService.cs | 186 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 11 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Setup/AssetHelpers.cs | 38 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 98 |
5 files changed, 65 insertions, 377 deletions
diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs deleted file mode 100644 index 4118308..0000000 --- a/OpenSim/Tests/Common/Mock/MockAssetService.cs +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
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.Reflection; | ||
31 | using log4net; | ||
32 | using OpenMetaverse; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Data; | ||
35 | using OpenSim.Services.Interfaces; | ||
36 | using Nini.Config; | ||
37 | |||
38 | namespace OpenSim.Tests.Common.Mock | ||
39 | { | ||
40 | public class MockAssetService : IAssetService | ||
41 | { | ||
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
44 | private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>(); | ||
45 | |||
46 | public MockAssetService() {} | ||
47 | |||
48 | /// <summary> | ||
49 | /// This constructor is required if the asset service is being created reflectively (which is the case in some | ||
50 | /// tests). | ||
51 | /// </summary> | ||
52 | /// <param name="config"></param> | ||
53 | public MockAssetService(IConfigSource config) {} | ||
54 | |||
55 | public AssetBase Get(string id) | ||
56 | { | ||
57 | m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); | ||
58 | |||
59 | AssetBase asset; | ||
60 | if (Assets.ContainsKey(id)) | ||
61 | asset = Assets[id]; | ||
62 | else | ||
63 | asset = null; | ||
64 | |||
65 | return asset; | ||
66 | } | ||
67 | |||
68 | public AssetBase GetCached(string id) | ||
69 | { | ||
70 | return Get(id); | ||
71 | } | ||
72 | |||
73 | public AssetMetadata GetMetadata(string id) | ||
74 | { | ||
75 | throw new System.NotImplementedException(); | ||
76 | } | ||
77 | |||
78 | public byte[] GetData(string id) | ||
79 | { | ||
80 | throw new System.NotImplementedException(); | ||
81 | } | ||
82 | |||
83 | public bool Get(string id, object sender, AssetRetrieved handler) | ||
84 | { | ||
85 | handler(id, sender, Get(id)); | ||
86 | |||
87 | return true; | ||
88 | } | ||
89 | |||
90 | public string Store(AssetBase asset) | ||
91 | { | ||
92 | m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID); | ||
93 | |||
94 | Assets[asset.ID] = asset; | ||
95 | |||
96 | return asset.ID; | ||
97 | } | ||
98 | |||
99 | public bool UpdateContent(string id, byte[] data) | ||
100 | { | ||
101 | throw new System.NotImplementedException(); | ||
102 | } | ||
103 | |||
104 | public bool Delete(string id) | ||
105 | { | ||
106 | throw new System.NotImplementedException(); | ||
107 | } | ||
108 | } | ||
109 | } \ No newline at end of file | ||
diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs deleted file mode 100644 index 4ac1078..0000000 --- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs +++ /dev/null | |||
@@ -1,186 +0,0 @@ | |||
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 OpenSim.Framework; | ||
32 | using OpenMetaverse; | ||
33 | using OpenSim.Services.Interfaces; | ||
34 | using Nini.Config; | ||
35 | |||
36 | namespace OpenSim.Tests.Common.Mock | ||
37 | { | ||
38 | public class MockInventoryService : IInventoryService | ||
39 | { | ||
40 | public MockInventoryService() {} | ||
41 | |||
42 | public MockInventoryService(IConfigSource config) {} | ||
43 | |||
44 | /// <summary> | ||
45 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | ||
46 | /// </summary> | ||
47 | /// <param name="userId"></param> | ||
48 | /// <returns></returns> | ||
49 | public bool CreateUserInventory(UUID userId) | ||
50 | { | ||
51 | return false; | ||
52 | } | ||
53 | |||
54 | /// <summary> | ||
55 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | ||
56 | /// </summary> | ||
57 | /// <param name="userId"></param> | ||
58 | /// <returns></returns> | ||
59 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | ||
60 | { | ||
61 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | ||
62 | InventoryFolderBase folder = new InventoryFolderBase(); | ||
63 | folder.ID = UUID.Random(); | ||
64 | folder.Owner = userId; | ||
65 | folders.Add(folder); | ||
66 | return folders; | ||
67 | } | ||
68 | |||
69 | public InventoryFolderBase GetRootFolder(UUID userID) | ||
70 | { | ||
71 | return new InventoryFolderBase(); | ||
72 | } | ||
73 | |||
74 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | ||
75 | { | ||
76 | return null; | ||
77 | } | ||
78 | |||
79 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | ||
80 | { | ||
81 | return null; | ||
82 | } | ||
83 | |||
84 | /// <summary> | ||
85 | /// Returns a list of all the active gestures in a user's inventory. | ||
86 | /// </summary> | ||
87 | /// <param name="userId"> | ||
88 | /// The <see cref="UUID"/> of the user | ||
89 | /// </param> | ||
90 | /// <returns> | ||
91 | /// A flat list of the gesture items. | ||
92 | /// </returns> | ||
93 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | ||
94 | { | ||
95 | return null; | ||
96 | } | ||
97 | |||
98 | public InventoryCollection GetUserInventory(UUID userID) | ||
99 | { | ||
100 | return null; | ||
101 | } | ||
102 | |||
103 | public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback) | ||
104 | { | ||
105 | } | ||
106 | |||
107 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | ||
108 | { | ||
109 | return null; | ||
110 | } | ||
111 | |||
112 | public bool AddFolder(InventoryFolderBase folder) | ||
113 | { | ||
114 | return false; | ||
115 | } | ||
116 | |||
117 | public bool UpdateFolder(InventoryFolderBase folder) | ||
118 | { | ||
119 | return false; | ||
120 | } | ||
121 | |||
122 | public bool MoveFolder(InventoryFolderBase folder) | ||
123 | { | ||
124 | return false; | ||
125 | } | ||
126 | |||
127 | public bool DeleteFolders(UUID ownerID, List<UUID> ids) | ||
128 | { | ||
129 | return false; | ||
130 | } | ||
131 | |||
132 | public bool PurgeFolder(InventoryFolderBase folder) | ||
133 | { | ||
134 | return false; | ||
135 | } | ||
136 | |||
137 | public bool AddItem(InventoryItemBase item) | ||
138 | { | ||
139 | return true; | ||
140 | } | ||
141 | |||
142 | public bool UpdateItem(InventoryItemBase item) | ||
143 | { | ||
144 | return false; | ||
145 | } | ||
146 | |||
147 | public bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
148 | { | ||
149 | return false; | ||
150 | } | ||
151 | |||
152 | public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | ||
153 | { | ||
154 | return false; | ||
155 | } | ||
156 | |||
157 | public InventoryItemBase GetItem(InventoryItemBase item) | ||
158 | { | ||
159 | return null; | ||
160 | } | ||
161 | |||
162 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | ||
163 | { | ||
164 | return null; | ||
165 | } | ||
166 | |||
167 | public bool HasInventoryForUser(UUID userID) | ||
168 | { | ||
169 | return false; | ||
170 | } | ||
171 | |||
172 | public InventoryFolderBase RequestRootFolder(UUID userID) | ||
173 | { | ||
174 | InventoryFolderBase root = new InventoryFolderBase(); | ||
175 | root.ID = UUID.Random(); | ||
176 | root.Owner = userID; | ||
177 | root.ParentID = UUID.Zero; | ||
178 | return root; | ||
179 | } | ||
180 | |||
181 | public int GetAssetPermissions(UUID userID, UUID assetID) | ||
182 | { | ||
183 | return 1; | ||
184 | } | ||
185 | } | ||
186 | } \ No newline at end of file | ||
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d1dc17f..dca5626 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -816,18 +816,11 @@ namespace OpenSim.Tests.Common.Mock | |||
816 | { | 816 | { |
817 | } | 817 | } |
818 | 818 | ||
819 | public void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID, | 819 | public void SendObjectPropertiesFamilyData(ISceneEntity Entity, uint RequestFlags) |
820 | uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, | ||
821 | uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category, | ||
822 | UUID LastOwnerID, string ObjectName, string Description) | ||
823 | { | 820 | { |
824 | } | 821 | } |
825 | 822 | ||
826 | public void SendObjectPropertiesReply(UUID ItemID, ulong CreationDate, UUID CreatorUUID, UUID FolderUUID, UUID FromTaskUUID, | 823 | public void SendObjectPropertiesReply(ISceneEntity entity) |
827 | UUID GroupUUID, short InventorySerial, UUID LastOwnerUUID, UUID ObjectUUID, | ||
828 | UUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, | ||
829 | string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, | ||
830 | uint BaseMask, byte saleType, int salePrice) | ||
831 | { | 824 | { |
832 | } | 825 | } |
833 | 826 | ||
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs index ff4423f..d572249 100644 --- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs | |||
@@ -30,6 +30,7 @@ using OpenMetaverse; | |||
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Framework.Scenes; | 31 | using OpenSim.Region.Framework.Scenes; |
32 | using OpenSim.Region.Framework.Scenes.Serialization; | 32 | using OpenSim.Region.Framework.Scenes.Serialization; |
33 | using OpenSim.Services.Interfaces; | ||
33 | 34 | ||
34 | namespace OpenSim.Tests.Common | 35 | namespace OpenSim.Tests.Common |
35 | { | 36 | { |
@@ -55,7 +56,7 @@ namespace OpenSim.Tests.Common | |||
55 | AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); | 56 | AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); |
56 | scene.AssetService.Store(asset); | 57 | scene.AssetService.Store(asset); |
57 | return asset; | 58 | return asset; |
58 | } | 59 | } |
59 | 60 | ||
60 | /// <summary> | 61 | /// <summary> |
61 | /// Create an asset from the given scene object. | 62 | /// Create an asset from the given scene object. |
@@ -71,6 +72,35 @@ namespace OpenSim.Tests.Common | |||
71 | Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)), | 72 | Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)), |
72 | sog.OwnerID); | 73 | sog.OwnerID); |
73 | } | 74 | } |
75 | |||
76 | /// <summary> | ||
77 | /// Create an asset from the given scene object. | ||
78 | /// </summary> | ||
79 | /// <param name="assetUuidTailZ"> | ||
80 | /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}" | ||
81 | /// will be used. | ||
82 | /// </param> | ||
83 | /// <param name="coa"></param> | ||
84 | /// <returns></returns> | ||
85 | public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa) | ||
86 | { | ||
87 | return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa); | ||
88 | } | ||
89 | |||
90 | /// <summary> | ||
91 | /// Create an asset from the given scene object. | ||
92 | /// </summary> | ||
93 | /// <param name="assetUuid"></param> | ||
94 | /// <param name="coa"></param> | ||
95 | /// <returns></returns> | ||
96 | public static AssetBase CreateAsset(UUID assetUuid, CoalescedSceneObjects coa) | ||
97 | { | ||
98 | return CreateAsset( | ||
99 | assetUuid, | ||
100 | AssetType.Object, | ||
101 | Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)), | ||
102 | coa.CreatorId); | ||
103 | } | ||
74 | 104 | ||
75 | /// <summary> | 105 | /// <summary> |
76 | /// Create an asset from the given data. | 106 | /// Create an asset from the given data. |
@@ -89,5 +119,11 @@ namespace OpenSim.Tests.Common | |||
89 | asset.Data = data; | 119 | asset.Data = data; |
90 | return asset; | 120 | return asset; |
91 | } | 121 | } |
122 | |||
123 | public static string ReadAssetAsString(IAssetService assetService, UUID uuid) | ||
124 | { | ||
125 | byte[] assetData = assetService.GetData(uuid.ToString()); | ||
126 | return Encoding.ASCII.GetString(assetData); | ||
127 | } | ||
92 | } | 128 | } |
93 | } | 129 | } |
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 709dd78..99517d2 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -66,32 +66,7 @@ namespace OpenSim.Tests.Common.Setup | |||
66 | /// <returns></returns> | 66 | /// <returns></returns> |
67 | public static TestScene SetupScene() | 67 | public static TestScene SetupScene() |
68 | { | 68 | { |
69 | return SetupScene(""); | 69 | return SetupScene("Unit test region", UUID.Random(), 1000, 1000); |
70 | } | ||
71 | |||
72 | /// <summary> | ||
73 | /// Set up a test scene | ||
74 | /// </summary> | ||
75 | /// | ||
76 | /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param> | ||
77 | /// <returns></returns> | ||
78 | public static TestScene SetupScene(String realServices) | ||
79 | { | ||
80 | return SetupScene("Unit test region", UUID.Random(), 1000, 1000, realServices); | ||
81 | } | ||
82 | |||
83 | /// <summary> | ||
84 | /// Set up a test scene | ||
85 | /// </summary> | ||
86 | /// <param name="name">Name of the region</param> | ||
87 | /// <param name="id">ID of the region</param> | ||
88 | /// <param name="x">X co-ordinate of the region</param> | ||
89 | /// <param name="y">Y co-ordinate of the region</param> | ||
90 | /// <param name="cm">This should be the same if simulating two scenes within a standalone</param> | ||
91 | /// <returns></returns> | ||
92 | public static TestScene SetupScene(string name, UUID id, uint x, uint y) | ||
93 | { | ||
94 | return SetupScene(name, id, x, y, ""); | ||
95 | } | 70 | } |
96 | 71 | ||
97 | /// <summary> | 72 | /// <summary> |
@@ -103,10 +78,8 @@ namespace OpenSim.Tests.Common.Setup | |||
103 | /// <param name="x">X co-ordinate of the region</param> | 78 | /// <param name="x">X co-ordinate of the region</param> |
104 | /// <param name="y">Y co-ordinate of the region</param> | 79 | /// <param name="y">Y co-ordinate of the region</param> |
105 | /// <param name="cm">This should be the same if simulating two scenes within a standalone</param> | 80 | /// <param name="cm">This should be the same if simulating two scenes within a standalone</param> |
106 | /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param> | ||
107 | /// <returns></returns> | 81 | /// <returns></returns> |
108 | public static TestScene SetupScene( | 82 | public static TestScene SetupScene(string name, UUID id, uint x, uint y) |
109 | string name, UUID id, uint x, uint y, String realServices) | ||
110 | { | 83 | { |
111 | Console.WriteLine("Setting up test scene {0}", name); | 84 | Console.WriteLine("Setting up test scene {0}", name); |
112 | 85 | ||
@@ -130,15 +103,11 @@ namespace OpenSim.Tests.Common.Setup | |||
130 | IRegionModule godsModule = new GodsModule(); | 103 | IRegionModule godsModule = new GodsModule(); |
131 | godsModule.Initialise(testScene, new IniConfigSource()); | 104 | godsModule.Initialise(testScene, new IniConfigSource()); |
132 | testScene.AddModule(godsModule.Name, godsModule); | 105 | testScene.AddModule(godsModule.Name, godsModule); |
133 | realServices = realServices.ToLower(); | ||
134 | |||
135 | LocalAssetServicesConnector assetService = StartAssetService(testScene, realServices.Contains("asset")); | ||
136 | |||
137 | // For now, always started a 'real' authentication service | ||
138 | StartAuthenticationService(testScene, true); | ||
139 | 106 | ||
140 | LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene, realServices.Contains("inventory")); | 107 | LocalAssetServicesConnector assetService = StartAssetService(testScene); |
141 | StartGridService(testScene, true); | 108 | StartAuthenticationService(testScene); |
109 | LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene); | ||
110 | StartGridService(testScene); | ||
142 | LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); | 111 | LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); |
143 | LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); | 112 | LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); |
144 | 113 | ||
@@ -164,18 +133,17 @@ namespace OpenSim.Tests.Common.Setup | |||
164 | return testScene; | 133 | return testScene; |
165 | } | 134 | } |
166 | 135 | ||
167 | private static LocalAssetServicesConnector StartAssetService(Scene testScene, bool real) | 136 | private static LocalAssetServicesConnector StartAssetService(Scene testScene) |
168 | { | 137 | { |
169 | LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); | 138 | LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); |
170 | IConfigSource config = new IniConfigSource(); | 139 | IConfigSource config = new IniConfigSource(); |
171 | config.AddConfig("Modules"); | 140 | |
141 | config.AddConfig("Modules"); | ||
142 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); | ||
172 | config.AddConfig("AssetService"); | 143 | config.AddConfig("AssetService"); |
173 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); | 144 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); |
174 | if (real) | ||
175 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); | ||
176 | else | ||
177 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService"); | ||
178 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | 145 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); |
146 | |||
179 | assetService.Initialise(config); | 147 | assetService.Initialise(config); |
180 | assetService.AddRegion(testScene); | 148 | assetService.AddRegion(testScene); |
181 | assetService.RegionLoaded(testScene); | 149 | assetService.RegionLoaded(testScene); |
@@ -184,20 +152,18 @@ namespace OpenSim.Tests.Common.Setup | |||
184 | return assetService; | 152 | return assetService; |
185 | } | 153 | } |
186 | 154 | ||
187 | private static void StartAuthenticationService(Scene testScene, bool real) | 155 | private static void StartAuthenticationService(Scene testScene) |
188 | { | 156 | { |
189 | ISharedRegionModule service = new LocalAuthenticationServicesConnector(); | 157 | ISharedRegionModule service = new LocalAuthenticationServicesConnector(); |
190 | IConfigSource config = new IniConfigSource(); | 158 | IConfigSource config = new IniConfigSource(); |
159 | |||
191 | config.AddConfig("Modules"); | 160 | config.AddConfig("Modules"); |
192 | config.AddConfig("AuthenticationService"); | 161 | config.AddConfig("AuthenticationService"); |
193 | config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector"); | 162 | config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector"); |
194 | if (real) | 163 | config.Configs["AuthenticationService"].Set( |
195 | config.Configs["AuthenticationService"].Set( | 164 | "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"); |
196 | "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"); | ||
197 | else | ||
198 | config.Configs["AuthenticationService"].Set( | ||
199 | "LocalServiceModule", "OpenSim.Tests.Common.dll:MockAuthenticationService"); | ||
200 | config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); | 165 | config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); |
166 | |||
201 | service.Initialise(config); | 167 | service.Initialise(config); |
202 | service.AddRegion(testScene); | 168 | service.AddRegion(testScene); |
203 | service.RegionLoaded(testScene); | 169 | service.RegionLoaded(testScene); |
@@ -205,24 +171,17 @@ namespace OpenSim.Tests.Common.Setup | |||
205 | //m_authenticationService = service; | 171 | //m_authenticationService = service; |
206 | } | 172 | } |
207 | 173 | ||
208 | private static LocalInventoryServicesConnector StartInventoryService(Scene testScene, bool real) | 174 | private static LocalInventoryServicesConnector StartInventoryService(Scene testScene) |
209 | { | 175 | { |
210 | LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); | 176 | LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); |
211 | IConfigSource config = new IniConfigSource(); | 177 | |
178 | IConfigSource config = new IniConfigSource(); | ||
212 | config.AddConfig("Modules"); | 179 | config.AddConfig("Modules"); |
213 | config.AddConfig("InventoryService"); | 180 | config.AddConfig("InventoryService"); |
214 | config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); | 181 | config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); |
215 | 182 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); | |
216 | if (real) | ||
217 | { | ||
218 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); | ||
219 | } | ||
220 | else | ||
221 | { | ||
222 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService"); | ||
223 | } | ||
224 | |||
225 | config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | 183 | config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); |
184 | |||
226 | inventoryService.Initialise(config); | 185 | inventoryService.Initialise(config); |
227 | inventoryService.AddRegion(testScene); | 186 | inventoryService.AddRegion(testScene); |
228 | inventoryService.RegionLoaded(testScene); | 187 | inventoryService.RegionLoaded(testScene); |
@@ -231,24 +190,19 @@ namespace OpenSim.Tests.Common.Setup | |||
231 | return inventoryService; | 190 | return inventoryService; |
232 | } | 191 | } |
233 | 192 | ||
234 | private static LocalGridServicesConnector StartGridService(Scene testScene, bool real) | 193 | private static LocalGridServicesConnector StartGridService(Scene testScene) |
235 | { | 194 | { |
236 | IConfigSource config = new IniConfigSource(); | 195 | IConfigSource config = new IniConfigSource(); |
237 | config.AddConfig("Modules"); | 196 | config.AddConfig("Modules"); |
238 | config.AddConfig("GridService"); | 197 | config.AddConfig("GridService"); |
239 | config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); | 198 | config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); |
240 | config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); | 199 | config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); |
241 | if (real) | 200 | config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); |
242 | config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); | ||
243 | 201 | ||
244 | LocalGridServicesConnector gridService = new LocalGridServicesConnector(); | 202 | LocalGridServicesConnector gridService = new LocalGridServicesConnector(); |
245 | gridService.Initialise(config); | 203 | gridService.Initialise(config); |
246 | |||
247 | //else | ||
248 | // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService"); | ||
249 | gridService.AddRegion(testScene); | 204 | gridService.AddRegion(testScene); |
250 | gridService.RegionLoaded(testScene); | 205 | gridService.RegionLoaded(testScene); |
251 | //testScene.AddRegionModule(m_gridService.Name, m_gridService); | ||
252 | 206 | ||
253 | return gridService; | 207 | return gridService; |
254 | } | 208 | } |
@@ -472,10 +426,10 @@ namespace OpenSim.Tests.Common.Setup | |||
472 | /// <param name="ownerId"></param> | 426 | /// <param name="ownerId"></param> |
473 | /// <returns></returns> | 427 | /// <returns></returns> |
474 | public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) | 428 | public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) |
475 | { | 429 | { |
476 | return new SceneObjectPart( | 430 | return new SceneObjectPart( |
477 | ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 431 | ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
478 | { Name = name, UUID = id }; | 432 | { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; |
479 | } | 433 | } |
480 | 434 | ||
481 | /// <summary> | 435 | /// <summary> |