aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2008-09-10 17:49:41 +0000
committerSean Dague2008-09-10 17:49:41 +0000
commitf97059719431c81d8526ecbfa8ed9de0700fff28 (patch)
tree7b18c57f4afb21866f75dec236203ce3b8da6e03
parentadd shell for SQLite testing. No tests yet. (diff)
downloadopensim-SC-f97059719431c81d8526ecbfa8ed9de0700fff28.zip
opensim-SC-f97059719431c81d8526ecbfa8ed9de0700fff28.tar.gz
opensim-SC-f97059719431c81d8526ecbfa8ed9de0700fff28.tar.bz2
opensim-SC-f97059719431c81d8526ecbfa8ed9de0700fff28.tar.xz
added the first couple of sqlite tests. we'll see how bamboo
handles them.
Diffstat (limited to '')
-rw-r--r--.nant/bamboo.build2
-rw-r--r--.nant/local.include2
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs2
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs53
4 files changed, 57 insertions, 2 deletions
diff --git a/.nant/bamboo.build b/.nant/bamboo.build
index 7e4a9fc..3b2ec1a 100644
--- a/.nant/bamboo.build
+++ b/.nant/bamboo.build
@@ -40,6 +40,8 @@
40 <include name="../bin/OpenSim.Region.ScriptEngine.Shared.Tests.dll" /> 40 <include name="../bin/OpenSim.Region.ScriptEngine.Shared.Tests.dll" />
41 <include name="../bin/OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests.dll" /> 41 <include name="../bin/OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests.dll" />
42 <include name="../bin/OpenSim.Region.Environment.Tests.dll" /> 42 <include name="../bin/OpenSim.Region.Environment.Tests.dll" />
43 <include name="../bin/OpenSim.Data.SQLite.Tests.dll" />
44
43 </assemblies> 45 </assemblies>
44 </test> 46 </test>
45 </nunit2> 47 </nunit2>
diff --git a/.nant/local.include b/.nant/local.include
index 1612358..df27359 100644
--- a/.nant/local.include
+++ b/.nant/local.include
@@ -1,3 +1,5 @@
1<!-- -*- xml -*- -->
2<!-- please leve the top comment for us emacs folks -->
1<property name="projectdir" value="opensim-0.5.5" /> 3<property name="projectdir" value="opensim-0.5.5" />
2 4
3<target name="distdir"> 5<target name="distdir">
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 986687c..8fbc80d 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -211,7 +211,7 @@ namespace OpenSim.Data.SQLite
211 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0 211 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0
212 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0) 212 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0)
213 { 213 {
214 //m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); 214 m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
215 addPrim(prim, obj.UUID, regionUUID); 215 addPrim(prim, obj.UUID, regionUUID);
216 } 216 }
217 else if (prim.Stopped) 217 else if (prim.Stopped)
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
index 725573e..af3bfae 100644
--- a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
+++ b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
@@ -26,8 +26,12 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using NUnit.Framework; 30using NUnit.Framework;
31using OpenSim.Framework;
30using OpenSim.Data.SQLite; 32using OpenSim.Data.SQLite;
33using OpenSim.Region.Environment.Scenes;
34using OpenMetaverse;
31 35
32namespace OpenSim.Data.SQLite.Tests 36namespace OpenSim.Data.SQLite.Tests
33{ 37{
@@ -37,13 +41,60 @@ namespace OpenSim.Data.SQLite.Tests
37 public string file = "regiontest.db"; 41 public string file = "regiontest.db";
38 public string connect; 42 public string connect;
39 public SQLiteRegionData db; 43 public SQLiteRegionData db;
44 public UUID region = UUID.Zero;
40 45
41 [SetUp] 46 [TestFixtureSetUp]
42 public void Init() 47 public void Init()
43 { 48 {
49 log4net.Config.XmlConfigurator.Configure();
50 System.Console.WriteLine("Entering Init");
44 connect = "URI=file:" + file + ",version=3"; 51 connect = "URI=file:" + file + ",version=3";
45 db = new SQLiteRegionData(); 52 db = new SQLiteRegionData();
46 db.Initialise(connect); 53 db.Initialise(connect);
47 } 54 }
55
56 [TestFixtureTearDown]
57 public void Cleanup()
58 {
59 System.IO.File.Delete(file);
60 }
61
62 [Test]
63 public void T001_LoadEmpty()
64 {
65 System.Console.WriteLine("Entering T001");
66 List<SceneObjectGroup> objs = db.LoadObjects(region);
67 Assert.AreEqual(0, objs.Count);
68 }
69
70 [Test]
71 public void T010_StoreObject()
72 {
73 System.Console.WriteLine("Entering T010");
74 SceneObjectGroup sog = NewSOG();
75
76 db.StoreObject(sog, region);
77
78 List<SceneObjectGroup> objs = db.LoadObjects(region);
79 Assert.AreEqual(1, objs.Count);
80 }
81
82 private SceneObjectGroup NewSOG()
83 {
84 SceneObjectGroup sog = new SceneObjectGroup();
85 SceneObjectPart sop = new SceneObjectPart();
86 sop.LocalId = 1;
87 sop.Name = "";
88 sop.Description = "";
89 sop.Text = "";
90 sop.SitName = "";
91 sop.TouchName = "";
92 sop.UUID = UUID.Random();
93 sop.Shape = PrimitiveBaseShape.Default;
94 sog.AddPart(sop);
95 sog.RootPart = sop;
96 return sog;
97 }
98
48 } 99 }
49} \ No newline at end of file 100} \ No newline at end of file