aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-02-15 00:27:30 +0000
committerJustin Clark-Casey (justincc)2013-02-15 00:27:30 +0000
commitcc40517863a9a32d3c5af1293623c4466c736c13 (patch)
tree5f2c98f0e0ee662fa3c844cc2f2200d1dbb8ae30
parentAdd regression TestGetArrayLength() (diff)
downloadopensim-SC-cc40517863a9a32d3c5af1293623c4466c736c13.zip
opensim-SC-cc40517863a9a32d3c5af1293623c4466c736c13.tar.gz
opensim-SC-cc40517863a9a32d3c5af1293623c4466c736c13.tar.bz2
opensim-SC-cc40517863a9a32d3c5af1293623c4466c736c13.tar.xz
Add regression TestJsonList2Path()
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs29
1 files changed, 27 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
index a457c7b..68eed1d 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
@@ -53,6 +53,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
53 private Scene m_scene; 53 private Scene m_scene;
54 private MockScriptEngine m_engine; 54 private MockScriptEngine m_engine;
55 private ScriptModuleCommsModule m_smcm; 55 private ScriptModuleCommsModule m_smcm;
56 private JsonStoreScriptModule m_jssm;
56 57
57 [TestFixtureSetUp] 58 [TestFixtureSetUp]
58 public void FixtureInit() 59 public void FixtureInit()
@@ -82,10 +83,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
82 m_engine = new MockScriptEngine(); 83 m_engine = new MockScriptEngine();
83 m_smcm = new ScriptModuleCommsModule(); 84 m_smcm = new ScriptModuleCommsModule();
84 JsonStoreModule jsm = new JsonStoreModule(); 85 JsonStoreModule jsm = new JsonStoreModule();
85 JsonStoreScriptModule jssm = new JsonStoreScriptModule(); 86 m_jssm = new JsonStoreScriptModule();
86 87
87 m_scene = new SceneHelpers().SetupScene(); 88 m_scene = new SceneHelpers().SetupScene();
88 SceneHelpers.SetupSceneModules(m_scene, configSource, m_engine, m_smcm, jsm, jssm); 89 SceneHelpers.SetupSceneModules(m_scene, configSource, m_engine, m_smcm, jsm, m_jssm);
89 90
90 try 91 try
91 { 92 {
@@ -479,6 +480,30 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
479 } 480 }
480 481
481 [Test] 482 [Test]
483 public void TestJsonList2Path()
484 {
485 TestHelpers.InMethod();
486// TestHelpers.EnableLogging();
487
488 // Invoking these methods directly since I just couldn't get comms module invocation to work for some reason
489 // - some confusion with the methods that take a params object[] invocation.
490 {
491 string result = m_jssm.JsonList2Path(UUID.Zero, UUID.Zero, new object[] { "foo" });
492 Assert.That(result, Is.EqualTo("{foo}"));
493 }
494
495 {
496 string result = m_jssm.JsonList2Path(UUID.Zero, UUID.Zero, new object[] { "foo", "bar" });
497 Assert.That(result, Is.EqualTo("{foo}.{bar}"));
498 }
499
500 {
501 string result = m_jssm.JsonList2Path(UUID.Zero, UUID.Zero, new object[] { "foo", 1, "bar" });
502 Assert.That(result, Is.EqualTo("{foo}.[1].{bar}"));
503 }
504 }
505
506 [Test]
482 public void TestJsonSetValue() 507 public void TestJsonSetValue()
483 { 508 {
484 TestHelpers.InMethod(); 509 TestHelpers.InMethod();