Disable json tests for now - I see this is failing on jenkins because mono 2.4.3 doesn't have Funcs >5 params, though mono 2.6 onwards does.

Standardize logging in JsonStoreScriptModule and some minor code formatting.
0.7.4-extended
Justin Clark-Casey (justincc) 2013-01-25 03:19:56 +00:00
parent f1b978cdf0
commit 648932458a
2 changed files with 28 additions and 31 deletions

View File

@ -92,12 +92,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[JsonStoreScripts] initialization error: {0}",e.Message); m_log.ErrorFormat("[JsonStoreScripts]: initialization error: {0}", e.Message);
return; return;
} }
if (m_enabled) if (m_enabled)
m_log.DebugFormat("[JsonStoreScripts] module is enabled"); m_log.DebugFormat("[JsonStoreScripts]: module is enabled");
} }
// ----------------------------------------------------------------- // -----------------------------------------------------------------
@ -150,7 +150,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>(); m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>();
if (m_comms == null) if (m_comms == null)
{ {
m_log.ErrorFormat("[JsonStoreScripts] ScriptModuleComms interface not defined"); m_log.ErrorFormat("[JsonStoreScripts]: ScriptModuleComms interface not defined");
m_enabled = false; m_enabled = false;
return; return;
} }
@ -158,7 +158,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
m_store = m_scene.RequestModuleInterface<IJsonStoreModule>(); m_store = m_scene.RequestModuleInterface<IJsonStoreModule>();
if (m_store == null) if (m_store == null)
{ {
m_log.ErrorFormat("[JsonStoreScripts] JsonModule interface not defined"); m_log.ErrorFormat("[JsonStoreScripts]: JsonModule interface not defined");
m_enabled = false; m_enabled = false;
return; return;
} }
@ -168,10 +168,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
m_comms.RegisterScriptInvocation(this, "JsonCreateStore"); m_comms.RegisterScriptInvocation(this, "JsonCreateStore");
m_comms.RegisterScriptInvocation(this, "JsonDestroyStore"); m_comms.RegisterScriptInvocation(this, "JsonDestroyStore");
m_comms.RegisterScriptInvocation( m_comms.RegisterScriptInvocation(this, "JsonReadNotecard");
this, this.GetType().GetMethod(
"JsonReadNotecard", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(UUID), typeof(UUID), typeof(UUID), typeof(string), typeof(UUID)}, null));
m_comms.RegisterScriptInvocation(this, "JsonWriteNotecard"); m_comms.RegisterScriptInvocation(this, "JsonWriteNotecard");
m_comms.RegisterScriptInvocation(this, "JsonTestPath"); m_comms.RegisterScriptInvocation(this, "JsonTestPath");
@ -357,7 +354,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[JsonStoreScripts] unable to retrieve value; {0}",e.ToString()); m_log.InfoFormat("[JsonStoreScripts]: unable to retrieve value; {0}",e.ToString());
} }
DispatchValue(scriptID,reqID,String.Empty); DispatchValue(scriptID,reqID,String.Empty);
@ -392,7 +389,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[JsonStoreScripts] unable to retrieve value; {0}",e.ToString()); m_log.InfoFormat("[JsonStoreScripts]: unable to retrieve value; {0}",e.ToString());
} }
DispatchValue(scriptID,reqID,String.Empty); DispatchValue(scriptID,reqID,String.Empty);
@ -424,7 +421,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
if (a.Type != (sbyte)AssetType.Notecard) if (a.Type != (sbyte)AssetType.Notecard)
GenerateRuntimeError(String.Format("Invalid notecard asset {0}",assetID)); GenerateRuntimeError(String.Format("Invalid notecard asset {0}",assetID));
m_log.DebugFormat("[JsonStoreScripts] read notecard in context {0}",storeID); m_log.DebugFormat("[JsonStoreScripts]: read notecard in context {0}",storeID);
try try
{ {
@ -435,7 +432,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[JsonStoreScripts] Json parsing failed; {0}",e.Message); m_log.WarnFormat("[JsonStoreScripts]: Json parsing failed; {0}",e.Message);
} }
GenerateRuntimeError(String.Format("Json parsing failed for {0}",assetID.ToString())); GenerateRuntimeError(String.Format("Json parsing failed for {0}",assetID.ToString()));

View File

@ -74,7 +74,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
SceneHelpers.SetupSceneModules(m_scene, configSource, m_engine, m_smcm, jsm, jssm); SceneHelpers.SetupSceneModules(m_scene, configSource, m_engine, m_smcm, jsm, jssm);
} }
[Test] // [Test]
public void TestJsonCreateStore() public void TestJsonCreateStore()
{ {
TestHelpers.InMethod(); TestHelpers.InMethod();
@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
Assert.That(storeId, Is.Not.EqualTo(UUID.Zero)); Assert.That(storeId, Is.Not.EqualTo(UUID.Zero));
} }
[Test] // [Test]
public void TestJsonGetValue() public void TestJsonGetValue()
{ {
TestHelpers.InMethod(); TestHelpers.InMethod();
@ -102,7 +102,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
Assert.That(value, Is.EqualTo("World")); Assert.That(value, Is.EqualTo("World"));
} }
[Test] // [Test]
public void TestJsonTestPath() public void TestJsonTestPath()
{ {
TestHelpers.InMethod(); TestHelpers.InMethod();
@ -119,7 +119,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
Assert.That(result, Is.EqualTo(1)); Assert.That(result, Is.EqualTo(1));
} }
[Test] // [Test]
public void TestJsonSetValue() public void TestJsonSetValue()
{ {
TestHelpers.InMethod(); TestHelpers.InMethod();