aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-25 01:48:31 +0000
committerJustin Clark-Casey (justincc)2013-01-25 01:48:31 +0000
commitf557d7e82821c931c6ca2faf97c668fa94cacfb0 (patch)
treeef062144c9f79fa68815ce394b2def1906d9393b /OpenSim/Region/OptionalModules/Scripting
parentBulletSim: reduce the force of gravity on ground vehicles when they (diff)
downloadopensim-SC-f557d7e82821c931c6ca2faf97c668fa94cacfb0.zip
opensim-SC-f557d7e82821c931c6ca2faf97c668fa94cacfb0.tar.gz
opensim-SC-f557d7e82821c931c6ca2faf97c668fa94cacfb0.tar.bz2
opensim-SC-f557d7e82821c931c6ca2faf97c668fa94cacfb0.tar.xz
Add basic JsonCreateStore() regression test
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs86
1 files changed, 86 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
new file mode 100644
index 0000000..4b6ddd6
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
@@ -0,0 +1,86 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using System.Text;
32using log4net;
33using Nini.Config;
34using NUnit.Framework;
35using OpenMetaverse;
36using OpenSim.Framework;
37using OpenSim.Region.CoreModules.Scripting.ScriptModuleComms;
38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Region.ScriptEngine.Shared;
40using OpenSim.Region.ScriptEngine.Shared.Api;
41using OpenSim.Services.Interfaces;
42using OpenSim.Tests.Common;
43using OpenSim.Tests.Common.Mock;
44
45namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
46{
47 /// <summary>
48 /// Tests for inventory functions in LSL
49 /// </summary>
50 [TestFixture]
51 public class LSL_ApiInventoryTests : OpenSimTestCase
52 {
53 private Scene m_scene;
54 private MockScriptEngine m_engine;
55 private ScriptModuleCommsModule m_smcm;
56
57 [SetUp]
58 public override void SetUp()
59 {
60 base.SetUp();
61
62 IConfigSource configSource = new IniConfigSource();
63 IConfig jsonStoreConfig = configSource.AddConfig("JsonStore");
64 jsonStoreConfig.Set("Enabled", "true");
65
66 m_engine = new MockScriptEngine();
67 m_smcm = new ScriptModuleCommsModule();
68 JsonStoreModule jsm = new JsonStoreModule();
69 JsonStoreScriptModule jssm = new JsonStoreScriptModule();
70
71 m_scene = new SceneHelpers().SetupScene();
72 SceneHelpers.SetupSceneModules(m_scene, configSource, m_engine, m_smcm, jsm, jssm);
73 }
74
75 [Test]
76 public void TestJsonCreateStore()
77 {
78 TestHelpers.InMethod();
79// log4net.Config.XmlConfigurator.Configure();
80
81 UUID storeId = (UUID)m_smcm.InvokeOperation(UUID.Zero, UUID.Zero, "JsonCreateStore", new object[] { "{}" });
82
83 Assert.That(storeId, Is.Not.EqualTo(UUID.Zero));
84 }
85 }
86} \ No newline at end of file