aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-11-12 18:44:03 +0000
committerJustin Clark-Casey (justincc)2009-11-12 18:44:03 +0000
commit2f092d271e80dbc7af47671fbb946de75b6110a9 (patch)
treeb9add763319af6a907863139506892b150009792 /OpenSim
parentminor: for now stop iar tests spewing log messages when running testsuite (diff)
downloadopensim-SC_OLD-2f092d271e80dbc7af47671fbb946de75b6110a9.zip
opensim-SC_OLD-2f092d271e80dbc7af47671fbb946de75b6110a9.tar.gz
opensim-SC_OLD-2f092d271e80dbc7af47671fbb946de75b6110a9.tar.bz2
opensim-SC_OLD-2f092d271e80dbc7af47671fbb946de75b6110a9.tar.xz
Rename test services to mock services, since this is a more accurate description
remove duplicate mock inventory service
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/Tests/LoginServiceTests.cs151
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/MockAssetService.cs (renamed from OpenSim/Tests/Common/Mock/TestAssetService.cs)6
-rw-r--r--OpenSim/Tests/Common/Mock/MockInventoryService.cs (renamed from OpenSim/Tests/Common/Mock/TestInventoryService.cs)6
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs4
5 files changed, 13 insertions, 156 deletions
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
index e891d9c..60f0ba8 100644
--- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Framework.Communications.Tests
75 75
76 m_regionConnector.AddRegion(new RegionInfo(42, 43, m_capsEndPoint, m_regionExternalName)); 76 m_regionConnector.AddRegion(new RegionInfo(42, 43, m_capsEndPoint, m_regionExternalName));
77 77
78 //IInventoryService m_inventoryService = new TestInventoryService(); 78 //IInventoryService m_inventoryService = new MockInventoryService();
79 79
80 m_localUserServices = (LocalUserServices) m_commsManager.UserService; 80 m_localUserServices = (LocalUserServices) m_commsManager.UserService;
81 m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","abc@ftw.com",42,43); 81 m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","abc@ftw.com",42,43);
@@ -95,7 +95,8 @@ namespace OpenSim.Framework.Communications.Tests
95 TestHelper.InMethod(); 95 TestHelper.InMethod();
96 // We want to use our own LoginService for this test, one that 96 // We want to use our own LoginService for this test, one that
97 // doesn't require authentication. 97 // doesn't require authentication.
98 new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(), 98 new LLStandaloneLoginService(
99 (UserManagerBase)m_commsManager.UserService, "Hello folks", new MockInventoryService(),
99 m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector); 100 m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector);
100 101
101 Hashtable loginParams = new Hashtable(); 102 Hashtable loginParams = new Hashtable();
@@ -457,148 +458,4 @@ namespace OpenSim.Framework.Communications.Tests
457 #endregion 458 #endregion
458 } 459 }
459 } 460 }
460 461} \ No newline at end of file
461 class TestInventoryService : IInventoryService
462 {
463 public TestInventoryService()
464 {
465 }
466
467 /// <summary>
468 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
469 /// </summary>
470 /// <param name="userId"></param>
471 /// <returns></returns>
472 public bool CreateUserInventory(UUID userId)
473 {
474 return false;
475 }
476
477 /// <summary>
478 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
479 /// </summary>
480 /// <param name="userId"></param>
481 /// <returns></returns>
482 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
483 {
484 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
485 InventoryFolderBase folder = new InventoryFolderBase();
486 folder.ID = UUID.Random();
487 folder.Owner = userId;
488 folders.Add(folder);
489 return folders;
490 }
491
492 /// <summary>
493 /// Returns a list of all the active gestures in a user's inventory.
494 /// </summary>
495 /// <param name="userId">
496 /// The <see cref="UUID"/> of the user
497 /// </param>
498 /// <returns>
499 /// A flat list of the gesture items.
500 /// </returns>
501 public List<InventoryItemBase> GetActiveGestures(UUID userId)
502 {
503 return null;
504 }
505
506 public InventoryCollection GetUserInventory(UUID userID)
507 {
508 return null;
509 }
510
511 public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
512 {
513 }
514
515 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
516 {
517 return null;
518 }
519
520 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
521 {
522 return null;
523 }
524
525 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
526 {
527 return null;
528 }
529
530 public bool AddFolder(InventoryFolderBase folder)
531 {
532 return false;
533 }
534
535 public bool UpdateFolder(InventoryFolderBase folder)
536 {
537 return false;
538 }
539
540 public bool MoveFolder(InventoryFolderBase folder)
541 {
542 return false;
543 }
544
545 public bool DeleteFolders(UUID ownerID, List<UUID> ids)
546 {
547 return false;
548 }
549
550 public bool PurgeFolder(InventoryFolderBase folder)
551 {
552 return false;
553 }
554
555 public bool AddItem(InventoryItemBase item)
556 {
557 return false;
558 }
559
560 public bool UpdateItem(InventoryItemBase item)
561 {
562 return false;
563 }
564
565 public bool MoveItems(UUID owner, List<InventoryItemBase> items)
566 {
567 return false;
568 }
569
570 public bool DeleteItems(UUID owner, List<UUID> items)
571 {
572 return false;
573 }
574
575 public InventoryItemBase GetItem(InventoryItemBase item)
576 {
577 return null;
578 }
579
580 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
581 {
582 return null;
583 }
584
585 public bool HasInventoryForUser(UUID userID)
586 {
587 return false;
588 }
589
590 public InventoryFolderBase GetRootFolder(UUID userID)
591 {
592 InventoryFolderBase root = new InventoryFolderBase();
593 root.ID = UUID.Random();
594 root.Owner = userID;
595 root.ParentID = UUID.Zero;
596 return root;
597 }
598
599 public int GetAssetPermissions(UUID userID, UUID assetID)
600 {
601 return 1;
602 }
603 }
604}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index 52891f4..dc98550 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
47 [SetUp] 47 [SetUp]
48 public void Init() 48 public void Init()
49 { 49 {
50 m_assetService = new TestAssetService(); 50 m_assetService = new MockAssetService();
51 m_uuidGatherer = new UuidGatherer(m_assetService); 51 m_uuidGatherer = new UuidGatherer(m_assetService);
52 } 52 }
53 53
diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs
index a537b97..cb38043 100644
--- a/OpenSim/Tests/Common/Mock/TestAssetService.cs
+++ b/OpenSim/Tests/Common/Mock/MockAssetService.cs
@@ -37,20 +37,20 @@ using Nini.Config;
37 37
38namespace OpenSim.Tests.Common.Mock 38namespace OpenSim.Tests.Common.Mock
39{ 39{
40 public class TestAssetService : IAssetService 40 public class MockAssetService : IAssetService
41 { 41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>(); 44 private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>();
45 45
46 public TestAssetService() {} 46 public MockAssetService() {}
47 47
48 /// <summary> 48 /// <summary>
49 /// This constructor is required if the asset service is being created reflectively (which is the case in some 49 /// This constructor is required if the asset service is being created reflectively (which is the case in some
50 /// tests). 50 /// tests).
51 /// </summary> 51 /// </summary>
52 /// <param name="config"></param> 52 /// <param name="config"></param>
53 public TestAssetService(IConfigSource config) {} 53 public MockAssetService(IConfigSource config) {}
54 54
55 public AssetBase Get(string id) 55 public AssetBase Get(string id)
56 { 56 {
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs
index 5a0ee7c..1ea4bc1 100644
--- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs
+++ b/OpenSim/Tests/Common/Mock/MockInventoryService.cs
@@ -35,13 +35,13 @@ using Nini.Config;
35 35
36namespace OpenSim.Tests.Common.Mock 36namespace OpenSim.Tests.Common.Mock
37{ 37{
38 public class TestInventoryService : IInventoryService 38 public class MockInventoryService : IInventoryService
39 { 39 {
40 public TestInventoryService() 40 public MockInventoryService()
41 { 41 {
42 } 42 }
43 43
44 public TestInventoryService(IConfigSource config) 44 public MockInventoryService(IConfigSource config)
45 { 45 {
46 } 46 }
47 47
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index eab5422..8b18d07 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -219,7 +219,7 @@ namespace OpenSim.Tests.Common.Setup
219 if (real) 219 if (real)
220 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); 220 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
221 else 221 else
222 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestAssetService"); 222 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService");
223 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 223 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
224 assetService.Initialise(config); 224 assetService.Initialise(config);
225 assetService.AddRegion(testScene); 225 assetService.AddRegion(testScene);
@@ -238,7 +238,7 @@ namespace OpenSim.Tests.Common.Setup
238 if (real) 238 if (real)
239 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); 239 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
240 else 240 else
241 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestInventoryService"); 241 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService");
242 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 242 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
243 inventoryService.Initialise(config); 243 inventoryService.Initialise(config);
244 inventoryService.AddRegion(testScene); 244 inventoryService.AddRegion(testScene);