diff options
author | Diva Canto | 2015-05-10 21:49:24 -0700 |
---|---|---|
committer | Diva Canto | 2015-05-10 21:49:24 -0700 |
commit | eb9b16d2849de438f20bb269ef3ea93e33f4d18d (patch) | |
tree | 928b4b92efa3d7fc42fd431fecdd0fa5895bbebb /OpenSim | |
parent | Added this form that comes handy for testing the grid service in Robust. (diff) | |
download | opensim-SC-eb9b16d2849de438f20bb269ef3ea93e33f4d18d.zip opensim-SC-eb9b16d2849de438f20bb269ef3ea93e33f4d18d.tar.gz opensim-SC-eb9b16d2849de438f20bb269ef3ea93e33f4d18d.tar.bz2 opensim-SC-eb9b16d2849de438f20bb269ef3ea93e33f4d18d.tar.xz |
Added simple test for IM in Robust too.
Changed Inventory data to use the mock one in Common Tests. (but still not inventory tests)
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Services/HypergridService/HGInstantMessageService.cs | 9 | ||||
-rw-r--r-- | OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs (renamed from OpenSim/Tests/Clients/InstantMessage/IMClient.cs) | 31 |
2 files changed, 15 insertions, 25 deletions
diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index 9b7b278..dde0e6c 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs | |||
@@ -101,7 +101,14 @@ namespace OpenSim.Services.HypergridService | |||
101 | Object[] args = new Object[] { config }; | 101 | Object[] args = new Object[] { config }; |
102 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 102 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
103 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); | 103 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); |
104 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(userAgentService, args); | 104 | try |
105 | { | ||
106 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(userAgentService, args); | ||
107 | } | ||
108 | catch (Exception e) | ||
109 | { | ||
110 | m_log.WarnFormat("[HG IM SERVICE]: Unable to create User Agent Service. Missing config var in [HGInstantMessageService]?"); | ||
111 | } | ||
105 | 112 | ||
106 | m_RegionCache = new ExpiringCache<UUID, GridRegion>(); | 113 | m_RegionCache = new ExpiringCache<UUID, GridRegion>(); |
107 | 114 | ||
diff --git a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs index e7304a2..8f312eb 100644 --- a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs +++ b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs | |||
@@ -28,47 +28,30 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Text; | 30 | using System.Text; |
31 | using System.Reflection; | ||
32 | 31 | ||
33 | using OpenMetaverse; | 32 | using OpenMetaverse; |
34 | using log4net; | 33 | using NUnit.Framework; |
35 | using log4net.Appender; | ||
36 | using log4net.Layout; | ||
37 | 34 | ||
38 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
39 | using OpenSim.Services.Interfaces; | 36 | using OpenSim.Services.Interfaces; |
40 | using OpenSim.Services.Connectors.InstantMessage; | 37 | using OpenSim.Services.Connectors.InstantMessage; |
41 | 38 | ||
42 | namespace OpenSim.Tests.Clients.InstantMessage | 39 | namespace Robust.Tests |
43 | { | 40 | { |
41 | [TestFixture] | ||
44 | public class IMClient | 42 | public class IMClient |
45 | { | 43 | { |
46 | private static readonly ILog m_log = | 44 | [Test] |
47 | LogManager.GetLogger( | 45 | public void HGIM_001() |
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | public static void Main(string[] args) | ||
51 | { | 46 | { |
52 | ConsoleAppender consoleAppender = new ConsoleAppender(); | ||
53 | consoleAppender.Layout = | ||
54 | new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); | ||
55 | log4net.Config.BasicConfigurator.Configure(consoleAppender); | ||
56 | |||
57 | string serverURI = "http://127.0.0.1:8002"; | ||
58 | GridInstantMessage im = new GridInstantMessage(); | 47 | GridInstantMessage im = new GridInstantMessage(); |
59 | im.fromAgentID = new Guid(); | 48 | im.fromAgentID = new Guid(); |
60 | im.toAgentID = new Guid(); | 49 | im.toAgentID = new Guid(); |
61 | im.message = "Hello"; | 50 | im.message = "Hello"; |
62 | im.imSessionID = new Guid(); | 51 | im.imSessionID = new Guid(); |
63 | 52 | ||
64 | bool success = InstantMessageServiceConnector.SendInstantMessage(serverURI, im); | 53 | bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im); |
65 | 54 | Assert.IsFalse(success, "Sending of IM succeeded, but it should have failed"); | |
66 | if (success) | ||
67 | m_log.InfoFormat("[IM CLIENT]: Successfully IMed {0}", serverURI); | ||
68 | else | ||
69 | m_log.InfoFormat("[IM CLIENT]: failed to IM {0}", serverURI); | ||
70 | |||
71 | System.Console.WriteLine("\n"); | ||
72 | } | 55 | } |
73 | 56 | ||
74 | } | 57 | } |