line ending fixes and set native eol property

0.6.3-post-fixes
Sean Dague 2009-02-16 19:23:53 +00:00
parent 93837807ff
commit c7a08752c0
14 changed files with 804 additions and 804 deletions

View File

@ -1,49 +1,49 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
namespace OpenSim.Data.NHibernate
{
public class EstateRegionLink
{
private UUID estateRegionLinkID;
public UUID EstateRegionLinkID
{
get
{
return estateRegionLinkID;
}
set
{
estateRegionLinkID = value;
}
}
private uint estateID;
public uint EstateID
{
get
{
return estateID;
}
set
{
estateID = value;
}
}
private UUID regionID;
public UUID RegionID
{
get
{
return regionID;
}
set
{
regionID = value;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
namespace OpenSim.Data.NHibernate
{
public class EstateRegionLink
{
private UUID estateRegionLinkID;
public UUID EstateRegionLinkID
{
get
{
return estateRegionLinkID;
}
set
{
estateRegionLinkID = value;
}
}
private uint estateID;
public uint EstateID
{
get
{
return estateID;
}
set
{
estateID = value;
}
}
private UUID regionID;
public UUID RegionID
{
get
{
return regionID;
}
set
{
regionID = value;
}
}
}
}

View File

@ -1,161 +1,161 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using NHibernate;
using NHibernate.Criterion;
using System.Collections;
using System;
namespace OpenSim.Data.NHibernate
{
/// <summary>
/// A User storage interface for the DB4o database system
/// </summary>
public class NHibernateEstateData : IEstateDataStore
{
#region Fields
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public NHibernateManager manager;
public string Name
{
get { return "NHibernateEstateData"; }
}
public string Version
{
get { return "0.1"; }
}
#endregion
#region Startup and shutdown.
public void Initialise()
{
m_log.Info("[NHIBERNATE]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException(Name);
}
public void Initialise(string connect)
{
m_log.InfoFormat("[NHIBERNATE] Initializing " + Name + ".");
manager = new NHibernateManager(connect, "EstateStore");
}
public void Dispose() { }
#endregion
#region IEstateDataStore Members
public EstateSettings LoadEstateSettings(UUID regionID)
{
EstateRegionLink link = LoadEstateRegionLink(regionID);
// Ensure that estate settings exist for the link
if (link != null)
{
if (manager.Load(typeof(EstateSettings), link.EstateID) == null)
{
// Delete broken link
manager.Delete(link);
link = null;
}
}
// If estate link does not exist create estate settings and link it to region.
if (link == null)
{
EstateSettings estateSettings = new EstateSettings();
//estateSettings.EstateOwner = UUID.Random();
//estateSettings.BlockDwell = false;
object identifier = manager.Insert(estateSettings);
if (identifier == null)
{
// Saving failed. Error is logged in the manager.
return null;
}
uint estateID = (uint)identifier;
link = new EstateRegionLink();
link.EstateRegionLinkID = UUID.Random();
link.RegionID = regionID;
link.EstateID = estateID;
manager.Insert(link);
}
// Load estate settings according to the existing or created link.
return (EstateSettings)manager.Load(typeof(EstateSettings), link.EstateID);
}
public void StoreEstateSettings(EstateSettings estateSettings)
{
// Estates are always updated when stored.
// Insert is always done via. load method as with the current API
// this is explicitly the only way to create region link.
manager.Update(estateSettings);
}
#endregion
#region Private Utility Methods
private EstateRegionLink LoadEstateRegionLink(UUID regionID)
{
ICriteria criteria = manager.GetSession().CreateCriteria(typeof(EstateRegionLink));
criteria.Add(Expression.Eq("RegionID", regionID));
IList links = criteria.List();
// Fail fast if more than one estate links exist
if (links.Count > 1)
{
m_log.Error("[NHIBERNATE]: Region had more than one estate linked: " + regionID);
throw new Exception("[NHIBERNATE]: Region had more than one estate linked: " + regionID);
}
if (links.Count == 1)
{
return (EstateRegionLink)links[0];
}
else
{
return null;
}
}
#endregion
}
}
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using NHibernate;
using NHibernate.Criterion;
using System.Collections;
using System;
namespace OpenSim.Data.NHibernate
{
/// <summary>
/// A User storage interface for the DB4o database system
/// </summary>
public class NHibernateEstateData : IEstateDataStore
{
#region Fields
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public NHibernateManager manager;
public string Name
{
get { return "NHibernateEstateData"; }
}
public string Version
{
get { return "0.1"; }
}
#endregion
#region Startup and shutdown.
public void Initialise()
{
m_log.Info("[NHIBERNATE]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException(Name);
}
public void Initialise(string connect)
{
m_log.InfoFormat("[NHIBERNATE] Initializing " + Name + ".");
manager = new NHibernateManager(connect, "EstateStore");
}
public void Dispose() { }
#endregion
#region IEstateDataStore Members
public EstateSettings LoadEstateSettings(UUID regionID)
{
EstateRegionLink link = LoadEstateRegionLink(regionID);
// Ensure that estate settings exist for the link
if (link != null)
{
if (manager.Load(typeof(EstateSettings), link.EstateID) == null)
{
// Delete broken link
manager.Delete(link);
link = null;
}
}
// If estate link does not exist create estate settings and link it to region.
if (link == null)
{
EstateSettings estateSettings = new EstateSettings();
//estateSettings.EstateOwner = UUID.Random();
//estateSettings.BlockDwell = false;
object identifier = manager.Insert(estateSettings);
if (identifier == null)
{
// Saving failed. Error is logged in the manager.
return null;
}
uint estateID = (uint)identifier;
link = new EstateRegionLink();
link.EstateRegionLinkID = UUID.Random();
link.RegionID = regionID;
link.EstateID = estateID;
manager.Insert(link);
}
// Load estate settings according to the existing or created link.
return (EstateSettings)manager.Load(typeof(EstateSettings), link.EstateID);
}
public void StoreEstateSettings(EstateSettings estateSettings)
{
// Estates are always updated when stored.
// Insert is always done via. load method as with the current API
// this is explicitly the only way to create region link.
manager.Update(estateSettings);
}
#endregion
#region Private Utility Methods
private EstateRegionLink LoadEstateRegionLink(UUID regionID)
{
ICriteria criteria = manager.GetSession().CreateCriteria(typeof(EstateRegionLink));
criteria.Add(Expression.Eq("RegionID", regionID));
IList links = criteria.List();
// Fail fast if more than one estate links exist
if (links.Count > 1)
{
m_log.Error("[NHIBERNATE]: Region had more than one estate linked: " + regionID);
throw new Exception("[NHIBERNATE]: Region had more than one estate linked: " + regionID);
}
if (links.Count == 1)
{
return (EstateRegionLink)links[0];
}
else
{
return null;
}
}
#endregion
}
}

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="OpenSim.Data.NHibernate.EstateRegionLink, OpenSim.Data.NHibernate" table="EstateRegionLink" lazy="false">
<id name="EstateRegionLinkID" column="EstateRegionLinkID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate">
<generator class="assigned" />
</id>
<property name="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" />
<property name="RegionID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" />
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="OpenSim.Data.NHibernate.EstateRegionLink, OpenSim.Data.NHibernate" table="EstateRegionLink" lazy="false">
<id name="EstateRegionLinkID" column="EstateRegionLinkID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate">
<generator class="assigned" />
</id>
<property name="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" />
<property name="RegionID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" />
</class>
</hibernate-mapping>

View File

@ -1,39 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="OpenSim.Framework.EstateSettings, OpenSim.Framework" table="EstateSettings" lazy="false">
<id name="EstateID" column="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate">
<generator class="increment" />
</id>
<property name="ParentEstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" />
<property name="EstateOwner" column="EstateOwnerID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" />
<property name="EstateName" column="Name" type="String" length="64" />
<property name="RedirectGridX" type="System.Int32" />
<property name="RedirectGridY" type="System.Int32" />
<property name="BillableFactor" type="System.Single" />
<property name="PricePerMeter" type="System.Int32" />
<property name="SunPosition" type="System.Double" />
<property name="UseGlobalTime" type="System.Boolean" />
<property name="FixedSun" type="System.Boolean" />
<property name="AllowVoice" type="System.Boolean" />
<property name="AllowDirectTeleport" type="System.Boolean" />
<property name="ResetHomeOnTeleport" type="System.Boolean" />
<property name="PublicAccess" type="System.Boolean" />
<property name="DenyAnonymous" type="System.Boolean" />
<property name="DenyIdentified" type="System.Boolean" />
<property name="DenyTransacted" type="System.Boolean" />
<property name="DenyMinors" type="System.Boolean" />
<property name="BlockDwell" type="System.Boolean" />
<property name="EstateSkipScripts" type="System.Boolean" />
<property name="TaxFree" type="System.Boolean" />
<property name="AbuseEmailToEstateOwner" type="System.Boolean" />
<property name="AbuseEmail" type="String" length="255" />
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="OpenSim.Framework.EstateSettings, OpenSim.Framework" table="EstateSettings" lazy="false">
<id name="EstateID" column="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate">
<generator class="increment" />
</id>
<property name="ParentEstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" />
<property name="EstateOwner" column="EstateOwnerID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" />
<property name="EstateName" column="Name" type="String" length="64" />
<property name="RedirectGridX" type="System.Int32" />
<property name="RedirectGridY" type="System.Int32" />
<property name="BillableFactor" type="System.Single" />
<property name="PricePerMeter" type="System.Int32" />
<property name="SunPosition" type="System.Double" />
<property name="UseGlobalTime" type="System.Boolean" />
<property name="FixedSun" type="System.Boolean" />
<property name="AllowVoice" type="System.Boolean" />
<property name="AllowDirectTeleport" type="System.Boolean" />
<property name="ResetHomeOnTeleport" type="System.Boolean" />
<property name="PublicAccess" type="System.Boolean" />
<property name="DenyAnonymous" type="System.Boolean" />
<property name="DenyIdentified" type="System.Boolean" />
<property name="DenyTransacted" type="System.Boolean" />
<property name="DenyMinors" type="System.Boolean" />
<property name="BlockDwell" type="System.Boolean" />
<property name="EstateSkipScripts" type="System.Boolean" />
<property name="TaxFree" type="System.Boolean" />
<property name="AbuseEmailToEstateOwner" type="System.Boolean" />
<property name="AbuseEmail" type="String" length="255" />
</class>
</hibernate-mapping>

View File

@ -1,14 +1,14 @@
?This file describes the differences in schema creation and migration scripts.
MySQL is used as reference script against which differences are listed.
Generally MySQL create table options should be removed for other databases.
_PostgreSQL_
* DOUBLE->DOUBLE PRECISION
* BIT->BOOLEAN
_MsSql_
* VARCHAR->NVARCHAR
* Remove DEFAULT-keywords
* DOUBLE->REAL
?This file describes the differences in schema creation and migration scripts.
MySQL is used as reference script against which differences are listed.
Generally MySQL create table options should be removed for other databases.
_PostgreSQL_
* DOUBLE->DOUBLE PRECISION
* BIT->BOOLEAN
_MsSql_
* VARCHAR->NVARCHAR
* Remove DEFAULT-keywords
* DOUBLE->REAL

View File

@ -1,40 +1,40 @@
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT NULL,
EstateOwnerID NVARCHAR(36) NULL,
Name NVARCHAR(64) NULL,
RedirectGridX INT NULL,
RedirectGridY INT NULL,
BillableFactor REAL NULL,
PricePerMeter INT NULL,
SunPosition FLOAT NULL,
UseGlobalTime BIT NULL,
FixedSun BIT NULL,
AllowVoice BIT NULL,
AllowDirectTeleport BIT NULL,
ResetHomeOnTeleport BIT NULL,
PublicAccess BIT NULL,
DenyAnonymous BIT NULL,
DenyIdentified BIT NULL,
DenyTransacted BIT NULL,
DenyMinors BIT NULL,
BlockDwell BIT NULL,
EstateSkipScripts BIT NULL,
TaxFree BIT NULL,
AbuseEmailToEstateOwner BIT NULL,
AbuseEmail NVARCHAR(255) NULL,
PRIMARY KEY (EstateID)
);
CREATE TABLE EstateRegionLink (
EstateRegionLinkID NVARCHAR(36) NOT NULL,
EstateID INT NULL,
RegionID NVARCHAR(36) NULL,
PRIMARY KEY (EstateRegionLinkID)
);
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT NULL,
EstateOwnerID NVARCHAR(36) NULL,
Name NVARCHAR(64) NULL,
RedirectGridX INT NULL,
RedirectGridY INT NULL,
BillableFactor REAL NULL,
PricePerMeter INT NULL,
SunPosition FLOAT NULL,
UseGlobalTime BIT NULL,
FixedSun BIT NULL,
AllowVoice BIT NULL,
AllowDirectTeleport BIT NULL,
ResetHomeOnTeleport BIT NULL,
PublicAccess BIT NULL,
DenyAnonymous BIT NULL,
DenyIdentified BIT NULL,
DenyTransacted BIT NULL,
DenyMinors BIT NULL,
BlockDwell BIT NULL,
EstateSkipScripts BIT NULL,
TaxFree BIT NULL,
AbuseEmailToEstateOwner BIT NULL,
AbuseEmail NVARCHAR(255) NULL,
PRIMARY KEY (EstateID)
);
CREATE TABLE EstateRegionLink (
EstateRegionLinkID NVARCHAR(36) NOT NULL,
EstateID INT NULL,
RegionID NVARCHAR(36) NULL,
PRIMARY KEY (EstateRegionLinkID)
);
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);

View File

@ -1,40 +1,40 @@
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT DEFAULT NULL,
EstateOwnerID VARCHAR(36) DEFAULT NULL,
Name VARCHAR(64) DEFAULT NULL,
RedirectGridX INT DEFAULT NULL,
RedirectGridY INT DEFAULT NULL,
BillableFactor DOUBLE DEFAULT NULL,
PricePerMeter INT DEFAULT NULL,
SunPosition DOUBLE DEFAULT NULL,
UseGlobalTime BIT DEFAULT NULL,
FixedSun BIT DEFAULT NULL,
AllowVoice BIT DEFAULT NULL,
AllowDirectTeleport BIT DEFAULT NULL,
ResetHomeOnTeleport BIT DEFAULT NULL,
PublicAccess BIT DEFAULT NULL,
DenyAnonymous BIT DEFAULT NULL,
DenyIdentified BIT DEFAULT NULL,
DenyTransacted BIT DEFAULT NULL,
DenyMinors BIT DEFAULT NULL,
BlockDwell BIT DEFAULT NULL,
EstateSkipScripts BIT DEFAULT NULL,
TaxFree BIT DEFAULT NULL,
AbuseEmailToEstateOwner BIT DEFAULT NULL,
AbuseEmail VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (EstateID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
CREATE TABLE EstateRegionLink (
EstateRegionLinkID VARCHAR(36) NOT NULL,
EstateID INT DEFAULT NULL,
RegionID VARCHAR(36) DEFAULT NULL,
PRIMARY KEY (EstateRegionLinkID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT DEFAULT NULL,
EstateOwnerID VARCHAR(36) DEFAULT NULL,
Name VARCHAR(64) DEFAULT NULL,
RedirectGridX INT DEFAULT NULL,
RedirectGridY INT DEFAULT NULL,
BillableFactor DOUBLE DEFAULT NULL,
PricePerMeter INT DEFAULT NULL,
SunPosition DOUBLE DEFAULT NULL,
UseGlobalTime BIT DEFAULT NULL,
FixedSun BIT DEFAULT NULL,
AllowVoice BIT DEFAULT NULL,
AllowDirectTeleport BIT DEFAULT NULL,
ResetHomeOnTeleport BIT DEFAULT NULL,
PublicAccess BIT DEFAULT NULL,
DenyAnonymous BIT DEFAULT NULL,
DenyIdentified BIT DEFAULT NULL,
DenyTransacted BIT DEFAULT NULL,
DenyMinors BIT DEFAULT NULL,
BlockDwell BIT DEFAULT NULL,
EstateSkipScripts BIT DEFAULT NULL,
TaxFree BIT DEFAULT NULL,
AbuseEmailToEstateOwner BIT DEFAULT NULL,
AbuseEmail VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (EstateID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
CREATE TABLE EstateRegionLink (
EstateRegionLinkID VARCHAR(36) NOT NULL,
EstateID INT DEFAULT NULL,
RegionID VARCHAR(36) DEFAULT NULL,
PRIMARY KEY (EstateRegionLinkID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);

View File

@ -1,40 +1,40 @@
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT DEFAULT NULL,
EstateOwnerID VARCHAR(36) DEFAULT NULL,
Name VARCHAR(64) DEFAULT NULL,
RedirectGridX INT DEFAULT NULL,
RedirectGridY INT DEFAULT NULL,
BillableFactor DOUBLE PRECISION DEFAULT NULL,
PricePerMeter INT DEFAULT NULL,
SunPosition DOUBLE PRECISION DEFAULT NULL,
UseGlobalTime BOOLEAN DEFAULT NULL,
FixedSun BOOLEAN DEFAULT NULL,
AllowVoice BOOLEAN DEFAULT NULL,
AllowDirectTeleport BOOLEAN DEFAULT NULL,
ResetHomeOnTeleport BOOLEAN DEFAULT NULL,
PublicAccess BOOLEAN DEFAULT NULL,
DenyAnonymous BOOLEAN DEFAULT NULL,
DenyIdentified BOOLEAN DEFAULT NULL,
DenyTransacted BOOLEAN DEFAULT NULL,
DenyMinors BOOLEAN DEFAULT NULL,
BlockDwell BOOLEAN DEFAULT NULL,
EstateSkipScripts BOOLEAN DEFAULT NULL,
TaxFree BOOLEAN DEFAULT NULL,
AbuseEmailToEstateOwner BOOLEAN DEFAULT NULL,
AbuseEmail VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (EstateID)
);
CREATE TABLE EstateRegionLink (
EstateRegionLinkID VARCHAR(36) NOT NULL,
EstateID INT DEFAULT NULL,
RegionID VARCHAR(36) DEFAULT NULL,
PRIMARY KEY (EstateRegionLinkID)
);
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT DEFAULT NULL,
EstateOwnerID VARCHAR(36) DEFAULT NULL,
Name VARCHAR(64) DEFAULT NULL,
RedirectGridX INT DEFAULT NULL,
RedirectGridY INT DEFAULT NULL,
BillableFactor DOUBLE PRECISION DEFAULT NULL,
PricePerMeter INT DEFAULT NULL,
SunPosition DOUBLE PRECISION DEFAULT NULL,
UseGlobalTime BOOLEAN DEFAULT NULL,
FixedSun BOOLEAN DEFAULT NULL,
AllowVoice BOOLEAN DEFAULT NULL,
AllowDirectTeleport BOOLEAN DEFAULT NULL,
ResetHomeOnTeleport BOOLEAN DEFAULT NULL,
PublicAccess BOOLEAN DEFAULT NULL,
DenyAnonymous BOOLEAN DEFAULT NULL,
DenyIdentified BOOLEAN DEFAULT NULL,
DenyTransacted BOOLEAN DEFAULT NULL,
DenyMinors BOOLEAN DEFAULT NULL,
BlockDwell BOOLEAN DEFAULT NULL,
EstateSkipScripts BOOLEAN DEFAULT NULL,
TaxFree BOOLEAN DEFAULT NULL,
AbuseEmailToEstateOwner BOOLEAN DEFAULT NULL,
AbuseEmail VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (EstateID)
);
CREATE TABLE EstateRegionLink (
EstateRegionLinkID VARCHAR(36) NOT NULL,
EstateID INT DEFAULT NULL,
RegionID VARCHAR(36) DEFAULT NULL,
PRIMARY KEY (EstateRegionLinkID)
);
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);

View File

@ -1,40 +1,40 @@
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT DEFAULT NULL,
EstateOwnerID VARCHAR(36) DEFAULT NULL,
Name VARCHAR(64) DEFAULT NULL,
RedirectGridX INT DEFAULT NULL,
RedirectGridY INT DEFAULT NULL,
BillableFactor DOUBLE DEFAULT NULL,
PricePerMeter INT DEFAULT NULL,
SunPosition DOUBLE DEFAULT NULL,
UseGlobalTime BIT DEFAULT NULL,
FixedSun BIT DEFAULT NULL,
AllowVoice BIT DEFAULT NULL,
AllowDirectTeleport BIT DEFAULT NULL,
ResetHomeOnTeleport BIT DEFAULT NULL,
PublicAccess BIT DEFAULT NULL,
DenyAnonymous BIT DEFAULT NULL,
DenyIdentified BIT DEFAULT NULL,
DenyTransacted BIT DEFAULT NULL,
DenyMinors BIT DEFAULT NULL,
BlockDwell BIT DEFAULT NULL,
EstateSkipScripts BIT DEFAULT NULL,
TaxFree BIT DEFAULT NULL,
AbuseEmailToEstateOwner BIT DEFAULT NULL,
AbuseEmail VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (EstateID)
);
CREATE TABLE EstateRegionLink (
EstateRegionLinkID VARCHAR(36) NOT NULL,
EstateID INT DEFAULT NULL,
RegionID VARCHAR(36) DEFAULT NULL,
PRIMARY KEY (EstateRegionLinkID)
);
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
CREATE TABLE EstateSettings (
EstateID INT NOT NULL,
ParentEstateID INT DEFAULT NULL,
EstateOwnerID VARCHAR(36) DEFAULT NULL,
Name VARCHAR(64) DEFAULT NULL,
RedirectGridX INT DEFAULT NULL,
RedirectGridY INT DEFAULT NULL,
BillableFactor DOUBLE DEFAULT NULL,
PricePerMeter INT DEFAULT NULL,
SunPosition DOUBLE DEFAULT NULL,
UseGlobalTime BIT DEFAULT NULL,
FixedSun BIT DEFAULT NULL,
AllowVoice BIT DEFAULT NULL,
AllowDirectTeleport BIT DEFAULT NULL,
ResetHomeOnTeleport BIT DEFAULT NULL,
PublicAccess BIT DEFAULT NULL,
DenyAnonymous BIT DEFAULT NULL,
DenyIdentified BIT DEFAULT NULL,
DenyTransacted BIT DEFAULT NULL,
DenyMinors BIT DEFAULT NULL,
BlockDwell BIT DEFAULT NULL,
EstateSkipScripts BIT DEFAULT NULL,
TaxFree BIT DEFAULT NULL,
AbuseEmailToEstateOwner BIT DEFAULT NULL,
AbuseEmail VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (EstateID)
);
CREATE TABLE EstateRegionLink (
EstateRegionLinkID VARCHAR(36) NOT NULL,
EstateID INT DEFAULT NULL,
RegionID VARCHAR(36) DEFAULT NULL,
PRIMARY KEY (EstateRegionLinkID)
);
CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);

View File

@ -1,77 +1,77 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernateMsSqlEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
string connect = "MsSql2005Dialect;SqlClientDriver;Data Source=127.0.0.1;Network Library=DBMSSOCN;Initial Catalog=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit";
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernateMsSqlEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
string connect = "MsSql2005Dialect;SqlClientDriver;Data Source=127.0.0.1;Network Library=DBMSSOCN;Initial Catalog=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit";
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}

View File

@ -1,76 +1,76 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernateMySQLEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit";
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernateMySQLEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit";
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}

View File

@ -1,76 +1,76 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernatePostgreSQLEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;";
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernatePostgreSQLEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;";
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}

View File

@ -1,78 +1,78 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernateSQLiteEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
string connect = "SQLiteDialect;SQLite20Driver;Data Source=" + Path.GetTempFileName() + ".db;Version=3";
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* 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
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using NUnit.Framework;
using OpenSim.Data.Tests;
namespace OpenSim.Data.NHibernate.Tests
{
[TestFixture]
public class NHibernateSQLiteEstateTest : BasicEstateTest
{
public string file;
public NHibernateManager database;
[TestFixtureSetUp]
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
string connect = "SQLiteDialect;SQLite20Driver;Data Source=" + Path.GetTempFileName() + ".db;Version=3";
db = new NHibernateEstateData();
db.Initialise(connect);
database = ((NHibernateEstateData)db).manager;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}", e);
Assert.Ignore();
}
}
[TestFixtureTearDown]
public void Cleanup()
{
if (db != null)
{
((NHibernateEstateData)db).Dispose();
}
if (database != null)
{
database.DropSchema();
}
}
}
}

View File

@ -1,62 +1,62 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using NUnit.Framework;
namespace OpenSim.Data.Tests
{
/// <summary>
/// Shared constants and methods for database unit tests.
/// </summary>
public class DataTestUtil
{
public const uint UNSIGNED_INTEGER_MIN = uint.MinValue;
public const uint UNSIGNED_INTEGER_MAX = uint.MaxValue / 2; // NHibernate does not support unsigned integer range.
public const int INTEGER_MIN = int.MinValue + 1; // Postgresql requires +1 to .NET int.MinValue
public const int INTEGER_MAX = int.MaxValue;
public const float FLOAT_MIN = float.MinValue * (1 - FLOAT_PRECISSION);
public const float FLOAT_MAX = float.MaxValue * (1 - FLOAT_PRECISSION);
public const float FLOAT_ACCURATE = 1.234567890123456789012f;
public const float FLOAT_PRECISSION = 1E-5f; // Native MySQL is severly limited with floating accuracy
public const double DOUBLE_MIN = -1E52 * (1 - DOUBLE_PRECISSION);
public const double DOUBLE_MAX = 1E52 * (1 - DOUBLE_PRECISSION);
public const double DOUBLE_ACCURATE = 1.2345678901234567890123456789012345678901234567890123f;
public const double DOUBLE_PRECISSION = 1E-14; // Native MySQL is severly limited with double accuracy
public const string STRING_MIN = "";
public static string STRING_MAX(int length)
{
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < length; i++)
{
stringBuilder.Append(i % 10);
}
return stringBuilder.ToString();
}
public static UUID UUID_MIN = new UUID("00000000-0000-0000-0000-000000000000");
public static UUID UUID_MAX = new UUID("ffffffff-ffff-ffff-ffff-ffffffffffff");
public const bool BOOLEAN_MIN = false;
public const bool BOOLEAN_MAX = true;
public static void AssertFloatEqualsWithTolerance(float expectedValue, float actualValue)
{
Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * FLOAT_PRECISSION);
Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * FLOAT_PRECISSION);
}
public static void AssertDoubleEqualsWithTolerance(double expectedValue, double actualValue)
{
Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * DOUBLE_PRECISSION);
Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * DOUBLE_PRECISSION);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using NUnit.Framework;
namespace OpenSim.Data.Tests
{
/// <summary>
/// Shared constants and methods for database unit tests.
/// </summary>
public class DataTestUtil
{
public const uint UNSIGNED_INTEGER_MIN = uint.MinValue;
public const uint UNSIGNED_INTEGER_MAX = uint.MaxValue / 2; // NHibernate does not support unsigned integer range.
public const int INTEGER_MIN = int.MinValue + 1; // Postgresql requires +1 to .NET int.MinValue
public const int INTEGER_MAX = int.MaxValue;
public const float FLOAT_MIN = float.MinValue * (1 - FLOAT_PRECISSION);
public const float FLOAT_MAX = float.MaxValue * (1 - FLOAT_PRECISSION);
public const float FLOAT_ACCURATE = 1.234567890123456789012f;
public const float FLOAT_PRECISSION = 1E-5f; // Native MySQL is severly limited with floating accuracy
public const double DOUBLE_MIN = -1E52 * (1 - DOUBLE_PRECISSION);
public const double DOUBLE_MAX = 1E52 * (1 - DOUBLE_PRECISSION);
public const double DOUBLE_ACCURATE = 1.2345678901234567890123456789012345678901234567890123f;
public const double DOUBLE_PRECISSION = 1E-14; // Native MySQL is severly limited with double accuracy
public const string STRING_MIN = "";
public static string STRING_MAX(int length)
{
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < length; i++)
{
stringBuilder.Append(i % 10);
}
return stringBuilder.ToString();
}
public static UUID UUID_MIN = new UUID("00000000-0000-0000-0000-000000000000");
public static UUID UUID_MAX = new UUID("ffffffff-ffff-ffff-ffff-ffffffffffff");
public const bool BOOLEAN_MIN = false;
public const bool BOOLEAN_MAX = true;
public static void AssertFloatEqualsWithTolerance(float expectedValue, float actualValue)
{
Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * FLOAT_PRECISSION);
Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * FLOAT_PRECISSION);
}
public static void AssertDoubleEqualsWithTolerance(double expectedValue, double actualValue)
{
Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * DOUBLE_PRECISSION);
Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * DOUBLE_PRECISSION);
}
}
}