diff options
author | Justin Clark-Casey (justincc) | 2010-05-28 23:14:24 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-05-28 23:14:24 +0100 |
commit | 191db0e6a4327e8bf84350a541a9edc579ae1c54 (patch) | |
tree | e9d0c0354ccfabcb3ded539cb62a43bb2e503d3b /OpenSim/Tests | |
parent | restore InventoryArchiverTests.TestReplicateArchivePathToUserInventory() to w... (diff) | |
download | opensim-SC_OLD-191db0e6a4327e8bf84350a541a9edc579ae1c54.zip opensim-SC_OLD-191db0e6a4327e8bf84350a541a9edc579ae1c54.tar.gz opensim-SC_OLD-191db0e6a4327e8bf84350a541a9edc579ae1c54.tar.bz2 opensim-SC_OLD-191db0e6a4327e8bf84350a541a9edc579ae1c54.tar.xz |
get TestSaveIarV0_1() uncommented but not running as a test yet since I didn't get the authentication server to work and my brain is about to fizzle out my ears
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 28 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 13 |
2 files changed, 37 insertions, 4 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 91cf323..2756324 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -42,6 +42,7 @@ using OpenSim.Region.Framework.Scenes; | |||
42 | using OpenSim.Region.CoreModules.Agent.Capabilities; | 42 | using OpenSim.Region.CoreModules.Agent.Capabilities; |
43 | using OpenSim.Region.CoreModules.Avatar.Gods; | 43 | using OpenSim.Region.CoreModules.Avatar.Gods; |
44 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; | 44 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; |
45 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication; | ||
45 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; | 46 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; |
46 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; | 47 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; |
47 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; | 48 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; |
@@ -58,6 +59,7 @@ namespace OpenSim.Tests.Common.Setup | |||
58 | // These static variables in order to allow regions to be linked by shared modules and same | 59 | // These static variables in order to allow regions to be linked by shared modules and same |
59 | // CommunicationsManager. | 60 | // CommunicationsManager. |
60 | private static ISharedRegionModule m_assetService = null; | 61 | private static ISharedRegionModule m_assetService = null; |
62 | // private static ISharedRegionModule m_authenticationService = null; | ||
61 | private static ISharedRegionModule m_inventoryService = null; | 63 | private static ISharedRegionModule m_inventoryService = null; |
62 | private static ISharedRegionModule m_gridService = null; | 64 | private static ISharedRegionModule m_gridService = null; |
63 | private static ISharedRegionModule m_userAccountService = null; | 65 | private static ISharedRegionModule m_userAccountService = null; |
@@ -177,6 +179,9 @@ namespace OpenSim.Tests.Common.Setup | |||
177 | StartAssetService(testScene, true); | 179 | StartAssetService(testScene, true); |
178 | else | 180 | else |
179 | StartAssetService(testScene, false); | 181 | StartAssetService(testScene, false); |
182 | |||
183 | // For now, always started a 'real' authenication service | ||
184 | StartAuthenticationService(testScene, true); | ||
180 | 185 | ||
181 | if (realServices.Contains("inventory")) | 186 | if (realServices.Contains("inventory")) |
182 | StartInventoryService(testScene, true); | 187 | StartInventoryService(testScene, true); |
@@ -236,13 +241,34 @@ namespace OpenSim.Tests.Common.Setup | |||
236 | else | 241 | else |
237 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService"); | 242 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService"); |
238 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | 243 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); |
239 | assetService.Initialise(config); | 244 | assetService.Initialise(config); |
240 | assetService.AddRegion(testScene); | 245 | assetService.AddRegion(testScene); |
241 | assetService.RegionLoaded(testScene); | 246 | assetService.RegionLoaded(testScene); |
242 | testScene.AddRegionModule(assetService.Name, assetService); | 247 | testScene.AddRegionModule(assetService.Name, assetService); |
243 | m_assetService = assetService; | 248 | m_assetService = assetService; |
244 | } | 249 | } |
245 | 250 | ||
251 | private static void StartAuthenticationService(Scene testScene, bool real) | ||
252 | { | ||
253 | ISharedRegionModule service = new LocalAuthenticationServicesConnector(); | ||
254 | IConfigSource config = new IniConfigSource(); | ||
255 | config.AddConfig("Modules"); | ||
256 | config.AddConfig("AuthenticationService"); | ||
257 | config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector"); | ||
258 | if (real) | ||
259 | config.Configs["AuthenticationService"].Set( | ||
260 | "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"); | ||
261 | else | ||
262 | config.Configs["AuthenticationService"].Set( | ||
263 | "LocalServiceModule", "OpenSim.Tests.Common.dll:MockuthenticationService"); | ||
264 | config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); | ||
265 | service.Initialise(config); | ||
266 | service.AddRegion(testScene); | ||
267 | service.RegionLoaded(testScene); | ||
268 | testScene.AddRegionModule(service.Name, service); | ||
269 | //m_authenticationService = service; | ||
270 | } | ||
271 | |||
246 | private static void StartInventoryService(Scene testScene, bool real) | 272 | private static void StartInventoryService(Scene testScene, bool real) |
247 | { | 273 | { |
248 | ISharedRegionModule inventoryService = new LocalInventoryServicesConnector(); | 274 | ISharedRegionModule inventoryService = new LocalInventoryServicesConnector(); |
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index a6b9520..e6a7818 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | |||
@@ -117,12 +117,19 @@ namespace OpenSim.Tests.Common.Setup | |||
117 | 117 | ||
118 | public static UserAccount CreateUserWithInventory(Scene scene) | 118 | public static UserAccount CreateUserWithInventory(Scene scene) |
119 | { | 119 | { |
120 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); | 120 | return CreateUserWithInventory( |
121 | UserAccount ua = new UserAccount(userId) { FirstName = "Bill", LastName = "Bailey" }; | 121 | scene, "Bill", "Bailey", UUID.Parse("00000000-0000-0000-0000-000000000099"), "troll"); |
122 | } | ||
123 | |||
124 | public static UserAccount CreateUserWithInventory( | ||
125 | Scene scene, string firstName, string lastName, UUID userId, string pw) | ||
126 | { | ||
127 | UserAccount ua = new UserAccount(userId) { FirstName = firstName, LastName = lastName }; | ||
122 | scene.UserAccountService.StoreUserAccount(ua); | 128 | scene.UserAccountService.StoreUserAccount(ua); |
123 | scene.InventoryService.CreateUserInventory(ua.PrincipalID); | 129 | scene.InventoryService.CreateUserInventory(ua.PrincipalID); |
130 | scene.AuthenticationService.SetPassword(ua.PrincipalID, pw); | ||
124 | 131 | ||
125 | return ua; | 132 | return ua; |
126 | } | 133 | } |
127 | } | 134 | } |
128 | } \ No newline at end of file | 135 | } \ No newline at end of file |