From 7ed419217fc63f7a01c13a7c3320e97edd6bb1b6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 20 May 2011 23:22:27 +0100
Subject: add test for rezzing an object from a prim item
---
OpenSim/Region/Framework/Scenes/Scene.cs | 3 +-
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 ++
.../Framework/Scenes/Tests/TaskInventoryTests.cs | 45 +++++++++++++++++++++-
3 files changed, 49 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9df7340..0722cee 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1971,8 +1971,9 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Add a newly created object to the scene.
///
- ///
+ ///
/// This method does not send updates to the client - callers need to handle this themselves.
+ ///
///
///
/// Position of the object
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index fc31b65..14b587f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -344,6 +344,9 @@ namespace OpenSim.Region.Framework.Scenes
/// Add an object to the scene. This will both update the scene, and send information about the
/// new object to all clients interested in the scene.
///
+ ///
+ /// The object's stored position, rotation and velocity are used.
+ ///
///
///
/// If true, the object is made persistent into the scene.
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 2aef4b0..73f66cb 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -90,11 +90,54 @@ namespace OpenSim.Region.Framework.Tests
return ncItem;
}
-
+
+ [Test]
+ public void TestRezObjectFromInventoryItem()
+ {
+ TestHelper.InMethod();
+// log4net.Config.XmlConfigurator.Configure();
+
+ Scene scene = SceneSetupHelpers.SetupScene();
+ UserAccount user1 = CreateUser(scene);
+ SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
+ SceneObjectPart sop1 = sog1.RootPart;
+
+ // Create an object embedded inside the first
+ UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
+
+ SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero);
+ AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
+ scene.AssetService.Store(taskSceneObjectAsset);
+ TaskInventoryItem taskSceneObjectItem
+ = new TaskInventoryItem
+ { Name = "tso", AssetID = taskSceneObjectAsset.FullID, ItemID = taskSceneObjectItemId,
+ Type = (int)AssetType.Object, InvType = (int)InventoryType.Object };
+ sop1.Inventory.AddInventoryItem(taskSceneObjectItem, true);
+
+ scene.AddSceneObject(sog1);
+
+ Vector3 rezPos = new Vector3(10, 10, 10);
+ Quaternion rezRot = new Quaternion(0.5f, 0.5f, 0.5f, 0.5f);
+ Vector3 rezVel = new Vector3(2, 2, 2);
+
+ scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0);
+
+ SceneObjectPart rezzedObjectPart = scene.GetSceneObjectPart("tso");
+
+ Assert.That(rezzedObjectPart, Is.Not.Null);
+ Assert.That(rezzedObjectPart.AbsolutePosition, Is.EqualTo(rezPos));
+ Assert.That(rezzedObjectPart.RotationOffset, Is.EqualTo(rezRot));
+
+ // Velocity isn't being set, possibly because we have no physics
+ //Assert.That(rezzedObjectPart.Velocity, Is.EqualTo(rezVel));
+ }
+
///
/// Test MoveTaskInventoryItem where the item has no parent folder assigned.
///
+ ///
/// This should place it in the most suitable user folder.
+ ///
[Test]
public void TestMoveTaskInventoryItem()
{
--
cgit v1.1
From 91a9f30b1613fba8c3ff31de5b9390b0e636ad65 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 20 May 2011 23:34:34 +0100
Subject: implement Scene.GetSceneObjectGroup(UUID fullID) using existing index
---
OpenSim/Region/Framework/Scenes/Scene.cs | 10 ++++++++++
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 16 ++++++++++++++++
2 files changed, 26 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0722cee..f718331 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4279,6 +4279,16 @@ namespace OpenSim.Region.Framework.Scenes
// }
///
+ /// Get a group via its UUID
+ ///
+ ///
+ ///
+ public SceneObjectGroup GetSceneObjectGroup(UUID fullID)
+ {
+ return m_sceneGraph.GetSceneObjectGroup(fullID);
+ }
+
+ ///
/// Get a named prim contained in this scene (will return the first
/// found, if there are more than one prim with the same name)
///
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 14b587f..2d547f7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -976,6 +976,22 @@ namespace OpenSim.Region.Framework.Scenes
}
///
+ /// Get a group in the scene
+ ///
+ /// UUID of the group
+ /// null if no such group was found
+ protected internal SceneObjectGroup GetSceneObjectGroup(UUID fullID)
+ {
+ lock (SceneObjectGroupsByFullID)
+ {
+ if (SceneObjectGroupsByFullID.ContainsKey(fullID))
+ return SceneObjectGroupsByFullID[fullID];
+ }
+
+ return null;
+ }
+
+ ///
/// Get a part contained in this scene.
///
///
--
cgit v1.1
From 4b0fc4faef657cc819dfa360fb6a266532724455 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 20 May 2011 23:41:14 +0100
Subject: implement Scene.GetSceneObjectGroup(string name) to match the
equivalent GetSOP method
---
OpenSim/Region/Framework/Scenes/Scene.cs | 15 +++++++++++--
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 31 ++++++++++++++++++++++++++-
2 files changed, 43 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index f718331..cfb3a5d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4282,14 +4282,25 @@ namespace OpenSim.Region.Framework.Scenes
/// Get a group via its UUID
///
///
- ///
+ /// null if no group with that name exists
public SceneObjectGroup GetSceneObjectGroup(UUID fullID)
{
return m_sceneGraph.GetSceneObjectGroup(fullID);
}
///
- /// Get a named prim contained in this scene (will return the first
+ /// Get a group by name from the scene (will return the first
+ /// found, if there are more than one prim with the same name)
+ ///
+ ///
+ /// null if no group with that name exists
+ public SceneObjectGroup GetSceneObjectGroup(string name)
+ {
+ return m_sceneGraph.GetSceneObjectGroup(name);
+ }
+
+ ///
+ /// Get a prim by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
///
///
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 2d547f7..0cff011 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -992,6 +992,35 @@ namespace OpenSim.Region.Framework.Scenes
}
///
+ /// Get a group by name from the scene (will return the first
+ /// found, if there are more than one prim with the same name)
+ ///
+ ///
+ /// null if the part was not found
+ protected internal SceneObjectGroup GetSceneObjectGroup(string name)
+ {
+ SceneObjectGroup so = null;
+
+ Entities.Find(
+ delegate(EntityBase entity)
+ {
+ if (entity is SceneObjectGroup)
+ {
+ if (entity.Name == name)
+ {
+ so = (SceneObjectGroup)entity;
+ return true;
+ }
+ }
+
+ return false;
+ }
+ );
+
+ return so;
+ }
+
+ ///
/// Get a part contained in this scene.
///
///
@@ -1005,7 +1034,7 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Get a named prim contained in this scene (will return the first
+ /// Get a prim by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
///
///
--
cgit v1.1
From f2095ea2797bd01dc727cdfac052508a17f62dc0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 20 May 2011 23:45:39 +0100
Subject: refactor TestRezObjectFromInventoryItem()
---
OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 73f66cb..4d4974f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -122,14 +122,14 @@ namespace OpenSim.Region.Framework.Tests
scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0);
- SceneObjectPart rezzedObjectPart = scene.GetSceneObjectPart("tso");
+ SceneObjectGroup rezzedObject = scene.GetSceneObjectGroup("tso");
- Assert.That(rezzedObjectPart, Is.Not.Null);
- Assert.That(rezzedObjectPart.AbsolutePosition, Is.EqualTo(rezPos));
- Assert.That(rezzedObjectPart.RotationOffset, Is.EqualTo(rezRot));
+ Assert.That(rezzedObject, Is.Not.Null);
+ Assert.That(rezzedObject.AbsolutePosition, Is.EqualTo(rezPos));
+ Assert.That(rezzedObject.Velocity, Is.EqualTo(rezVel));
- // Velocity isn't being set, possibly because we have no physics
- //Assert.That(rezzedObjectPart.Velocity, Is.EqualTo(rezVel));
+ // Confusingly, this isn't the rezzedObject.Rotation
+ Assert.That(rezzedObject.RootPart.RotationOffset, Is.EqualTo(rezRot));
}
///
--
cgit v1.1
From 90567a9eaac717ab86316c078e148f8fe13432ac Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 00:02:53 +0100
Subject: refactor Scene.RezObject() to use AddNewSceneObject() rather than
copy/pasting code with small differences
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 14 +-------------
OpenSim/Region/Framework/Scenes/Scene.cs | 6 +++---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 17 +++++++++--------
.../Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 5 ++++-
4 files changed, 17 insertions(+), 25 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 7b88f4f..3c47873 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2095,19 +2095,7 @@ namespace OpenSim.Region.Framework.Scenes
sourcePart.Inventory.RemoveInventoryItem(item.ItemID);
}
- AddNewSceneObject(group, true);
-
- group.AbsolutePosition = pos;
- group.Velocity = vel;
-
- if (rot != null)
- group.UpdateGroupRotationR((Quaternion)rot);
-
- // TODO: This needs to be refactored with the similar code in
- // SceneGraph.AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
- // possibly by allowing this method to take a null rotation.
- if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
- group.RootPart.ApplyImpulse((vel * group.GetMass()), false);
+ AddNewSceneObject(group, true, pos, rot, vel);
// We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all.
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index cfb3a5d..b9690fe 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1976,12 +1976,12 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- /// Position of the object
- /// Rotation of the object
+ /// Position of the object. If null then the position stored in the object is used.
+ /// Rotation of the object. If null then the rotation stored in the object is used.
/// Velocity of the object. This parameter only has an effect if the object is physical
///
public bool AddNewSceneObject(
- SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
+ SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
{
if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel))
{
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 0cff011..cdb4e41 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -311,25 +311,26 @@ namespace OpenSim.Region.Framework.Scenes
/// This method does not send updates to the client - callers need to handle this themselves.
///
///
- /// Position of the object
- /// Rotation of the object
+ /// Position of the object. If null then the position stored in the object is used.
+ /// Rotation of the object. If null then the rotation stored in the object is used.
/// Velocity of the object. This parameter only has an effect if the object is physical
///
public bool AddNewSceneObject(
- SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
+ SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
{
AddNewSceneObject(sceneObject, true, false);
- // we set it's position in world.
- sceneObject.AbsolutePosition = pos;
+ if (pos != null)
+ sceneObject.AbsolutePosition = (Vector3)pos;
if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim)
{
sceneObject.ClearPartAttachmentData();
}
-
- sceneObject.UpdateGroupRotationR(rot);
-
+
+ if (rot != null)
+ sceneObject.UpdateGroupRotationR((Quaternion)rot);
+
//group.ApplyPhysics(m_physicalPrim);
if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 4d4974f..222710f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -126,7 +126,10 @@ namespace OpenSim.Region.Framework.Tests
Assert.That(rezzedObject, Is.Not.Null);
Assert.That(rezzedObject.AbsolutePosition, Is.EqualTo(rezPos));
- Assert.That(rezzedObject.Velocity, Is.EqualTo(rezVel));
+
+ // Velocity doesn't get applied, probably because there is no physics in tests (yet)
+// Assert.That(rezzedObject.Velocity, Is.EqualTo(rezVel));
+ Assert.That(rezzedObject.Velocity, Is.EqualTo(Vector3.Zero));
// Confusingly, this isn't the rezzedObject.Rotation
Assert.That(rezzedObject.RootPart.RotationOffset, Is.EqualTo(rezRot));
--
cgit v1.1
From 3fed61a5d5e65c36791317cec85dc130bba1cc82 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 00:07:24 +0100
Subject: refactor: in TaskInventoryTests, use
UserProfileTestUtils.CreateUserWithInvetory()
---
.../Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 222710f..4f5018a 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -53,15 +53,6 @@ namespace OpenSim.Region.Framework.Tests
[TestFixture]
public class TaskInventoryTests
{
- protected UserAccount CreateUser(Scene scene)
- {
- string userFirstName = "Jock";
- string userLastName = "Stirrup";
- string userPassword = "troll";
- UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
- return UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword);
- }
-
protected SceneObjectGroup CreateSO1(Scene scene, UUID ownerId)
{
string part1Name = "part1";
@@ -98,7 +89,7 @@ namespace OpenSim.Region.Framework.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
- UserAccount user1 = CreateUser(scene);
+ UserAccount user1 = UserProfileTestUtils.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
@@ -148,7 +139,7 @@ namespace OpenSim.Region.Framework.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
- UserAccount user1 = CreateUser(scene);
+ UserAccount user1 = UserProfileTestUtils.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
@@ -174,7 +165,7 @@ namespace OpenSim.Region.Framework.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
- UserAccount user1 = CreateUser(scene);
+ UserAccount user1 = UserProfileTestUtils.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
--
cgit v1.1
From 534ee52a121c209752101476e031a2c097637d82 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 00:11:52 +0100
Subject: rename UserProfileTestUtils to UserAccountHelpers to be consistent
with other test helper names
---
OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 4f5018a..e830500 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Region.Framework.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
- UserAccount user1 = UserProfileTestUtils.CreateUserWithInventory(scene);
+ UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Framework.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
- UserAccount user1 = UserProfileTestUtils.CreateUserWithInventory(scene);
+ UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
@@ -165,7 +165,7 @@ namespace OpenSim.Region.Framework.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
- UserAccount user1 = UserProfileTestUtils.CreateUserWithInventory(scene);
+ UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
--
cgit v1.1
From 0050bb438c7138d1deb36609faef8dcbe25348e4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 00:15:22 +0100
Subject: refactor: use SceneSetupHelpers.CreateSceneObject()
---
.../Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index e830500..717517b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -53,16 +53,6 @@ namespace OpenSim.Region.Framework.Tests
[TestFixture]
public class TaskInventoryTests
{
- protected SceneObjectGroup CreateSO1(Scene scene, UUID ownerId)
- {
- string part1Name = "part1";
- UUID part1Id = UUID.Parse("10000000-0000-0000-0000-000000000000");
- SceneObjectPart part1
- = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
- { Name = part1Name, UUID = part1Id };
- return new SceneObjectGroup(part1);
- }
-
protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part)
{
AssetNotecard nc = new AssetNotecard();
@@ -90,7 +80,7 @@ namespace OpenSim.Region.Framework.Tests
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
- SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
+ SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
// Create an object embedded inside the first
@@ -140,7 +130,7 @@ namespace OpenSim.Region.Framework.Tests
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
- SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
+ SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
InventoryFolderBase folder
@@ -166,7 +156,7 @@ namespace OpenSim.Region.Framework.Tests
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
- SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
+ SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
--
cgit v1.1
From 9103fe84d51c21d58c129fd0245c47b0a2b35c60 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 00:25:58 +0100
Subject: move test task inventory notecard item creation into a new
TastInventoryHelpers class
---
.../Framework/Scenes/Tests/TaskInventoryTests.cs | 23 ++--------------------
1 file changed, 2 insertions(+), 21 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 717517b..1c8f078 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -53,25 +53,6 @@ namespace OpenSim.Region.Framework.Tests
[TestFixture]
public class TaskInventoryTests
{
- protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part)
- {
- AssetNotecard nc = new AssetNotecard();
- nc.BodyText = "Hello World!";
- nc.Encode();
- UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
- UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
- AssetBase ncAsset
- = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero);
- scene.AssetService.Store(ncAsset);
- TaskInventoryItem ncItem
- = new TaskInventoryItem
- { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid,
- Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard };
- part.Inventory.AddInventoryItem(ncItem, true);
-
- return ncItem;
- }
-
[Test]
public void TestRezObjectFromInventoryItem()
{
@@ -132,7 +113,7 @@ namespace OpenSim.Region.Framework.Tests
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
- TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
+ TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
InventoryFolderBase folder
= InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0];
@@ -158,7 +139,7 @@ namespace OpenSim.Region.Framework.Tests
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
- TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1);
+ TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
// Perform test
scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID);
--
cgit v1.1
From 084059319c125983ac43534797282ddec394cb59 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 00:37:20 +0100
Subject: refactor: move scene object item creation code into
TaskInventoryHelpers
---
OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 1c8f078..32bb068 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -66,15 +66,8 @@ namespace OpenSim.Region.Framework.Tests
// Create an object embedded inside the first
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
-
- SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero);
- AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
- scene.AssetService.Store(taskSceneObjectAsset);
TaskInventoryItem taskSceneObjectItem
- = new TaskInventoryItem
- { Name = "tso", AssetID = taskSceneObjectAsset.FullID, ItemID = taskSceneObjectItemId,
- Type = (int)AssetType.Object, InvType = (int)InventoryType.Object };
- sop1.Inventory.AddInventoryItem(taskSceneObjectItem, true);
+ = TaskInventoryHelpers.AddSceneObjectItem(scene, sop1, "tso", taskSceneObjectItemId);
scene.AddSceneObject(sog1);
@@ -114,6 +107,7 @@ namespace OpenSim.Region.Framework.Tests
SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
+
InventoryFolderBase folder
= InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0];
--
cgit v1.1
From d7e5b76d73fe3e6d3a7d5506989bd2c081ab4fc6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 00:39:42 +0100
Subject: refactor: rename AddSceneObjectItem to AddSceneObject
---
OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 32bb068..74eab63 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Tests
// Create an object embedded inside the first
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
TaskInventoryItem taskSceneObjectItem
- = TaskInventoryHelpers.AddSceneObjectItem(scene, sop1, "tso", taskSceneObjectItemId);
+ = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId);
scene.AddSceneObject(sog1);
--
cgit v1.1
From bb9b317f1521720a6da98c6f21735126d9c060ce Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 May 2011 01:05:20 +0100
Subject: Get rid of OpenSim.Tests.Common.Setup subpackage in favour of just
OpenSim.Tests.Common instead
---
OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 1 -
OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | 1 -
12 files changed, 12 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
index 855b589..cff649b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
@@ -43,7 +43,6 @@ using OpenSim.Region.CoreModules.World.Serialiser;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
index 667b74e..f69a4b4 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
@@ -37,7 +37,6 @@ using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
index ca635d7..895f2bb 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
@@ -34,7 +34,6 @@ using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index a6a95ef..0a82c4f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -34,7 +34,6 @@ using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index 0d26026..5357a06 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -37,7 +37,6 @@ using OpenSim.Region.CoreModules.World.Permissions;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index bdfcd1d..cb1d531 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -35,7 +35,6 @@ using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
using log4net;
namespace OpenSim.Region.Framework.Scenes.Tests
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
index 8876a43..77bd4c2 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -40,7 +40,6 @@ using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index efb757f..03ac252 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -44,7 +44,6 @@ using OpenSim.Region.CoreModules.World.Serialiser;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index abcce66..13d93f9 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -43,7 +43,6 @@ using OpenSim.Region.CoreModules.World.Serialiser;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Scenes.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
index dd28416..1b5a54e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
@@ -36,7 +36,6 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
using System.Threading;
namespace OpenSim.Region.Framework.Scenes.Tests
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 74eab63..f4e14d4 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -46,7 +46,6 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
-using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.Framework.Tests
{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index dbf9e0f..4da8df1 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -33,7 +33,6 @@ using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
-using OpenSim.Tests.Common.Setup;
using OpenSim.Tests.Common.Mock;
namespace OpenSim.Region.Framework.Scenes.Tests
--
cgit v1.1