diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 78f2ae3..4baa22c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -49,18 +49,62 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Test adding an object to a scene. | 50 | /// Test adding an object to a scene. |
51 | /// </summary> | 51 | /// </summary> |
52 | [Test, LongRunning] | 52 | [Test] |
53 | public void TestAddSceneObject() | 53 | public void TestAddSceneObject() |
54 | { | 54 | { |
55 | TestHelper.InMethod(); | 55 | TestHelper.InMethod(); |
56 | 56 | ||
57 | Scene scene = SceneSetupHelpers.SetupScene(); | 57 | Scene scene = SceneSetupHelpers.SetupScene(); |
58 | SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); | 58 | |
59 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 59 | string objName = "obj1"; |
60 | UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); | ||
61 | |||
62 | SceneObjectPart part | ||
63 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
64 | { Name = objName, UUID = objUuid }; | ||
65 | |||
66 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part), false), Is.True); | ||
67 | |||
68 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); | ||
69 | |||
70 | //m_log.Debug("retrievedPart : {0}", retrievedPart); | ||
71 | // If the parts have the same UUID then we will consider them as one and the same | ||
72 | Assert.That(retrievedPart.Name, Is.EqualTo(objName)); | ||
73 | Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid)); | ||
74 | } | ||
75 | |||
76 | [Test] | ||
77 | /// <summary> | ||
78 | /// It shouldn't be possible to add a scene object if one with that uuid already exists in the scene. | ||
79 | /// </summary> | ||
80 | public void TestAddExistingSceneObjectUuid() | ||
81 | { | ||
82 | TestHelper.InMethod(); | ||
83 | |||
84 | Scene scene = SceneSetupHelpers.SetupScene(); | ||
85 | |||
86 | string obj1Name = "Alfred"; | ||
87 | string obj2Name = "Betty"; | ||
88 | UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); | ||
89 | |||
90 | SceneObjectPart part1 | ||
91 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
92 | { Name = obj1Name, UUID = objUuid }; | ||
93 | |||
94 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True); | ||
95 | |||
96 | SceneObjectPart part2 | ||
97 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
98 | { Name = obj2Name, UUID = objUuid }; | ||
99 | |||
100 | Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part2), false), Is.False); | ||
101 | |||
102 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); | ||
60 | 103 | ||
61 | //m_log.Debug("retrievedPart : {0}", retrievedPart); | 104 | //m_log.Debug("retrievedPart : {0}", retrievedPart); |
62 | // If the parts have the same UUID then we will consider them as one and the same | 105 | // If the parts have the same UUID then we will consider them as one and the same |
63 | Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); | 106 | Assert.That(retrievedPart.Name, Is.EqualTo(obj1Name)); |
107 | Assert.That(retrievedPart.UUID, Is.EqualTo(objUuid)); | ||
64 | } | 108 | } |
65 | 109 | ||
66 | /// <summary> | 110 | /// <summary> |