Update svn properties.

0.6.6-post-fixes
Jeff Ames 2009-05-27 14:30:33 +00:00
parent 85e91ddb67
commit a576cca59e
4 changed files with 339 additions and 339 deletions

View File

@ -1,26 +1,26 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using NUnit.Framework; using NUnit.Framework;
namespace OpenSim.Framework.Servers.Tests namespace OpenSim.Framework.Servers.Tests
{ {
[TestFixture] [TestFixture]
public class VersionInfoTests public class VersionInfoTests
{ {
[Test] [Test]
public void TestVersionLength() public void TestVersionLength()
{ {
Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.Version.Length," VersionInfo.Version string not " + VersionInfo.VERSIONINFO_VERSION_LENGTH + " chars." ); Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.Version.Length," VersionInfo.Version string not " + VersionInfo.VERSIONINFO_VERSION_LENGTH + " chars." );
} }
[Test] [Test]
public void TestGetVersionStringLength() public void TestGetVersionStringLength()
{ {
foreach (VersionInfo.Flavour flavour in Enum.GetValues(typeof(VersionInfo.Flavour))) foreach (VersionInfo.Flavour flavour in Enum.GetValues(typeof(VersionInfo.Flavour)))
{ {
Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.GetVersionString("0.0.0", flavour).Length, "0.0.0/" + flavour + " failed"); Assert.AreEqual(VersionInfo.VERSIONINFO_VERSION_LENGTH, VersionInfo.GetVersionString("0.0.0", flavour).Length, "0.0.0/" + flavour + " failed");
} }
} }
} }
} }

View File

@ -1,126 +1,126 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the * * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using log4net; using log4net;
using System; using System;
using System.IO; using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using GlynnTucker.Cache; using GlynnTucker.Cache;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Asset namespace OpenSim.Region.CoreModules.Asset
{ {
public class GlynnTuckerAssetCache : ISharedRegionModule, IImprovedAssetCache public class GlynnTuckerAssetCache : ISharedRegionModule, IImprovedAssetCache
{ {
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger( LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
private bool m_Enabled = false; private bool m_Enabled = false;
private ICache m_Cache = new GlynnTucker.Cache.SimpleMemoryCache(); private ICache m_Cache = new GlynnTucker.Cache.SimpleMemoryCache();
public string Name public string Name
{ {
get { return "GlynnTuckerAssetCache"; } get { return "GlynnTuckerAssetCache"; }
} }
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig moduleConfig = source.Configs["Modules"]; IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null) if (moduleConfig != null)
{ {
string name = moduleConfig.GetString("AssetCaching", "GlynnTuckerAssetCache"); string name = moduleConfig.GetString("AssetCaching", "GlynnTuckerAssetCache");
m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
if (name == Name) if (name == Name)
{ {
m_Enabled = true; m_Enabled = true;
m_log.Info("[ASSET CACHE]: GlynnTucker asset cache enabled"); m_log.Info("[ASSET CACHE]: GlynnTucker asset cache enabled");
} }
} }
} }
public void PostInitialise() public void PostInitialise()
{ {
} }
public void Close() public void Close()
{ {
} }
public void AddRegion(Scene scene) public void AddRegion(Scene scene)
{ {
if (m_Enabled) if (m_Enabled)
scene.RegisterModuleInterface<IImprovedAssetCache>(this); scene.RegisterModuleInterface<IImprovedAssetCache>(this);
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
{ {
} }
public void RegionLoaded(Scene scene) public void RegionLoaded(Scene scene)
{ {
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// IImprovedAssetCache // IImprovedAssetCache
// //
public void Cache(AssetBase asset) public void Cache(AssetBase asset)
{ {
if (asset != null) if (asset != null)
m_Cache.AddOrUpdate(asset.ID, asset); m_Cache.AddOrUpdate(asset.ID, asset);
} }
public AssetBase Get(string id) public AssetBase Get(string id)
{ {
Object asset = null; Object asset = null;
m_Cache.TryGet(id, out asset); m_Cache.TryGet(id, out asset);
return (AssetBase)asset; return (AssetBase)asset;
} }
public void Expire(string id) public void Expire(string id)
{ {
Object asset = null; Object asset = null;
if (m_Cache.TryGet(id, out asset)) if (m_Cache.TryGet(id, out asset))
m_Cache.Remove(id); m_Cache.Remove(id);
} }
public void Clear() public void Clear()
{ {
m_Cache.Clear(); m_Cache.Clear();
} }
} }
} }

View File

@ -1,103 +1,103 @@
using NUnit.Framework; using NUnit.Framework;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Handlers.Asset; using OpenSim.Server.Handlers.Asset;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common; using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock; using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup; using OpenSim.Tests.Common.Setup;
namespace OpenSim.Server.Handlers.Tests.Asset namespace OpenSim.Server.Handlers.Tests.Asset
{ {
[TestFixture] [TestFixture]
public class AssetServerGetHandlerTests public class AssetServerGetHandlerTests
{ {
private const string ASSETS_PATH = "/assets"; private const string ASSETS_PATH = "/assets";
[Test] [Test]
public void TestConstructor() public void TestConstructor()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
AssetServerGetHandler handler = new AssetServerGetHandler( null ); AssetServerGetHandler handler = new AssetServerGetHandler( null );
} }
[Test] [Test]
public void TestGetParams() public void TestGetParams()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
AssetServerGetHandler handler = new AssetServerGetHandler(null); AssetServerGetHandler handler = new AssetServerGetHandler(null);
BaseRequestHandlerTestHelper.BaseTestGetParams(handler, ASSETS_PATH); BaseRequestHandlerTestHelper.BaseTestGetParams(handler, ASSETS_PATH);
} }
[Test] [Test]
public void TestSplitParams() public void TestSplitParams()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
AssetServerGetHandler handler = new AssetServerGetHandler(null); AssetServerGetHandler handler = new AssetServerGetHandler(null);
BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, ASSETS_PATH); BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, ASSETS_PATH);
} }
//[Test] //[Test]
//public void TestHandleNoParams() //public void TestHandleNoParams()
//{ //{
// TestHelper.InMethod(); // TestHelper.InMethod();
// AssetServerGetHandler handler = new AssetServerGetHandler(null); // AssetServerGetHandler handler = new AssetServerGetHandler(null);
// BaseRequestHandlerTestHelper.BaseTestHandleNoParams(handler, ASSETS_PATH); // BaseRequestHandlerTestHelper.BaseTestHandleNoParams(handler, ASSETS_PATH);
//} //}
//[Test] //[Test]
//public void TestHandleMalformedGuid() //public void TestHandleMalformedGuid()
//{ //{
// TestHelper.InMethod(); // TestHelper.InMethod();
// AssetServerGetHandler handler = new AssetServerGetHandler(null); // AssetServerGetHandler handler = new AssetServerGetHandler(null);
// BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH); // BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH);
//} //}
//[Test] //[Test]
//public void TestHandleFetchMissingAsset() //public void TestHandleFetchMissingAsset()
//{ //{
// IAssetService assetDataPlugin = new TestAssetDataPlugin(); // IAssetService assetDataPlugin = new TestAssetDataPlugin();
// AssetServerGetHandler handler = new AssetServerGetHandler(assetDataPlugin); // AssetServerGetHandler handler = new AssetServerGetHandler(assetDataPlugin);
// GetAssetStreamHandlerTestHelpers.BaseFetchMissingAsset(handler); // GetAssetStreamHandlerTestHelpers.BaseFetchMissingAsset(handler);
//} //}
//[Test] //[Test]
//public void TestHandleFetchExistingAssetData() //public void TestHandleFetchExistingAssetData()
//{ //{
// AssetServerGetHandler handler; // AssetServerGetHandler handler;
// OSHttpResponse response; // OSHttpResponse response;
// AssetBase asset = CreateTestEnvironment(out handler, out response); // AssetBase asset = CreateTestEnvironment(out handler, out response);
// GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetDataTest(asset, handler, response); // GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetDataTest(asset, handler, response);
//} //}
//[Test] //[Test]
//public void TestHandleFetchExistingAssetXml() //public void TestHandleFetchExistingAssetXml()
//{ //{
// AssetServerGetHandler handler; // AssetServerGetHandler handler;
// OSHttpResponse response; // OSHttpResponse response;
// AssetBase asset = CreateTestEnvironment(out handler, out response); // AssetBase asset = CreateTestEnvironment(out handler, out response);
// GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetXmlTest(asset, handler, response); // GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetXmlTest(asset, handler, response);
//} //}
private static AssetBase CreateTestEnvironment(out AssetServerGetHandler handler, out OSHttpResponse response) private static AssetBase CreateTestEnvironment(out AssetServerGetHandler handler, out OSHttpResponse response)
{ {
AssetBase asset = GetAssetStreamHandlerTestHelpers.CreateCommonTestResources(out response); AssetBase asset = GetAssetStreamHandlerTestHelpers.CreateCommonTestResources(out response);
IAssetService assetDataPlugin = new TestAssetService(); IAssetService assetDataPlugin = new TestAssetService();
handler = new AssetServerGetHandler(assetDataPlugin); handler = new AssetServerGetHandler(assetDataPlugin);
assetDataPlugin.Store(asset); assetDataPlugin.Store(asset);
return asset; return asset;
} }
} }
} }

View File

@ -1,85 +1,85 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Collections.Generic; using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenSim.Server.Handlers.Base; using OpenSim.Server.Handlers.Base;
namespace OpenSim.SimulatorServices namespace OpenSim.SimulatorServices
{ {
public class SimulationService : ISharedRegionModule public class SimulationService : ISharedRegionModule
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static bool m_Enabled = false; private static bool m_Enabled = false;
private IConfigSource m_Config; private IConfigSource m_Config;
bool m_Registered = false; bool m_Registered = false;
#region IRegionModule interface #region IRegionModule interface
public void Initialise(IConfigSource config) public void Initialise(IConfigSource config)
{ {
m_Config = config; m_Config = config;
IConfig moduleConfig = config.Configs["Modules"]; IConfig moduleConfig = config.Configs["Modules"];
if (moduleConfig != null) if (moduleConfig != null)
{ {
string name = moduleConfig.GetString("SimulationService", ""); string name = moduleConfig.GetString("SimulationService", "");
if (name == Name) if (name == Name)
{ {
m_Enabled = true; m_Enabled = true;
m_log.Info("[SIM SERVICE]: SimulationService enabled"); m_log.Info("[SIM SERVICE]: SimulationService enabled");
} }
} }
} }
public void PostInitialise() public void PostInitialise()
{ {
} }
public void Close() public void Close()
{ {
} }
public string Name public string Name
{ {
get { return "SimulationService"; } get { return "SimulationService"; }
} }
public void AddRegion(Scene scene) public void AddRegion(Scene scene)
{ {
if (!m_Enabled) if (!m_Enabled)
return; return;
if (!m_Registered) if (!m_Registered)
{ {
m_Registered = true; m_Registered = true;
m_log.Info("[SIM SERVICE]: Starting..."); m_log.Info("[SIM SERVICE]: Starting...");
Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, scene }; Object[] args = new Object[] { m_Config, scene.CommsManager.HttpServer, scene };
ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:SimulationServiceInConnector", args); ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:SimulationServiceInConnector", args);
} }
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
{ {
} }
public void RegionLoaded(Scene scene) public void RegionLoaded(Scene scene)
{ {
} }
#endregion #endregion
} }
} }