Rename test services to mock services, since this is a more accurate description
remove duplicate mock inventory service0.6.8-post-fixes
parent
d21fc1cefb
commit
2f092d271e
|
@ -75,7 +75,7 @@ namespace OpenSim.Framework.Communications.Tests
|
||||||
|
|
||||||
m_regionConnector.AddRegion(new RegionInfo(42, 43, m_capsEndPoint, m_regionExternalName));
|
m_regionConnector.AddRegion(new RegionInfo(42, 43, m_capsEndPoint, m_regionExternalName));
|
||||||
|
|
||||||
//IInventoryService m_inventoryService = new TestInventoryService();
|
//IInventoryService m_inventoryService = new MockInventoryService();
|
||||||
|
|
||||||
m_localUserServices = (LocalUserServices) m_commsManager.UserService;
|
m_localUserServices = (LocalUserServices) m_commsManager.UserService;
|
||||||
m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","abc@ftw.com",42,43);
|
m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","abc@ftw.com",42,43);
|
||||||
|
@ -95,7 +95,8 @@ namespace OpenSim.Framework.Communications.Tests
|
||||||
TestHelper.InMethod();
|
TestHelper.InMethod();
|
||||||
// We want to use our own LoginService for this test, one that
|
// We want to use our own LoginService for this test, one that
|
||||||
// doesn't require authentication.
|
// doesn't require authentication.
|
||||||
new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(),
|
new LLStandaloneLoginService(
|
||||||
|
(UserManagerBase)m_commsManager.UserService, "Hello folks", new MockInventoryService(),
|
||||||
m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector);
|
m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector);
|
||||||
|
|
||||||
Hashtable loginParams = new Hashtable();
|
Hashtable loginParams = new Hashtable();
|
||||||
|
@ -457,148 +458,4 @@ namespace OpenSim.Framework.Communications.Tests
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestInventoryService : IInventoryService
|
|
||||||
{
|
|
||||||
public TestInventoryService()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool CreateUserInventory(UUID userId)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
|
|
||||||
{
|
|
||||||
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
|
|
||||||
InventoryFolderBase folder = new InventoryFolderBase();
|
|
||||||
folder.ID = UUID.Random();
|
|
||||||
folder.Owner = userId;
|
|
||||||
folders.Add(folder);
|
|
||||||
return folders;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of all the active gestures in a user's inventory.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId">
|
|
||||||
/// The <see cref="UUID"/> of the user
|
|
||||||
/// </param>
|
|
||||||
/// <returns>
|
|
||||||
/// A flat list of the gesture items.
|
|
||||||
/// </returns>
|
|
||||||
public List<InventoryItemBase> GetActiveGestures(UUID userId)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryCollection GetUserInventory(UUID userID)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool AddFolder(InventoryFolderBase folder)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool UpdateFolder(InventoryFolderBase folder)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool MoveFolder(InventoryFolderBase folder)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool DeleteFolders(UUID ownerID, List<UUID> ids)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool PurgeFolder(InventoryFolderBase folder)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool AddItem(InventoryItemBase item)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool UpdateItem(InventoryItemBase item)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool MoveItems(UUID owner, List<InventoryItemBase> items)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool DeleteItems(UUID owner, List<UUID> items)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryItemBase GetItem(InventoryItemBase item)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasInventoryForUser(UUID userID)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryFolderBase GetRootFolder(UUID userID)
|
|
||||||
{
|
|
||||||
InventoryFolderBase root = new InventoryFolderBase();
|
|
||||||
root.ID = UUID.Random();
|
|
||||||
root.Owner = userID;
|
|
||||||
root.ParentID = UUID.Zero;
|
|
||||||
return root;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int GetAssetPermissions(UUID userID, UUID assetID)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
m_assetService = new TestAssetService();
|
m_assetService = new MockAssetService();
|
||||||
m_uuidGatherer = new UuidGatherer(m_assetService);
|
m_uuidGatherer = new UuidGatherer(m_assetService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,20 +37,20 @@ using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.Tests.Common.Mock
|
namespace OpenSim.Tests.Common.Mock
|
||||||
{
|
{
|
||||||
public class TestAssetService : IAssetService
|
public class MockAssetService : IAssetService
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>();
|
private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>();
|
||||||
|
|
||||||
public TestAssetService() {}
|
public MockAssetService() {}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This constructor is required if the asset service is being created reflectively (which is the case in some
|
/// This constructor is required if the asset service is being created reflectively (which is the case in some
|
||||||
/// tests).
|
/// tests).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
public TestAssetService(IConfigSource config) {}
|
public MockAssetService(IConfigSource config) {}
|
||||||
|
|
||||||
public AssetBase Get(string id)
|
public AssetBase Get(string id)
|
||||||
{
|
{
|
|
@ -35,13 +35,13 @@ using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.Tests.Common.Mock
|
namespace OpenSim.Tests.Common.Mock
|
||||||
{
|
{
|
||||||
public class TestInventoryService : IInventoryService
|
public class MockInventoryService : IInventoryService
|
||||||
{
|
{
|
||||||
public TestInventoryService()
|
public MockInventoryService()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestInventoryService(IConfigSource config)
|
public MockInventoryService(IConfigSource config)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,7 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
if (real)
|
if (real)
|
||||||
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
|
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
|
||||||
else
|
else
|
||||||
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestAssetService");
|
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService");
|
||||||
config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
|
config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
|
||||||
assetService.Initialise(config);
|
assetService.Initialise(config);
|
||||||
assetService.AddRegion(testScene);
|
assetService.AddRegion(testScene);
|
||||||
|
@ -238,7 +238,7 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
if (real)
|
if (real)
|
||||||
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
|
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
|
||||||
else
|
else
|
||||||
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestInventoryService");
|
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService");
|
||||||
config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
|
config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
|
||||||
inventoryService.Initialise(config);
|
inventoryService.Initialise(config);
|
||||||
inventoryService.AddRegion(testScene);
|
inventoryService.AddRegion(testScene);
|
||||||
|
|
Loading…
Reference in New Issue