get TestSaveIarV0_1() working again by setting up an OpenSim.Data.Null.UserAuthenticationData plugin

additional tweaks to get this working properly
soprefactor
Justin Clark-Casey (justincc) 2010-06-04 20:43:05 +01:00
parent 86f2339b6e
commit 75878c8f43
9 changed files with 22 additions and 10 deletions

View File

@ -76,6 +76,5 @@ namespace OpenSim.Data.Null
return false;
}
}
}
}

View File

@ -88,7 +88,7 @@ namespace OpenSim.Data.Null
m_DataByUUID[data.PrincipalID] = data;
m_DataByName[data.FirstName + " " + data.LastName] = data;
if (data.Data.ContainsKey("Email") && data.Data["Email"] != string.Empty)
if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty)
m_DataByEmail[data.Data["Email"]] = data;
return true;

View File

@ -390,7 +390,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <returns></returns>
protected UserAccount GetUserInfo(string firstName, string lastName, string pass)
{
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName);
UserAccount account
= m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName);
if (null == account)
{
m_log.ErrorFormat(

View File

@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// Commenting for now! The mock inventory service needs more beef, at least for
// GetFolderForType
// REFACTORING PROBLEM. This needs to be rewritten.
//[Test]
[Test]
public void TestSaveIarV0_1()
{
TestHelper.InMethod();
@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
Scene scene = SceneSetupHelpers.SetupScene("Inventory, useraccounts");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
// Create user

View File

@ -88,7 +88,7 @@ namespace OpenSim.Services.AuthenticationService
m_Database = LoadPlugin<IAuthenticationData>(dllName,
new Object[] {connString, realm});
if (m_Database == null)
throw new Exception("Could not find a storage interface in the given module");
throw new Exception(string.Format("Could not find a storage interface in module {0}", dllName));
}
public bool Verify(UUID principalID, string token, int lifetime)

View File

@ -71,7 +71,7 @@ namespace OpenSim.Services.AuthenticationService
string hashed = Util.Md5Hash(password + ":" +
data.Data["passwordSalt"].ToString());
//m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
if (data.Data["passwordHash"].ToString() == hashed)
{

View File

@ -97,6 +97,10 @@ namespace OpenSim.Services.UserAccountService
public UserAccount GetUserAccount(UUID scopeID, string firstName,
string lastName)
{
// m_log.DebugFormat(
// "[USER ACCOUNT SERVICE]: Retrieving account by username for {0} {1}, scope {2}",
// firstName, lastName, scopeID);
UserAccountData[] d;
if (scopeID != UUID.Zero)
@ -231,6 +235,10 @@ namespace OpenSim.Services.UserAccountService
public bool StoreUserAccount(UserAccount data)
{
// m_log.DebugFormat(
// "[USER ACCOUNT SERVICE]: Storing user account for {0} {1} {2}, scope {3}",
// data.FirstName, data.LastName, data.PrincipalID, data.ScopeID);
UserAccountData d = new UserAccountData();
d.FirstName = data.FirstName;

View File

@ -260,7 +260,7 @@ namespace OpenSim.Tests.Common.Setup
"LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
else
config.Configs["AuthenticationService"].Set(
"LocalServiceModule", "OpenSim.Tests.Common.dll:MockuthenticationService");
"LocalServiceModule", "OpenSim.Tests.Common.dll:MockAuthenticationService");
config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
service.Initialise(config);
service.AddRegion(testScene);

View File

@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
@ -124,7 +125,9 @@ namespace OpenSim.Tests.Common.Setup
public static UserAccount CreateUserWithInventory(
Scene scene, string firstName, string lastName, UUID userId, string pw)
{
UserAccount ua = new UserAccount(userId) { FirstName = firstName, LastName = lastName };
UserAccount ua
= new UserAccount(userId)
{ FirstName = firstName, LastName = lastName, ServiceURLs = new Dictionary<string, object>() };
scene.UserAccountService.StoreUserAccount(ua);
scene.InventoryService.CreateUserInventory(ua.PrincipalID);
scene.AuthenticationService.SetPassword(ua.PrincipalID, pw);