aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests
diff options
context:
space:
mode:
authorJeff Ames2009-02-09 22:49:05 +0000
committerJeff Ames2009-02-09 22:49:05 +0000
commita3d14832af644ba228d13d7a62d4796c17911183 (patch)
tree2076a6a3fc80215ed5efbec49b959a73d71ba592 /OpenSim/Data/Tests
parentMoved prim crossing out of OGS1 and into RESTComms and LocalInterregionComms.... (diff)
downloadopensim-SC_OLD-a3d14832af644ba228d13d7a62d4796c17911183.zip
opensim-SC_OLD-a3d14832af644ba228d13d7a62d4796c17911183.tar.gz
opensim-SC_OLD-a3d14832af644ba228d13d7a62d4796c17911183.tar.bz2
opensim-SC_OLD-a3d14832af644ba228d13d7a62d4796c17911183.tar.xz
Update svn properties, minor formatting cleanup.
Diffstat (limited to 'OpenSim/Data/Tests')
-rw-r--r--OpenSim/Data/Tests/BasicEstateTest.cs308
1 files changed, 154 insertions, 154 deletions
diff --git a/OpenSim/Data/Tests/BasicEstateTest.cs b/OpenSim/Data/Tests/BasicEstateTest.cs
index ef15150..325014b 100644
--- a/OpenSim/Data/Tests/BasicEstateTest.cs
+++ b/OpenSim/Data/Tests/BasicEstateTest.cs
@@ -1,154 +1,154 @@
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.Collections.Generic; 29using System.Collections.Generic;
30using System.Drawing; 30using System.Drawing;
31using System.Text; 31using System.Text;
32using NUnit.Framework; 32using NUnit.Framework;
33using NUnit.Framework.SyntaxHelpers; 33using NUnit.Framework.SyntaxHelpers;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Data; 35using OpenSim.Data;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
38 38
39namespace OpenSim.Data.Tests 39namespace OpenSim.Data.Tests
40{ 40{
41 public class BasicEstateTest 41 public class BasicEstateTest
42 { 42 {
43 public IEstateDataStore db; 43 public IEstateDataStore db;
44 public IRegionDataStore regionDb; 44 public IRegionDataStore regionDb;
45 public UUID prim1; 45 public UUID prim1;
46 public static Random random; 46 public static Random random;
47 47
48 public void SuperInit() 48 public void SuperInit()
49 { 49 {
50 try 50 try
51 { 51 {
52 log4net.Config.XmlConfigurator.Configure(); 52 log4net.Config.XmlConfigurator.Configure();
53 } 53 }
54 catch (Exception) 54 catch (Exception)
55 { 55 {
56 // I don't care, just leave log4net off 56 // I don't care, just leave log4net off
57 } 57 }
58 prim1 = UUID.Random(); 58 prim1 = UUID.Random();
59 random = new Random(); 59 random = new Random();
60 60
61 } 61 }
62 62
63 [Test] 63 [Test]
64 public void T010_StoreEstateSettings() 64 public void T010_StoreEstateSettings()
65 { 65 {
66 // Initializing field values. Avoid randomness. For checking ranges use different parameter sets 66 // Initializing field values. Avoid randomness. For checking ranges use different parameter sets
67 // for mix and max values. If you use random values the tests are not _repeatable_. 67 // for mix and max values. If you use random values the tests are not _repeatable_.
68 string estateName = "test-estate"; 68 string estateName = "test-estate";
69 uint parentEstateID = 2; 69 uint parentEstateID = 2;
70 float billableFactor = 3; 70 float billableFactor = 3;
71 int priceMeter = 4; 71 int priceMeter = 4;
72 int redirectGridX = 5; 72 int redirectGridX = 5;
73 int redirectGridY = 6; 73 int redirectGridY = 6;
74 bool useGlobalTime = true; 74 bool useGlobalTime = true;
75 bool fixedSun = true; 75 bool fixedSun = true;
76 double sunPosition = 7; 76 double sunPosition = 7;
77 bool allowVoice = true; 77 bool allowVoice = true;
78 bool allowDirectTeleport = true; 78 bool allowDirectTeleport = true;
79 bool denyAnonymous = true; 79 bool denyAnonymous = true;
80 bool denyIdentified = true; 80 bool denyIdentified = true;
81 bool denyTransacted = true; 81 bool denyTransacted = true;
82 bool abuseEmailtoEstateOwner = true; 82 bool abuseEmailtoEstateOwner = true;
83 bool blockDwell = true; 83 bool blockDwell = true;
84 bool estateskipScripts = true; 84 bool estateskipScripts = true;
85 bool taxFree = true; 85 bool taxFree = true;
86 bool publicAccess = true; 86 bool publicAccess = true;
87 string abuseMail = "test-email@nowhere.com"; 87 string abuseMail = "test-email@nowhere.com";
88 UUID estateOwner = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed7"); 88 UUID estateOwner = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed7");
89 bool denyMinors = (random.NextDouble() > 0.5)? true : false; 89 bool denyMinors = (random.NextDouble() > 0.5)? true : false;
90 90
91 // Lets choose random region ID 91 // Lets choose random region ID
92 UUID regionId = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed7"); 92 UUID regionId = new UUID("250d214e-1c7e-4f9b-a488-87c5e53feed7");
93 93
94 // Letting estate store generate rows to database for us 94 // Letting estate store generate rows to database for us
95 EstateSettings es = db.LoadEstateSettings(regionId); 95 EstateSettings es = db.LoadEstateSettings(regionId);
96 96
97 // Setting field values to the on demand create settings object. 97 // Setting field values to the on demand create settings object.
98 es.EstateName = estateName; 98 es.EstateName = estateName;
99 es.ParentEstateID = parentEstateID; 99 es.ParentEstateID = parentEstateID;
100 es.BillableFactor = billableFactor; 100 es.BillableFactor = billableFactor;
101 es.PricePerMeter = priceMeter; 101 es.PricePerMeter = priceMeter;
102 es.RedirectGridX = redirectGridX; 102 es.RedirectGridX = redirectGridX;
103 es.RedirectGridY = redirectGridY; 103 es.RedirectGridY = redirectGridY;
104 es.UseGlobalTime = useGlobalTime; 104 es.UseGlobalTime = useGlobalTime;
105 es.FixedSun = fixedSun; 105 es.FixedSun = fixedSun;
106 es.SunPosition = sunPosition; 106 es.SunPosition = sunPosition;
107 es.AllowVoice = allowVoice; 107 es.AllowVoice = allowVoice;
108 es.AllowDirectTeleport = allowDirectTeleport; 108 es.AllowDirectTeleport = allowDirectTeleport;
109 es.DenyAnonymous = denyAnonymous; 109 es.DenyAnonymous = denyAnonymous;
110 es.DenyIdentified = denyIdentified; 110 es.DenyIdentified = denyIdentified;
111 es.DenyTransacted = denyTransacted; 111 es.DenyTransacted = denyTransacted;
112 es.AbuseEmailToEstateOwner = abuseEmailtoEstateOwner; 112 es.AbuseEmailToEstateOwner = abuseEmailtoEstateOwner;
113 es.BlockDwell = blockDwell; 113 es.BlockDwell = blockDwell;
114 es.EstateSkipScripts = estateskipScripts; 114 es.EstateSkipScripts = estateskipScripts;
115 es.TaxFree = taxFree; 115 es.TaxFree = taxFree;
116 es.PublicAccess = publicAccess; 116 es.PublicAccess = publicAccess;
117 es.AbuseEmail = abuseMail; 117 es.AbuseEmail = abuseMail;
118 es.EstateOwner = estateOwner; 118 es.EstateOwner = estateOwner;
119 es.DenyMinors = denyMinors; 119 es.DenyMinors = denyMinors;
120 120
121 // Saving settings. 121 // Saving settings.
122 db.StoreEstateSettings(es); 122 db.StoreEstateSettings(es);
123 123
124 // Loading settings to another instance variable. 124 // Loading settings to another instance variable.
125 EstateSettings nes = db.LoadEstateSettings(regionId); 125 EstateSettings nes = db.LoadEstateSettings(regionId);
126 126
127 // Checking that loaded values are correct. 127 // Checking that loaded values are correct.
128 Assert.That(estateName, Is.EqualTo(nes.EstateName)); 128 Assert.That(estateName, Is.EqualTo(nes.EstateName));
129 Assert.That(parentEstateID, Is.EqualTo(nes.ParentEstateID)); 129 Assert.That(parentEstateID, Is.EqualTo(nes.ParentEstateID));
130 Assert.That(billableFactor, Is.EqualTo(nes.BillableFactor)); 130 Assert.That(billableFactor, Is.EqualTo(nes.BillableFactor));
131 Assert.That(priceMeter, Is.EqualTo(nes.PricePerMeter)); 131 Assert.That(priceMeter, Is.EqualTo(nes.PricePerMeter));
132 Assert.That(redirectGridX, Is.EqualTo(nes.RedirectGridX)); 132 Assert.That(redirectGridX, Is.EqualTo(nes.RedirectGridX));
133 Assert.That(redirectGridY, Is.EqualTo(nes.RedirectGridY)); 133 Assert.That(redirectGridY, Is.EqualTo(nes.RedirectGridY));
134 Assert.That(useGlobalTime, Is.EqualTo(nes.UseGlobalTime)); 134 Assert.That(useGlobalTime, Is.EqualTo(nes.UseGlobalTime));
135 Assert.That(fixedSun, Is.EqualTo(nes.FixedSun)); 135 Assert.That(fixedSun, Is.EqualTo(nes.FixedSun));
136 Assert.That(sunPosition, Is.EqualTo(nes.SunPosition)); 136 Assert.That(sunPosition, Is.EqualTo(nes.SunPosition));
137 Assert.That(allowVoice, Is.EqualTo(nes.AllowVoice)); 137 Assert.That(allowVoice, Is.EqualTo(nes.AllowVoice));
138 Assert.That(allowDirectTeleport, Is.EqualTo(nes.AllowDirectTeleport)); 138 Assert.That(allowDirectTeleport, Is.EqualTo(nes.AllowDirectTeleport));
139 Assert.That(denyAnonymous, Is.EqualTo(nes.DenyAnonymous)); 139 Assert.That(denyAnonymous, Is.EqualTo(nes.DenyAnonymous));
140 Assert.That(denyIdentified, Is.EqualTo(nes.DenyIdentified)); 140 Assert.That(denyIdentified, Is.EqualTo(nes.DenyIdentified));
141 Assert.That(denyTransacted, Is.EqualTo(nes.DenyTransacted)); 141 Assert.That(denyTransacted, Is.EqualTo(nes.DenyTransacted));
142 Assert.That(abuseEmailtoEstateOwner, Is.EqualTo(nes.AbuseEmailToEstateOwner)); 142 Assert.That(abuseEmailtoEstateOwner, Is.EqualTo(nes.AbuseEmailToEstateOwner));
143 Assert.That(blockDwell, Is.EqualTo(nes.BlockDwell)); 143 Assert.That(blockDwell, Is.EqualTo(nes.BlockDwell));
144 Assert.That(estateskipScripts, Is.EqualTo(nes.EstateSkipScripts)); 144 Assert.That(estateskipScripts, Is.EqualTo(nes.EstateSkipScripts));
145 Assert.That(taxFree, Is.EqualTo(nes.TaxFree)); 145 Assert.That(taxFree, Is.EqualTo(nes.TaxFree));
146 Assert.That(publicAccess, Is.EqualTo(nes.PublicAccess)); 146 Assert.That(publicAccess, Is.EqualTo(nes.PublicAccess));
147 Assert.That(abuseMail, Is.EqualTo(nes.AbuseEmail)); 147 Assert.That(abuseMail, Is.EqualTo(nes.AbuseEmail));
148 Assert.That(estateOwner, Is.EqualTo(nes.EstateOwner)); 148 Assert.That(estateOwner, Is.EqualTo(nes.EstateOwner));
149 Assert.That(denyMinors, Is.EqualTo(nes.DenyMinors)); 149 Assert.That(denyMinors, Is.EqualTo(nes.DenyMinors));
150 150
151 } 151 }
152 152
153 } 153 }
154} 154}