29 using System.Reflection;
30 using System.Threading;
32 using System.Collections.Generic;
34 using NUnit.Framework;
36 using OpenSim.Framework;
37 using OpenSim.Region.Framework.Scenes;
38 using OpenSim.Tests.Common;
40 namespace OpenSim.
Region.Framework.Scenes.Tests
42 [TestFixture, LongRunning]
52 TestHelpers.InMethod();
54 random =
new Random();
59 uint li1 = sog.LocalId;
63 uint li2 = sog.LocalId;
67 Assert.That(found.UUID ,Is.EqualTo(obj1));
69 Assert.That(found.UUID ,Is.EqualTo(obj1));
71 Assert.That(found.UUID ,Is.EqualTo(obj2));
73 Assert.That(found.UUID ,Is.EqualTo(obj2));
78 Assert.That(entman.ContainsKey(obj1), Is.False);
79 Assert.That(entman.ContainsKey(li1), Is.False);
80 Assert.That(entman.ContainsKey(obj2), Is.False);
81 Assert.That(entman.ContainsKey(li2), Is.False);
87 TestHelpers.InMethod();
93 for (
int j=0; j<20; j++)
95 List<Thread> trdlist =
new List<Thread>();
97 for (
int i=0; i<4; i++)
107 start =
new Thread(
new ThreadStart(test.TestRemoveSceneObject));
111 foreach (
Thread thread
in trdlist)
115 if (entman.ContainsKey(sog.
UUID) || entman.ContainsKey(sog.LocalId)) {
117 Assert.That(found.UUID,Is.EqualTo(sog.
UUID));
119 Assert.That(found.UUID,Is.EqualTo(sog.
UUID));
127 sop.Name = RandomName();
128 sop.Description = sop.Name;
129 sop.Text = RandomName();
130 sop.SitName = RandomName();
131 sop.TouchName = RandomName();
132 sop.Flags |= PrimFlags.Phantom;
135 scene.AddNewSceneObject(sog,
false);
140 private static string RandomName()
142 StringBuilder name =
new StringBuilder();
143 int size = random.Next(40,80);
145 for (
int i=0; i<size; i++)
147 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
150 return name.ToString();
158 private Random random;
162 this.entman = entman;
164 this.random =
new Random();
168 Thread.Sleep(random.Next(0,50));
173 Thread.Sleep(random.Next(0,50));
174 entman.Remove(sog.UUID);
void T011_ThreadAddRemoveTest()
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
void TestAddSceneObject()
Helpers for setting up scenes.
void TestRemoveSceneObject()
NewTestThreads(EntityManager entman, SceneObjectGroup sog)