* Simplify test code by always setting up mock 'in memory' user and inventory data plugins for every TestCommunicationsManager

* imo the gain in simplcity of test code outweighs the very small cost of setting up some stuff that some tests will never use
This commit is contained in:
Justin Clarke Casey
2009-01-05 18:00:53 +00:00
parent 04ffcce7ea
commit 0b07c9762b
5 changed files with 42 additions and 57 deletions

View File

@@ -35,6 +35,18 @@ namespace OpenSim.Tests.Common.Mock
{
public class TestCommunicationsManager : CommunicationsManager
{
public IUserDataPlugin UserDataPlugin
{
get { return m_userDataPlugin; }
}
private IUserDataPlugin m_userDataPlugin;
public IInventoryDataPlugin InventoryDataPlugin
{
get { return m_inventoryDataPlugin; }
}
private IInventoryDataPlugin m_inventoryDataPlugin;
public TestCommunicationsManager()
: this(null)
{
@@ -43,16 +55,21 @@ namespace OpenSim.Tests.Common.Mock
public TestCommunicationsManager(NetworkServersInfo serversInfo)
: base(serversInfo, null, null, false, null)
{
m_userDataPlugin = new TestUserDataPlugin();
m_inventoryDataPlugin = new TestInventoryDataPlugin();
LocalInventoryService lis = new LocalInventoryService();
lis.AddPlugin(m_inventoryDataPlugin);
m_interServiceInventoryService = lis;
AddInventoryService(lis);
AddInventoryService(lis);
LocalUserServices lus = new LocalUserServices(991, 992, lis);
lus.AddPlugin(m_userDataPlugin);
m_userService = lus;
m_userAdminService = lus;
m_userAdminService = lus;
LocalBackEndServices gs = new LocalBackEndServices();
m_gridService = gs;
m_gridService = gs;
}
}
}