aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
diff options
context:
space:
mode:
authorArthur Valadares2009-08-11 12:07:54 -0300
committerArthur Valadares2009-08-11 12:07:54 -0300
commit18aa2ea0c5ebd8d5131902ed9856e68f46e76e11 (patch)
treec4adcda365c46052c3d15b4e6395e1bb8a2e97c5 /OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
parentReplace the Replaceable modules name (diff)
downloadopensim-SC-18aa2ea0c5ebd8d5131902ed9856e68f46e76e11.zip
opensim-SC-18aa2ea0c5ebd8d5131902ed9856e68f46e76e11.tar.gz
opensim-SC-18aa2ea0c5ebd8d5131902ed9856e68f46e76e11.tar.bz2
opensim-SC-18aa2ea0c5ebd8d5131902ed9856e68f46e76e11.tar.xz
* Improves SceneSetupHelper to allow the tester to choose a real or mock, inventory and asset, service modules. The boolean startServices was replaced with realServices string. If the string contains the word asset, it will start a real asset module, if it contains inventory, it starts a real inventory. Otherwise, it use mock (NullPlugin-like) objects, for tests that don't really need functionality.
* SetupScene is now actually sharing the asset and inventory modules if the tester wishes to have multiple regions connected. To link regions, just start SetupScene with the same CommunicationManager for all scenes. SceneSetupHelper will hold a static reference to the modules and won't initialize them again, just run the scenes through the modules AddRegion, RegionLoaded and PostInitialize. * With the recent changes, both asset and inventory (and in the future, user) services should always be asked from the scene, not instantiated alone. The tests should reflect this new behavior and always start a scene.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index fdc20dd..0402883 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -54,6 +54,7 @@ namespace OpenSim.Framework.Communications.Tests
54 CachedUserInfo nonExistingUserInfo; 54 CachedUserInfo nonExistingUserInfo;
55 55
56 TestCommunicationsManager commsManager = new TestCommunicationsManager(); 56 TestCommunicationsManager commsManager = new TestCommunicationsManager();
57 Scene myScene = SceneSetupHelpers.SetupScene(commsManager, "");
57 58
58 // Check we can't retrieve info before it exists by uuid 59 // Check we can't retrieve info before it exists by uuid
59 nonExistingUserInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); 60 nonExistingUserInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
@@ -116,7 +117,7 @@ namespace OpenSim.Framework.Communications.Tests
116 { 117 {
117 TestHelper.InMethod(); 118 TestHelper.InMethod();
118 119
119 Scene myScene = SceneSetupHelpers.SetupScene(); 120 Scene myScene = SceneSetupHelpers.SetupScene("inventory");
120 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager); 121 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager);
121 for (int i = 0 ; i < 50 ; i++) 122 for (int i = 0 ; i < 50 ; i++)
122 { 123 {
@@ -132,7 +133,7 @@ namespace OpenSim.Framework.Communications.Tests
132 { 133 {
133 TestHelper.InMethod(); 134 TestHelper.InMethod();
134 135
135 Scene myScene = SceneSetupHelpers.SetupScene(); 136 Scene myScene = SceneSetupHelpers.SetupScene("inventory");
136 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager); 137 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager);
137 for (int i = 0 ; i < 50 ; i++) 138 for (int i = 0 ; i < 50 ; i++)
138 { 139 {
@@ -154,7 +155,7 @@ namespace OpenSim.Framework.Communications.Tests
154 { 155 {
155 TestHelper.InMethod(); 156 TestHelper.InMethod();
156 157
157 Scene myScene = SceneSetupHelpers.SetupScene(); 158 Scene myScene = SceneSetupHelpers.SetupScene("inventory");
158 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager); 159 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager);
159 for (int i = 0 ; i < 50 ; i++) 160 for (int i = 0 ; i < 50 ; i++)
160 { 161 {
@@ -190,7 +191,7 @@ namespace OpenSim.Framework.Communications.Tests
190 { 191 {
191 TestHelper.InMethod(); 192 TestHelper.InMethod();
192 193
193 Scene myScene = SceneSetupHelpers.SetupScene(); 194 Scene myScene = SceneSetupHelpers.SetupScene("inventory");
194 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager); 195 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager);
195 for (int i = 0 ; i < 50 ; i++) 196 for (int i = 0 ; i < 50 ; i++)
196 { 197 {
@@ -256,7 +257,7 @@ namespace OpenSim.Framework.Communications.Tests
256 { 257 {
257 TestHelper.InMethod(); 258 TestHelper.InMethod();
258 259
259 Scene myScene = SceneSetupHelpers.SetupScene(); 260 Scene myScene = SceneSetupHelpers.SetupScene("inventory");
260 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager); 261 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager);
261 for (int i = 0 ; i < 50 ; i++) 262 for (int i = 0 ; i < 50 ; i++)
262 { 263 {
@@ -297,7 +298,7 @@ namespace OpenSim.Framework.Communications.Tests
297 TestHelper.InMethod(); 298 TestHelper.InMethod();
298 //log4net.Config.XmlConfigurator.Configure(); 299 //log4net.Config.XmlConfigurator.Configure();
299 300
300 Scene myScene = SceneSetupHelpers.SetupScene(); 301 Scene myScene = SceneSetupHelpers.SetupScene("inventory");
301 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager); 302 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager);
302 for (int i = 0 ; i < 50 ; i++) 303 for (int i = 0 ; i < 50 ; i++)
303 { 304 {