aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/NHibernate/EstateRegionLink.cs98
-rw-r--r--OpenSim/Data/NHibernate/NHibernateEstateData.cs322
-rw-r--r--OpenSim/Data/NHibernate/Resources/EstateRegionLink.hbm.xml24
-rw-r--r--OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml78
-rw-r--r--OpenSim/Data/NHibernate/Resources/MigrationSyntaxDifferences.txt28
-rw-r--r--OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql80
-rw-r--r--OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql80
-rw-r--r--OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql80
-rw-r--r--OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql80
-rw-r--r--OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs154
-rw-r--r--OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs152
-rw-r--r--OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs152
-rw-r--r--OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs156
-rw-r--r--OpenSim/Data/Tests/DataTestUtil.cs124
14 files changed, 804 insertions, 804 deletions
diff --git a/OpenSim/Data/NHibernate/EstateRegionLink.cs b/OpenSim/Data/NHibernate/EstateRegionLink.cs
index 95739c5..e666c3a 100644
--- a/OpenSim/Data/NHibernate/EstateRegionLink.cs
+++ b/OpenSim/Data/NHibernate/EstateRegionLink.cs
@@ -1,49 +1,49 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenMetaverse; 4using OpenMetaverse;
5 5
6namespace OpenSim.Data.NHibernate 6namespace OpenSim.Data.NHibernate
7{ 7{
8 public class EstateRegionLink 8 public class EstateRegionLink
9 { 9 {
10 private UUID estateRegionLinkID; 10 private UUID estateRegionLinkID;
11 public UUID EstateRegionLinkID 11 public UUID EstateRegionLinkID
12 { 12 {
13 get 13 get
14 { 14 {
15 return estateRegionLinkID; 15 return estateRegionLinkID;
16 } 16 }
17 set 17 set
18 { 18 {
19 estateRegionLinkID = value; 19 estateRegionLinkID = value;
20 } 20 }
21 } 21 }
22 22
23 private uint estateID; 23 private uint estateID;
24 public uint EstateID 24 public uint EstateID
25 { 25 {
26 get 26 get
27 { 27 {
28 return estateID; 28 return estateID;
29 } 29 }
30 set 30 set
31 { 31 {
32 estateID = value; 32 estateID = value;
33 } 33 }
34 } 34 }
35 35
36 private UUID regionID; 36 private UUID regionID;
37 public UUID RegionID 37 public UUID RegionID
38 { 38 {
39 get 39 get
40 { 40 {
41 return regionID; 41 return regionID;
42 } 42 }
43 set 43 set
44 { 44 {
45 regionID = value; 45 regionID = value;
46 } 46 }
47 } 47 }
48 } 48 }
49} 49}
diff --git a/OpenSim/Data/NHibernate/NHibernateEstateData.cs b/OpenSim/Data/NHibernate/NHibernateEstateData.cs
index 59896dd..3d74135 100644
--- a/OpenSim/Data/NHibernate/NHibernateEstateData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateEstateData.cs
@@ -1,161 +1,161 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the 12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Reflection; 28using System.Reflection;
29using log4net; 29using log4net;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Framework.Interfaces; 32using OpenSim.Region.Framework.Interfaces;
33using NHibernate; 33using NHibernate;
34using NHibernate.Criterion; 34using NHibernate.Criterion;
35using System.Collections; 35using System.Collections;
36using System; 36using System;
37 37
38namespace OpenSim.Data.NHibernate 38namespace OpenSim.Data.NHibernate
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// A User storage interface for the DB4o database system 41 /// A User storage interface for the DB4o database system
42 /// </summary> 42 /// </summary>
43 public class NHibernateEstateData : IEstateDataStore 43 public class NHibernateEstateData : IEstateDataStore
44 { 44 {
45 45
46 #region Fields 46 #region Fields
47 47
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 public NHibernateManager manager; 50 public NHibernateManager manager;
51 51
52 public string Name 52 public string Name
53 { 53 {
54 get { return "NHibernateEstateData"; } 54 get { return "NHibernateEstateData"; }
55 } 55 }
56 56
57 public string Version 57 public string Version
58 { 58 {
59 get { return "0.1"; } 59 get { return "0.1"; }
60 } 60 }
61 61
62 #endregion 62 #endregion
63 63
64 #region Startup and shutdown. 64 #region Startup and shutdown.
65 65
66 public void Initialise() 66 public void Initialise()
67 { 67 {
68 m_log.Info("[NHIBERNATE]: " + Name + " cannot be default-initialized!"); 68 m_log.Info("[NHIBERNATE]: " + Name + " cannot be default-initialized!");
69 throw new PluginNotInitialisedException(Name); 69 throw new PluginNotInitialisedException(Name);
70 } 70 }
71 71
72 public void Initialise(string connect) 72 public void Initialise(string connect)
73 { 73 {
74 74
75 m_log.InfoFormat("[NHIBERNATE] Initializing " + Name + "."); 75 m_log.InfoFormat("[NHIBERNATE] Initializing " + Name + ".");
76 manager = new NHibernateManager(connect, "EstateStore"); 76 manager = new NHibernateManager(connect, "EstateStore");
77 } 77 }
78 78
79 public void Dispose() { } 79 public void Dispose() { }
80 80
81 #endregion 81 #endregion
82 82
83 #region IEstateDataStore Members 83 #region IEstateDataStore Members
84 84
85 public EstateSettings LoadEstateSettings(UUID regionID) 85 public EstateSettings LoadEstateSettings(UUID regionID)
86 { 86 {
87 EstateRegionLink link = LoadEstateRegionLink(regionID); 87 EstateRegionLink link = LoadEstateRegionLink(regionID);
88 88
89 // Ensure that estate settings exist for the link 89 // Ensure that estate settings exist for the link
90 if (link != null) 90 if (link != null)
91 { 91 {
92 if (manager.Load(typeof(EstateSettings), link.EstateID) == null) 92 if (manager.Load(typeof(EstateSettings), link.EstateID) == null)
93 { 93 {
94 // Delete broken link 94 // Delete broken link
95 manager.Delete(link); 95 manager.Delete(link);
96 link = null; 96 link = null;
97 } 97 }
98 } 98 }
99 99
100 // If estate link does not exist create estate settings and link it to region. 100 // If estate link does not exist create estate settings and link it to region.
101 if (link == null) 101 if (link == null)
102 { 102 {
103 EstateSettings estateSettings = new EstateSettings(); 103 EstateSettings estateSettings = new EstateSettings();
104 //estateSettings.EstateOwner = UUID.Random(); 104 //estateSettings.EstateOwner = UUID.Random();
105 //estateSettings.BlockDwell = false; 105 //estateSettings.BlockDwell = false;
106 object identifier = manager.Insert(estateSettings); 106 object identifier = manager.Insert(estateSettings);
107 107
108 if (identifier == null) 108 if (identifier == null)
109 { 109 {
110 // Saving failed. Error is logged in the manager. 110 // Saving failed. Error is logged in the manager.
111 return null; 111 return null;
112 } 112 }
113 113
114 uint estateID = (uint)identifier; 114 uint estateID = (uint)identifier;
115 link = new EstateRegionLink(); 115 link = new EstateRegionLink();
116 link.EstateRegionLinkID = UUID.Random(); 116 link.EstateRegionLinkID = UUID.Random();
117 link.RegionID = regionID; 117 link.RegionID = regionID;
118 link.EstateID = estateID; 118 link.EstateID = estateID;
119 manager.Insert(link); 119 manager.Insert(link);
120 } 120 }
121 121
122 // Load estate settings according to the existing or created link. 122 // Load estate settings according to the existing or created link.
123 return (EstateSettings)manager.Load(typeof(EstateSettings), link.EstateID); 123 return (EstateSettings)manager.Load(typeof(EstateSettings), link.EstateID);
124 } 124 }
125 125
126 public void StoreEstateSettings(EstateSettings estateSettings) 126 public void StoreEstateSettings(EstateSettings estateSettings)
127 { 127 {
128 // Estates are always updated when stored. 128 // Estates are always updated when stored.
129 // Insert is always done via. load method as with the current API 129 // Insert is always done via. load method as with the current API
130 // this is explicitly the only way to create region link. 130 // this is explicitly the only way to create region link.
131 manager.Update(estateSettings); 131 manager.Update(estateSettings);
132 } 132 }
133 133
134 #endregion 134 #endregion
135 135
136 #region Private Utility Methods 136 #region Private Utility Methods
137 private EstateRegionLink LoadEstateRegionLink(UUID regionID) 137 private EstateRegionLink LoadEstateRegionLink(UUID regionID)
138 { 138 {
139 ICriteria criteria = manager.GetSession().CreateCriteria(typeof(EstateRegionLink)); 139 ICriteria criteria = manager.GetSession().CreateCriteria(typeof(EstateRegionLink));
140 criteria.Add(Expression.Eq("RegionID", regionID)); 140 criteria.Add(Expression.Eq("RegionID", regionID));
141 IList links = criteria.List(); 141 IList links = criteria.List();
142 142
143 // Fail fast if more than one estate links exist 143 // Fail fast if more than one estate links exist
144 if (links.Count > 1) 144 if (links.Count > 1)
145 { 145 {
146 m_log.Error("[NHIBERNATE]: Region had more than one estate linked: " + regionID); 146 m_log.Error("[NHIBERNATE]: Region had more than one estate linked: " + regionID);
147 throw new Exception("[NHIBERNATE]: Region had more than one estate linked: " + regionID); 147 throw new Exception("[NHIBERNATE]: Region had more than one estate linked: " + regionID);
148 } 148 }
149 149
150 if (links.Count == 1) 150 if (links.Count == 1)
151 { 151 {
152 return (EstateRegionLink)links[0]; 152 return (EstateRegionLink)links[0];
153 } 153 }
154 else 154 else
155 { 155 {
156 return null; 156 return null;
157 } 157 }
158 } 158 }
159 #endregion 159 #endregion
160 } 160 }
161} 161}
diff --git a/OpenSim/Data/NHibernate/Resources/EstateRegionLink.hbm.xml b/OpenSim/Data/NHibernate/Resources/EstateRegionLink.hbm.xml
index 91bddee..fd66910 100644
--- a/OpenSim/Data/NHibernate/Resources/EstateRegionLink.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/EstateRegionLink.hbm.xml
@@ -1,12 +1,12 @@
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
3 <class name="OpenSim.Data.NHibernate.EstateRegionLink, OpenSim.Data.NHibernate" table="EstateRegionLink" lazy="false"> 3 <class name="OpenSim.Data.NHibernate.EstateRegionLink, OpenSim.Data.NHibernate" table="EstateRegionLink" lazy="false">
4 <id name="EstateRegionLinkID" column="EstateRegionLinkID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate"> 4 <id name="EstateRegionLinkID" column="EstateRegionLinkID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate">
5 <generator class="assigned" /> 5 <generator class="assigned" />
6 </id> 6 </id>
7 7
8 <property name="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" /> 8 <property name="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" />
9 <property name="RegionID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" /> 9 <property name="RegionID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" />
10 10
11 </class> 11 </class>
12</hibernate-mapping> 12</hibernate-mapping>
diff --git a/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml b/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml
index 1ff0f10..2dc3949 100644
--- a/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml
@@ -1,39 +1,39 @@
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
3 <class name="OpenSim.Framework.EstateSettings, OpenSim.Framework" table="EstateSettings" lazy="false"> 3 <class name="OpenSim.Framework.EstateSettings, OpenSim.Framework" table="EstateSettings" lazy="false">
4 4
5 <id name="EstateID" column="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate"> 5 <id name="EstateID" column="EstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate">
6 <generator class="increment" /> 6 <generator class="increment" />
7 </id> 7 </id>
8 8
9 <property name="ParentEstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" /> 9 <property name="ParentEstateID" type="OpenSim.Data.NHibernate.UInt32Type, OpenSim.Data.NHibernate" />
10 <property name="EstateOwner" column="EstateOwnerID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" /> 10 <property name="EstateOwner" column="EstateOwnerID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" />
11 11
12 <property name="EstateName" column="Name" type="String" length="64" /> 12 <property name="EstateName" column="Name" type="String" length="64" />
13 13
14 <property name="RedirectGridX" type="System.Int32" /> 14 <property name="RedirectGridX" type="System.Int32" />
15 <property name="RedirectGridY" type="System.Int32" /> 15 <property name="RedirectGridY" type="System.Int32" />
16 16
17 <property name="BillableFactor" type="System.Single" /> 17 <property name="BillableFactor" type="System.Single" />
18 <property name="PricePerMeter" type="System.Int32" /> 18 <property name="PricePerMeter" type="System.Int32" />
19 <property name="SunPosition" type="System.Double" /> 19 <property name="SunPosition" type="System.Double" />
20 20
21 <property name="UseGlobalTime" type="System.Boolean" /> 21 <property name="UseGlobalTime" type="System.Boolean" />
22 <property name="FixedSun" type="System.Boolean" /> 22 <property name="FixedSun" type="System.Boolean" />
23 <property name="AllowVoice" type="System.Boolean" /> 23 <property name="AllowVoice" type="System.Boolean" />
24 <property name="AllowDirectTeleport" type="System.Boolean" /> 24 <property name="AllowDirectTeleport" type="System.Boolean" />
25 <property name="ResetHomeOnTeleport" type="System.Boolean" /> 25 <property name="ResetHomeOnTeleport" type="System.Boolean" />
26 <property name="PublicAccess" type="System.Boolean" /> 26 <property name="PublicAccess" type="System.Boolean" />
27 <property name="DenyAnonymous" type="System.Boolean" /> 27 <property name="DenyAnonymous" type="System.Boolean" />
28 <property name="DenyIdentified" type="System.Boolean" /> 28 <property name="DenyIdentified" type="System.Boolean" />
29 <property name="DenyTransacted" type="System.Boolean" /> 29 <property name="DenyTransacted" type="System.Boolean" />
30 <property name="DenyMinors" type="System.Boolean" /> 30 <property name="DenyMinors" type="System.Boolean" />
31 <property name="BlockDwell" type="System.Boolean" /> 31 <property name="BlockDwell" type="System.Boolean" />
32 <property name="EstateSkipScripts" type="System.Boolean" /> 32 <property name="EstateSkipScripts" type="System.Boolean" />
33 <property name="TaxFree" type="System.Boolean" /> 33 <property name="TaxFree" type="System.Boolean" />
34 <property name="AbuseEmailToEstateOwner" type="System.Boolean" /> 34 <property name="AbuseEmailToEstateOwner" type="System.Boolean" />
35 35
36 <property name="AbuseEmail" type="String" length="255" /> 36 <property name="AbuseEmail" type="String" length="255" />
37 37
38 </class> 38 </class>
39</hibernate-mapping> 39</hibernate-mapping>
diff --git a/OpenSim/Data/NHibernate/Resources/MigrationSyntaxDifferences.txt b/OpenSim/Data/NHibernate/Resources/MigrationSyntaxDifferences.txt
index f3d86df..1c89516 100644
--- a/OpenSim/Data/NHibernate/Resources/MigrationSyntaxDifferences.txt
+++ b/OpenSim/Data/NHibernate/Resources/MigrationSyntaxDifferences.txt
@@ -1,14 +1,14 @@
1?This file describes the differences in schema creation and migration scripts. 1?This file describes the differences in schema creation and migration scripts.
2 2
3MySQL is used as reference script against which differences are listed. 3MySQL is used as reference script against which differences are listed.
4 4
5Generally MySQL create table options should be removed for other databases. 5Generally MySQL create table options should be removed for other databases.
6 6
7_PostgreSQL_ 7_PostgreSQL_
8* DOUBLE->DOUBLE PRECISION 8* DOUBLE->DOUBLE PRECISION
9* BIT->BOOLEAN 9* BIT->BOOLEAN
10 10
11_MsSql_ 11_MsSql_
12* VARCHAR->NVARCHAR 12* VARCHAR->NVARCHAR
13* Remove DEFAULT-keywords 13* Remove DEFAULT-keywords
14* DOUBLE->REAL 14* DOUBLE->REAL
diff --git a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql
index 0e95963..4ca51be 100644
--- a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql
@@ -1,40 +1,40 @@
1CREATE TABLE EstateSettings ( 1CREATE TABLE EstateSettings (
2 EstateID INT NOT NULL, 2 EstateID INT NOT NULL,
3 ParentEstateID INT NULL, 3 ParentEstateID INT NULL,
4 EstateOwnerID NVARCHAR(36) NULL, 4 EstateOwnerID NVARCHAR(36) NULL,
5 Name NVARCHAR(64) NULL, 5 Name NVARCHAR(64) NULL,
6 RedirectGridX INT NULL, 6 RedirectGridX INT NULL,
7 RedirectGridY INT NULL, 7 RedirectGridY INT NULL,
8 BillableFactor REAL NULL, 8 BillableFactor REAL NULL,
9 PricePerMeter INT NULL, 9 PricePerMeter INT NULL,
10 SunPosition FLOAT NULL, 10 SunPosition FLOAT NULL,
11 11
12 UseGlobalTime BIT NULL, 12 UseGlobalTime BIT NULL,
13 FixedSun BIT NULL, 13 FixedSun BIT NULL,
14 AllowVoice BIT NULL, 14 AllowVoice BIT NULL,
15 AllowDirectTeleport BIT NULL, 15 AllowDirectTeleport BIT NULL,
16 ResetHomeOnTeleport BIT NULL, 16 ResetHomeOnTeleport BIT NULL,
17 PublicAccess BIT NULL, 17 PublicAccess BIT NULL,
18 DenyAnonymous BIT NULL, 18 DenyAnonymous BIT NULL,
19 DenyIdentified BIT NULL, 19 DenyIdentified BIT NULL,
20 DenyTransacted BIT NULL, 20 DenyTransacted BIT NULL,
21 DenyMinors BIT NULL, 21 DenyMinors BIT NULL,
22 BlockDwell BIT NULL, 22 BlockDwell BIT NULL,
23 EstateSkipScripts BIT NULL, 23 EstateSkipScripts BIT NULL,
24 TaxFree BIT NULL, 24 TaxFree BIT NULL,
25 AbuseEmailToEstateOwner BIT NULL, 25 AbuseEmailToEstateOwner BIT NULL,
26 26
27 AbuseEmail NVARCHAR(255) NULL, 27 AbuseEmail NVARCHAR(255) NULL,
28 28
29 PRIMARY KEY (EstateID) 29 PRIMARY KEY (EstateID)
30); 30);
31 31
32CREATE TABLE EstateRegionLink ( 32CREATE TABLE EstateRegionLink (
33 EstateRegionLinkID NVARCHAR(36) NOT NULL, 33 EstateRegionLinkID NVARCHAR(36) NOT NULL,
34 EstateID INT NULL, 34 EstateID INT NULL,
35 RegionID NVARCHAR(36) NULL, 35 RegionID NVARCHAR(36) NULL,
36 PRIMARY KEY (EstateRegionLinkID) 36 PRIMARY KEY (EstateRegionLinkID)
37); 37);
38 38
39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID); 39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID); 40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql
index a791bc6..2114186 100644
--- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql
@@ -1,40 +1,40 @@
1CREATE TABLE EstateSettings ( 1CREATE TABLE EstateSettings (
2 EstateID INT NOT NULL, 2 EstateID INT NOT NULL,
3 ParentEstateID INT DEFAULT NULL, 3 ParentEstateID INT DEFAULT NULL,
4 EstateOwnerID VARCHAR(36) DEFAULT NULL, 4 EstateOwnerID VARCHAR(36) DEFAULT NULL,
5 Name VARCHAR(64) DEFAULT NULL, 5 Name VARCHAR(64) DEFAULT NULL,
6 RedirectGridX INT DEFAULT NULL, 6 RedirectGridX INT DEFAULT NULL,
7 RedirectGridY INT DEFAULT NULL, 7 RedirectGridY INT DEFAULT NULL,
8 BillableFactor DOUBLE DEFAULT NULL, 8 BillableFactor DOUBLE DEFAULT NULL,
9 PricePerMeter INT DEFAULT NULL, 9 PricePerMeter INT DEFAULT NULL,
10 SunPosition DOUBLE DEFAULT NULL, 10 SunPosition DOUBLE DEFAULT NULL,
11 11
12 UseGlobalTime BIT DEFAULT NULL, 12 UseGlobalTime BIT DEFAULT NULL,
13 FixedSun BIT DEFAULT NULL, 13 FixedSun BIT DEFAULT NULL,
14 AllowVoice BIT DEFAULT NULL, 14 AllowVoice BIT DEFAULT NULL,
15 AllowDirectTeleport BIT DEFAULT NULL, 15 AllowDirectTeleport BIT DEFAULT NULL,
16 ResetHomeOnTeleport BIT DEFAULT NULL, 16 ResetHomeOnTeleport BIT DEFAULT NULL,
17 PublicAccess BIT DEFAULT NULL, 17 PublicAccess BIT DEFAULT NULL,
18 DenyAnonymous BIT DEFAULT NULL, 18 DenyAnonymous BIT DEFAULT NULL,
19 DenyIdentified BIT DEFAULT NULL, 19 DenyIdentified BIT DEFAULT NULL,
20 DenyTransacted BIT DEFAULT NULL, 20 DenyTransacted BIT DEFAULT NULL,
21 DenyMinors BIT DEFAULT NULL, 21 DenyMinors BIT DEFAULT NULL,
22 BlockDwell BIT DEFAULT NULL, 22 BlockDwell BIT DEFAULT NULL,
23 EstateSkipScripts BIT DEFAULT NULL, 23 EstateSkipScripts BIT DEFAULT NULL,
24 TaxFree BIT DEFAULT NULL, 24 TaxFree BIT DEFAULT NULL,
25 AbuseEmailToEstateOwner BIT DEFAULT NULL, 25 AbuseEmailToEstateOwner BIT DEFAULT NULL,
26 26
27 AbuseEmail VARCHAR(255) DEFAULT NULL, 27 AbuseEmail VARCHAR(255) DEFAULT NULL,
28 28
29 PRIMARY KEY (EstateID) 29 PRIMARY KEY (EstateID)
30) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; 30) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
31 31
32CREATE TABLE EstateRegionLink ( 32CREATE TABLE EstateRegionLink (
33 EstateRegionLinkID VARCHAR(36) NOT NULL, 33 EstateRegionLinkID VARCHAR(36) NOT NULL,
34 EstateID INT DEFAULT NULL, 34 EstateID INT DEFAULT NULL,
35 RegionID VARCHAR(36) DEFAULT NULL, 35 RegionID VARCHAR(36) DEFAULT NULL,
36 PRIMARY KEY (EstateRegionLinkID) 36 PRIMARY KEY (EstateRegionLinkID)
37) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; 37) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
38 38
39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID); 39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID); 40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
diff --git a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql
index 421a0c4..e43fd86 100644
--- a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql
@@ -1,40 +1,40 @@
1CREATE TABLE EstateSettings ( 1CREATE TABLE EstateSettings (
2 EstateID INT NOT NULL, 2 EstateID INT NOT NULL,
3 ParentEstateID INT DEFAULT NULL, 3 ParentEstateID INT DEFAULT NULL,
4 EstateOwnerID VARCHAR(36) DEFAULT NULL, 4 EstateOwnerID VARCHAR(36) DEFAULT NULL,
5 Name VARCHAR(64) DEFAULT NULL, 5 Name VARCHAR(64) DEFAULT NULL,
6 RedirectGridX INT DEFAULT NULL, 6 RedirectGridX INT DEFAULT NULL,
7 RedirectGridY INT DEFAULT NULL, 7 RedirectGridY INT DEFAULT NULL,
8 BillableFactor DOUBLE PRECISION DEFAULT NULL, 8 BillableFactor DOUBLE PRECISION DEFAULT NULL,
9 PricePerMeter INT DEFAULT NULL, 9 PricePerMeter INT DEFAULT NULL,
10 SunPosition DOUBLE PRECISION DEFAULT NULL, 10 SunPosition DOUBLE PRECISION DEFAULT NULL,
11 11
12 UseGlobalTime BOOLEAN DEFAULT NULL, 12 UseGlobalTime BOOLEAN DEFAULT NULL,
13 FixedSun BOOLEAN DEFAULT NULL, 13 FixedSun BOOLEAN DEFAULT NULL,
14 AllowVoice BOOLEAN DEFAULT NULL, 14 AllowVoice BOOLEAN DEFAULT NULL,
15 AllowDirectTeleport BOOLEAN DEFAULT NULL, 15 AllowDirectTeleport BOOLEAN DEFAULT NULL,
16 ResetHomeOnTeleport BOOLEAN DEFAULT NULL, 16 ResetHomeOnTeleport BOOLEAN DEFAULT NULL,
17 PublicAccess BOOLEAN DEFAULT NULL, 17 PublicAccess BOOLEAN DEFAULT NULL,
18 DenyAnonymous BOOLEAN DEFAULT NULL, 18 DenyAnonymous BOOLEAN DEFAULT NULL,
19 DenyIdentified BOOLEAN DEFAULT NULL, 19 DenyIdentified BOOLEAN DEFAULT NULL,
20 DenyTransacted BOOLEAN DEFAULT NULL, 20 DenyTransacted BOOLEAN DEFAULT NULL,
21 DenyMinors BOOLEAN DEFAULT NULL, 21 DenyMinors BOOLEAN DEFAULT NULL,
22 BlockDwell BOOLEAN DEFAULT NULL, 22 BlockDwell BOOLEAN DEFAULT NULL,
23 EstateSkipScripts BOOLEAN DEFAULT NULL, 23 EstateSkipScripts BOOLEAN DEFAULT NULL,
24 TaxFree BOOLEAN DEFAULT NULL, 24 TaxFree BOOLEAN DEFAULT NULL,
25 AbuseEmailToEstateOwner BOOLEAN DEFAULT NULL, 25 AbuseEmailToEstateOwner BOOLEAN DEFAULT NULL,
26 26
27 AbuseEmail VARCHAR(255) DEFAULT NULL, 27 AbuseEmail VARCHAR(255) DEFAULT NULL,
28 28
29 PRIMARY KEY (EstateID) 29 PRIMARY KEY (EstateID)
30); 30);
31 31
32CREATE TABLE EstateRegionLink ( 32CREATE TABLE EstateRegionLink (
33 EstateRegionLinkID VARCHAR(36) NOT NULL, 33 EstateRegionLinkID VARCHAR(36) NOT NULL,
34 EstateID INT DEFAULT NULL, 34 EstateID INT DEFAULT NULL,
35 RegionID VARCHAR(36) DEFAULT NULL, 35 RegionID VARCHAR(36) DEFAULT NULL,
36 PRIMARY KEY (EstateRegionLinkID) 36 PRIMARY KEY (EstateRegionLinkID)
37); 37);
38 38
39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID); 39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID); 40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql
index b16ae82..b540bc6 100644
--- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql
@@ -1,40 +1,40 @@
1CREATE TABLE EstateSettings ( 1CREATE TABLE EstateSettings (
2 EstateID INT NOT NULL, 2 EstateID INT NOT NULL,
3 ParentEstateID INT DEFAULT NULL, 3 ParentEstateID INT DEFAULT NULL,
4 EstateOwnerID VARCHAR(36) DEFAULT NULL, 4 EstateOwnerID VARCHAR(36) DEFAULT NULL,
5 Name VARCHAR(64) DEFAULT NULL, 5 Name VARCHAR(64) DEFAULT NULL,
6 RedirectGridX INT DEFAULT NULL, 6 RedirectGridX INT DEFAULT NULL,
7 RedirectGridY INT DEFAULT NULL, 7 RedirectGridY INT DEFAULT NULL,
8 BillableFactor DOUBLE DEFAULT NULL, 8 BillableFactor DOUBLE DEFAULT NULL,
9 PricePerMeter INT DEFAULT NULL, 9 PricePerMeter INT DEFAULT NULL,
10 SunPosition DOUBLE DEFAULT NULL, 10 SunPosition DOUBLE DEFAULT NULL,
11 11
12 UseGlobalTime BIT DEFAULT NULL, 12 UseGlobalTime BIT DEFAULT NULL,
13 FixedSun BIT DEFAULT NULL, 13 FixedSun BIT DEFAULT NULL,
14 AllowVoice BIT DEFAULT NULL, 14 AllowVoice BIT DEFAULT NULL,
15 AllowDirectTeleport BIT DEFAULT NULL, 15 AllowDirectTeleport BIT DEFAULT NULL,
16 ResetHomeOnTeleport BIT DEFAULT NULL, 16 ResetHomeOnTeleport BIT DEFAULT NULL,
17 PublicAccess BIT DEFAULT NULL, 17 PublicAccess BIT DEFAULT NULL,
18 DenyAnonymous BIT DEFAULT NULL, 18 DenyAnonymous BIT DEFAULT NULL,
19 DenyIdentified BIT DEFAULT NULL, 19 DenyIdentified BIT DEFAULT NULL,
20 DenyTransacted BIT DEFAULT NULL, 20 DenyTransacted BIT DEFAULT NULL,
21 DenyMinors BIT DEFAULT NULL, 21 DenyMinors BIT DEFAULT NULL,
22 BlockDwell BIT DEFAULT NULL, 22 BlockDwell BIT DEFAULT NULL,
23 EstateSkipScripts BIT DEFAULT NULL, 23 EstateSkipScripts BIT DEFAULT NULL,
24 TaxFree BIT DEFAULT NULL, 24 TaxFree BIT DEFAULT NULL,
25 AbuseEmailToEstateOwner BIT DEFAULT NULL, 25 AbuseEmailToEstateOwner BIT DEFAULT NULL,
26 26
27 AbuseEmail VARCHAR(255) DEFAULT NULL, 27 AbuseEmail VARCHAR(255) DEFAULT NULL,
28 28
29 PRIMARY KEY (EstateID) 29 PRIMARY KEY (EstateID)
30); 30);
31 31
32CREATE TABLE EstateRegionLink ( 32CREATE TABLE EstateRegionLink (
33 EstateRegionLinkID VARCHAR(36) NOT NULL, 33 EstateRegionLinkID VARCHAR(36) NOT NULL,
34 EstateID INT DEFAULT NULL, 34 EstateID INT DEFAULT NULL,
35 RegionID VARCHAR(36) DEFAULT NULL, 35 RegionID VARCHAR(36) DEFAULT NULL,
36 PRIMARY KEY (EstateRegionLinkID) 36 PRIMARY KEY (EstateRegionLinkID)
37); 37);
38 38
39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID); 39CREATE INDEX EstateRegionLinkEstateIDIndex ON EstateRegionLink (EstateID);
40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID); 40CREATE INDEX EstateRegionLinkERegionIDIndex ON EstateRegionLink (RegionID);
diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs
index ea3c1eb..ac7343b 100644
--- a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs
+++ b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs
@@ -1,77 +1,77 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the 12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System;
29using NUnit.Framework; 29using NUnit.Framework;
30using OpenSim.Data.Tests; 30using OpenSim.Data.Tests;
31 31
32namespace OpenSim.Data.NHibernate.Tests 32namespace OpenSim.Data.NHibernate.Tests
33{ 33{
34 [TestFixture] 34 [TestFixture]
35 public class NHibernateMsSqlEstateTest : BasicEstateTest 35 public class NHibernateMsSqlEstateTest : BasicEstateTest
36 { 36 {
37 public string file; 37 public string file;
38 public NHibernateManager database; 38 public NHibernateManager database;
39 39
40 [TestFixtureSetUp] 40 [TestFixtureSetUp]
41 public void Init() 41 public void Init()
42 { 42 {
43 SuperInit(); 43 SuperInit();
44 // If we manage to connect to the database with the user 44 // If we manage to connect to the database with the user
45 // and password above it is our test database, and run 45 // and password above it is our test database, and run
46 // these tests. If anything goes wrong, ignore these 46 // these tests. If anything goes wrong, ignore these
47 // tests. 47 // tests.
48 try 48 try
49 { 49 {
50 string connect = "MsSql2005Dialect;SqlClientDriver;Data Source=127.0.0.1;Network Library=DBMSSOCN;Initial Catalog=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; 50 string connect = "MsSql2005Dialect;SqlClientDriver;Data Source=127.0.0.1;Network Library=DBMSSOCN;Initial Catalog=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit";
51 51
52 db = new NHibernateEstateData(); 52 db = new NHibernateEstateData();
53 db.Initialise(connect); 53 db.Initialise(connect);
54 database = ((NHibernateEstateData)db).manager; 54 database = ((NHibernateEstateData)db).manager;
55 } 55 }
56 catch (Exception e) 56 catch (Exception e)
57 { 57 {
58 Console.WriteLine("Exception {0}", e); 58 Console.WriteLine("Exception {0}", e);
59 Assert.Ignore(); 59 Assert.Ignore();
60 } 60 }
61 } 61 }
62 62
63 [TestFixtureTearDown] 63 [TestFixtureTearDown]
64 public void Cleanup() 64 public void Cleanup()
65 { 65 {
66 if (db != null) 66 if (db != null)
67 { 67 {
68 ((NHibernateEstateData)db).Dispose(); 68 ((NHibernateEstateData)db).Dispose();
69 } 69 }
70 if (database != null) 70 if (database != null)
71 { 71 {
72 database.DropSchema(); 72 database.DropSchema();
73 } 73 }
74 } 74 }
75 75
76 } 76 }
77} 77}
diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs
index 651ff4e..7e199c7 100644
--- a/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs
+++ b/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs
@@ -1,76 +1,76 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the 12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System;
29using NUnit.Framework; 29using NUnit.Framework;
30using OpenSim.Data.Tests; 30using OpenSim.Data.Tests;
31 31
32namespace OpenSim.Data.NHibernate.Tests 32namespace OpenSim.Data.NHibernate.Tests
33{ 33{
34 [TestFixture] 34 [TestFixture]
35 public class NHibernateMySQLEstateTest : BasicEstateTest 35 public class NHibernateMySQLEstateTest : BasicEstateTest
36 { 36 {
37 public string file; 37 public string file;
38 public NHibernateManager database; 38 public NHibernateManager database;
39 public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; 39 public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit";
40 40
41 [TestFixtureSetUp] 41 [TestFixtureSetUp]
42 public void Init() 42 public void Init()
43 { 43 {
44 SuperInit(); 44 SuperInit();
45 // If we manage to connect to the database with the user 45 // If we manage to connect to the database with the user
46 // and password above it is our test database, and run 46 // and password above it is our test database, and run
47 // these tests. If anything goes wrong, ignore these 47 // these tests. If anything goes wrong, ignore these
48 // tests. 48 // tests.
49 try 49 try
50 { 50 {
51 db = new NHibernateEstateData(); 51 db = new NHibernateEstateData();
52 db.Initialise(connect); 52 db.Initialise(connect);
53 database = ((NHibernateEstateData)db).manager; 53 database = ((NHibernateEstateData)db).manager;
54 } 54 }
55 catch (Exception e) 55 catch (Exception e)
56 { 56 {
57 Console.WriteLine("Exception {0}", e); 57 Console.WriteLine("Exception {0}", e);
58 Assert.Ignore(); 58 Assert.Ignore();
59 } 59 }
60 } 60 }
61 61
62 [TestFixtureTearDown] 62 [TestFixtureTearDown]
63 public void Cleanup() 63 public void Cleanup()
64 { 64 {
65 if (db != null) 65 if (db != null)
66 { 66 {
67 ((NHibernateEstateData)db).Dispose(); 67 ((NHibernateEstateData)db).Dispose();
68 } 68 }
69 if (database != null) 69 if (database != null)
70 { 70 {
71 database.DropSchema(); 71 database.DropSchema();
72 } 72 }
73 } 73 }
74 74
75 } 75 }
76} 76}
diff --git a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs
index 1d113c7..6458c98 100644
--- a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs
+++ b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs
@@ -1,76 +1,76 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the 12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System;
29using NUnit.Framework; 29using NUnit.Framework;
30using OpenSim.Data.Tests; 30using OpenSim.Data.Tests;
31 31
32namespace OpenSim.Data.NHibernate.Tests 32namespace OpenSim.Data.NHibernate.Tests
33{ 33{
34 [TestFixture] 34 [TestFixture]
35 public class NHibernatePostgreSQLEstateTest : BasicEstateTest 35 public class NHibernatePostgreSQLEstateTest : BasicEstateTest
36 { 36 {
37 public string file; 37 public string file;
38 public NHibernateManager database; 38 public NHibernateManager database;
39 public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"; 39 public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;";
40 40
41 [TestFixtureSetUp] 41 [TestFixtureSetUp]
42 public void Init() 42 public void Init()
43 { 43 {
44 SuperInit(); 44 SuperInit();
45 // If we manage to connect to the database with the user 45 // If we manage to connect to the database with the user
46 // and password above it is our test database, and run 46 // and password above it is our test database, and run
47 // these tests. If anything goes wrong, ignore these 47 // these tests. If anything goes wrong, ignore these
48 // tests. 48 // tests.
49 try 49 try
50 { 50 {
51 db = new NHibernateEstateData(); 51 db = new NHibernateEstateData();
52 db.Initialise(connect); 52 db.Initialise(connect);
53 database = ((NHibernateEstateData)db).manager; 53 database = ((NHibernateEstateData)db).manager;
54 } 54 }
55 catch (Exception e) 55 catch (Exception e)
56 { 56 {
57 Console.WriteLine("Exception {0}", e); 57 Console.WriteLine("Exception {0}", e);
58 Assert.Ignore(); 58 Assert.Ignore();
59 } 59 }
60 } 60 }
61 61
62 [TestFixtureTearDown] 62 [TestFixtureTearDown]
63 public void Cleanup() 63 public void Cleanup()
64 { 64 {
65 if (db != null) 65 if (db != null)
66 { 66 {
67 ((NHibernateEstateData)db).Dispose(); 67 ((NHibernateEstateData)db).Dispose();
68 } 68 }
69 if (database != null) 69 if (database != null)
70 { 70 {
71 database.DropSchema(); 71 database.DropSchema();
72 } 72 }
73 } 73 }
74 74
75 } 75 }
76} 76}
diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs
index 86fb573..88f85b0 100644
--- a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs
+++ b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs
@@ -1,78 +1,78 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the 12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System;
29using System.IO; 29using System.IO;
30using NUnit.Framework; 30using NUnit.Framework;
31using OpenSim.Data.Tests; 31using OpenSim.Data.Tests;
32 32
33namespace OpenSim.Data.NHibernate.Tests 33namespace OpenSim.Data.NHibernate.Tests
34{ 34{
35 [TestFixture] 35 [TestFixture]
36 public class NHibernateSQLiteEstateTest : BasicEstateTest 36 public class NHibernateSQLiteEstateTest : BasicEstateTest
37 { 37 {
38 public string file; 38 public string file;
39 public NHibernateManager database; 39 public NHibernateManager database;
40 40
41 [TestFixtureSetUp] 41 [TestFixtureSetUp]
42 public void Init() 42 public void Init()
43 { 43 {
44 SuperInit(); 44 SuperInit();
45 // If we manage to connect to the database with the user 45 // If we manage to connect to the database with the user
46 // and password above it is our test database, and run 46 // and password above it is our test database, and run
47 // these tests. If anything goes wrong, ignore these 47 // these tests. If anything goes wrong, ignore these
48 // tests. 48 // tests.
49 try 49 try
50 { 50 {
51 string connect = "SQLiteDialect;SQLite20Driver;Data Source=" + Path.GetTempFileName() + ".db;Version=3"; 51 string connect = "SQLiteDialect;SQLite20Driver;Data Source=" + Path.GetTempFileName() + ".db;Version=3";
52 52
53 db = new NHibernateEstateData(); 53 db = new NHibernateEstateData();
54 db.Initialise(connect); 54 db.Initialise(connect);
55 database = ((NHibernateEstateData)db).manager; 55 database = ((NHibernateEstateData)db).manager;
56 } 56 }
57 catch (Exception e) 57 catch (Exception e)
58 { 58 {
59 Console.WriteLine("Exception {0}", e); 59 Console.WriteLine("Exception {0}", e);
60 Assert.Ignore(); 60 Assert.Ignore();
61 } 61 }
62 } 62 }
63 63
64 [TestFixtureTearDown] 64 [TestFixtureTearDown]
65 public void Cleanup() 65 public void Cleanup()
66 { 66 {
67 if (db != null) 67 if (db != null)
68 { 68 {
69 ((NHibernateEstateData)db).Dispose(); 69 ((NHibernateEstateData)db).Dispose();
70 } 70 }
71 if (database != null) 71 if (database != null)
72 { 72 {
73 database.DropSchema(); 73 database.DropSchema();
74 } 74 }
75 } 75 }
76 76
77 } 77 }
78} 78}
diff --git a/OpenSim/Data/Tests/DataTestUtil.cs b/OpenSim/Data/Tests/DataTestUtil.cs
index 778772f..37d1443 100644
--- a/OpenSim/Data/Tests/DataTestUtil.cs
+++ b/OpenSim/Data/Tests/DataTestUtil.cs
@@ -1,62 +1,62 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenMetaverse; 4using OpenMetaverse;
5using NUnit.Framework; 5using NUnit.Framework;
6 6
7namespace OpenSim.Data.Tests 7namespace OpenSim.Data.Tests
8{ 8{
9 9
10 /// <summary> 10 /// <summary>
11 /// Shared constants and methods for database unit tests. 11 /// Shared constants and methods for database unit tests.
12 /// </summary> 12 /// </summary>
13 public class DataTestUtil 13 public class DataTestUtil
14 { 14 {
15 15
16 public const uint UNSIGNED_INTEGER_MIN = uint.MinValue; 16 public const uint UNSIGNED_INTEGER_MIN = uint.MinValue;
17 public const uint UNSIGNED_INTEGER_MAX = uint.MaxValue / 2; // NHibernate does not support unsigned integer range. 17 public const uint UNSIGNED_INTEGER_MAX = uint.MaxValue / 2; // NHibernate does not support unsigned integer range.
18 18
19 public const int INTEGER_MIN = int.MinValue + 1; // Postgresql requires +1 to .NET int.MinValue 19 public const int INTEGER_MIN = int.MinValue + 1; // Postgresql requires +1 to .NET int.MinValue
20 public const int INTEGER_MAX = int.MaxValue; 20 public const int INTEGER_MAX = int.MaxValue;
21 21
22 public const float FLOAT_MIN = float.MinValue * (1 - FLOAT_PRECISSION); 22 public const float FLOAT_MIN = float.MinValue * (1 - FLOAT_PRECISSION);
23 public const float FLOAT_MAX = float.MaxValue * (1 - FLOAT_PRECISSION); 23 public const float FLOAT_MAX = float.MaxValue * (1 - FLOAT_PRECISSION);
24 public const float FLOAT_ACCURATE = 1.234567890123456789012f; 24 public const float FLOAT_ACCURATE = 1.234567890123456789012f;
25 public const float FLOAT_PRECISSION = 1E-5f; // Native MySQL is severly limited with floating accuracy 25 public const float FLOAT_PRECISSION = 1E-5f; // Native MySQL is severly limited with floating accuracy
26 26
27 public const double DOUBLE_MIN = -1E52 * (1 - DOUBLE_PRECISSION); 27 public const double DOUBLE_MIN = -1E52 * (1 - DOUBLE_PRECISSION);
28 public const double DOUBLE_MAX = 1E52 * (1 - DOUBLE_PRECISSION); 28 public const double DOUBLE_MAX = 1E52 * (1 - DOUBLE_PRECISSION);
29 public const double DOUBLE_ACCURATE = 1.2345678901234567890123456789012345678901234567890123f; 29 public const double DOUBLE_ACCURATE = 1.2345678901234567890123456789012345678901234567890123f;
30 public const double DOUBLE_PRECISSION = 1E-14; // Native MySQL is severly limited with double accuracy 30 public const double DOUBLE_PRECISSION = 1E-14; // Native MySQL is severly limited with double accuracy
31 31
32 public const string STRING_MIN = ""; 32 public const string STRING_MIN = "";
33 public static string STRING_MAX(int length) 33 public static string STRING_MAX(int length)
34 { 34 {
35 StringBuilder stringBuilder = new StringBuilder(); 35 StringBuilder stringBuilder = new StringBuilder();
36 for (int i = 0; i < length; i++) 36 for (int i = 0; i < length; i++)
37 { 37 {
38 stringBuilder.Append(i % 10); 38 stringBuilder.Append(i % 10);
39 } 39 }
40 return stringBuilder.ToString(); 40 return stringBuilder.ToString();
41 } 41 }
42 42
43 public static UUID UUID_MIN = new UUID("00000000-0000-0000-0000-000000000000"); 43 public static UUID UUID_MIN = new UUID("00000000-0000-0000-0000-000000000000");
44 public static UUID UUID_MAX = new UUID("ffffffff-ffff-ffff-ffff-ffffffffffff"); 44 public static UUID UUID_MAX = new UUID("ffffffff-ffff-ffff-ffff-ffffffffffff");
45 45
46 public const bool BOOLEAN_MIN = false; 46 public const bool BOOLEAN_MIN = false;
47 public const bool BOOLEAN_MAX = true; 47 public const bool BOOLEAN_MAX = true;
48 48
49 public static void AssertFloatEqualsWithTolerance(float expectedValue, float actualValue) 49 public static void AssertFloatEqualsWithTolerance(float expectedValue, float actualValue)
50 { 50 {
51 Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * FLOAT_PRECISSION); 51 Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * FLOAT_PRECISSION);
52 Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * FLOAT_PRECISSION); 52 Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * FLOAT_PRECISSION);
53 } 53 }
54 54
55 public static void AssertDoubleEqualsWithTolerance(double expectedValue, double actualValue) 55 public static void AssertDoubleEqualsWithTolerance(double expectedValue, double actualValue)
56 { 56 {
57 Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * DOUBLE_PRECISSION); 57 Assert.GreaterOrEqual(actualValue, expectedValue - Math.Abs(expectedValue) * DOUBLE_PRECISSION);
58 Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * DOUBLE_PRECISSION); 58 Assert.LessOrEqual(actualValue, expectedValue + Math.Abs(expectedValue) * DOUBLE_PRECISSION);
59 } 59 }
60 60
61 } 61 }
62} 62}