instrument most of the tests with a new InMethod function that may help us figure

out where that pesky deadlock is during test runs.
This commit is contained in:
Sean Dague
2009-05-07 19:07:08 +00:00
parent 84815ab271
commit ce0a84cbc0
15 changed files with 91 additions and 17 deletions

View File

@@ -34,6 +34,7 @@ using OpenSim.Framework.Communications.Cache;
using OpenSim.Region.Communications.Local;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
using OpenSim.Tests.Common;
namespace OpenSim.Framework.Communications.Tests
{
@@ -43,6 +44,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void TestGetUserDetails()
{
TestHelper.InMethod();
UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000002");
string firstName = "Bill";
string lastName = "Bailey";
@@ -109,6 +112,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void TestFetchInventory()
{
TestHelper.InMethod();
TestCommunicationsManager commsManager = new TestCommunicationsManager();
CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);
@@ -118,6 +123,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void TestGetChildFolder()
{
TestHelper.InMethod();
TestCommunicationsManager commsManager = new TestCommunicationsManager();
CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);
@@ -132,6 +139,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void TestCreateFolder()
{
TestHelper.InMethod();
TestCommunicationsManager commsManager = new TestCommunicationsManager();
IInventoryDataPlugin inventoryDataPlugin = commsManager.InventoryDataPlugin;
@@ -159,6 +168,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void TestUpdateFolder()
{
TestHelper.InMethod();
TestCommunicationsManager commsManager = new TestCommunicationsManager();
IInventoryDataPlugin inventoryDataPlugin = commsManager.InventoryDataPlugin;
@@ -213,6 +224,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void TestMoveFolder()
{
TestHelper.InMethod();
TestCommunicationsManager commsManager = new TestCommunicationsManager();
IInventoryDataPlugin inventoryDataPlugin = commsManager.InventoryDataPlugin;
@@ -244,6 +257,7 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void TestPurgeFolder()
{
TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure();
TestCommunicationsManager commsManager = new TestCommunicationsManager();

View File

@@ -38,6 +38,7 @@ using OpenSim.Framework.Communications.Services;
using OpenSim.Region.Communications.Local;
using OpenSim.Tests.Common.Mock;
using OpenSim.Client.Linden;
using OpenSim.Tests.Common;
namespace OpenSim.Framework.Communications.Tests
{
@@ -45,6 +46,7 @@ namespace OpenSim.Framework.Communications.Tests
/// Test the login service. For now, most of this will be done through the LocalLoginService as LoginService
/// is abstract
/// </summary>
[TestFixture]
public class LoginServiceTests
{
@@ -83,6 +85,7 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void T010_TestUnauthenticatedLogin()
{
TestHelper.InMethod();
// We want to use our own LoginService for this test, one that
// doesn't require authentication.
LoginService loginService = new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", m_commsManager.InterServiceInventoryService,
@@ -119,6 +122,7 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void T011_TestAuthenticatedLoginSuccess()
{
TestHelper.InMethod();
// TODO: Not check inventory part of response yet.
// TODO: Not checking all of login response thoroughly yet.
@@ -168,6 +172,7 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void T012_TestAuthenticatedLoginForBuddies()
{
TestHelper.InMethod();
// 1.1) Test for budddies!
m_localUserServices.AddUser("Friend","Number1","boingboing","abc@ftw.com",42,43);
m_localUserServices.AddUser("Friend","Number2","boingboing","abc@ftw.com",42,43);
@@ -207,6 +212,7 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void T020_TestAuthenticatedLoginBadUsername()
{
TestHelper.InMethod();
// 2) Test for negative authentication
//
@@ -234,6 +240,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void T021_TestAuthenticatedLoginBadPassword()
{
TestHelper.InMethod();
string error_auth_message = "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.";
// 2.2) Test for wrong password
Hashtable loginParams = new Hashtable();
@@ -257,6 +265,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void T022_TestAuthenticatedLoginBadXml()
{
TestHelper.InMethod();
string error_xml_message = "Error connecting to grid. Could not percieve credentials from login XML.";
// 2.3) Bad XML
Hashtable loginParams = new Hashtable();
@@ -280,6 +290,8 @@ namespace OpenSim.Framework.Communications.Tests
[Test]
public void T023_TestAuthenticatedLoginAlreadyLoggedIn()
{
TestHelper.InMethod();
//Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()");
//log4net.Config.XmlConfigurator.Configure();

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using OpenSim.Data;
using OpenSim.Tests.Common;
namespace OpenSim.Framework.Servers.Tests
{
@@ -12,12 +13,16 @@ namespace OpenSim.Framework.Servers.Tests
[Test]
public void TestConstructor()
{
TestHelper.InMethod();
GetAssetStreamHandler handler = new GetAssetStreamHandler( null );
}
[Test]
public void TestGetParams()
{
TestHelper.InMethod();
GetAssetStreamHandler handler = new GetAssetStreamHandler(null);
Assert.AreEqual("", handler.GetParam(null), "Failed on null path.");
@@ -36,6 +41,8 @@ namespace OpenSim.Framework.Servers.Tests
[Test]
public void TestSplitParams()
{
TestHelper.InMethod();
GetAssetStreamHandler handler = new GetAssetStreamHandler(null);
Assert.AreEqual(new string[] { }, handler.SplitParams(null), "Failed on null.");
@@ -53,6 +60,8 @@ namespace OpenSim.Framework.Servers.Tests
[Test]
public void TestHandleNoParams()
{
TestHelper.InMethod();
byte[] emptyResult = new byte[] {};
GetAssetStreamHandler handler = new GetAssetStreamHandler(null);
@@ -63,6 +72,8 @@ namespace OpenSim.Framework.Servers.Tests
[Test]
public void TestHandleMalformedGuid()
{
TestHelper.InMethod();
byte[] emptyResult = new byte[] {};
GetAssetStreamHandler handler = new GetAssetStreamHandler(null);