From e1c449b492a08b95e9f4ea0556b6ec77f32ef0e7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 14 Apr 2009 17:44:10 +0000 Subject: * Change simple asset cache test to manually pump the asset server rather than relying on another thread --- .../Communications/Tests/Cache/AssetCacheTests.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework/Communications/Tests') diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs index 264bfe1..5d6bc8d 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs @@ -62,15 +62,14 @@ namespace OpenSim.Framework.Communications.Tests TestAssetDataPlugin assetPlugin = new TestAssetDataPlugin(); assetPlugin.CreateAsset(asset); - IAssetServer assetServer = new SQLAssetServer(assetPlugin); + SQLAssetServer assetServer = new SQLAssetServer(assetPlugin); IAssetCache assetCache = new AssetCache(assetServer); - assetServer.Start(); - - lock (this) - { - assetCache.GetAsset(assetId, AssetRequestCallback, false); - Monitor.Wait(this, 60000); - } + + assetCache.GetAsset(assetId, AssetRequestCallback, false); + + // Manually pump the asset server + while (assetServer.HasWaitingRequests()) + assetServer.ProcessNextRequest(); Assert.That( assetId, Is.EqualTo(m_assetIdReceived), "Asset id stored differs from asset id received"); -- cgit v1.1