diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Tests')
-rw-r--r-- | OpenSim/Framework/Communications/Tests/LoginServiceTests.cs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index 1e1fa73..2dc644a 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Text.RegularExpressions; | ||
31 | using NUnit.Framework; | 32 | using NUnit.Framework; |
32 | using NUnit.Framework.SyntaxHelpers; | 33 | using NUnit.Framework.SyntaxHelpers; |
33 | using Nwc.XmlRpc; | 34 | using Nwc.XmlRpc; |
@@ -43,9 +44,9 @@ namespace OpenSim.Framework.Communications.Tests | |||
43 | /// </summary> | 44 | /// </summary> |
44 | [TestFixture] | 45 | [TestFixture] |
45 | public class LoginServiceTests | 46 | public class LoginServiceTests |
46 | { | 47 | { |
47 | /// <summary> | 48 | /// <summary> |
48 | /// Test the normal response to a login. Does not test authentication. Doesn't yet do what it says on the tin. | 49 | /// Test the normal response to a login. Does not test authentication. |
49 | /// </summary> | 50 | /// </summary> |
50 | [Test] | 51 | [Test] |
51 | public void TestNormalLoginResponse() | 52 | public void TestNormalLoginResponse() |
@@ -54,12 +55,14 @@ namespace OpenSim.Framework.Communications.Tests | |||
54 | 55 | ||
55 | string firstName = "Timmy"; | 56 | string firstName = "Timmy"; |
56 | string lastName = "Mallet"; | 57 | string lastName = "Mallet"; |
58 | string regionExternalName = "localhost"; | ||
59 | IPEndPoint capsEndPoint = new IPEndPoint(IPAddress.Loopback, 9123); | ||
57 | 60 | ||
58 | CommunicationsManager commsManager | 61 | CommunicationsManager commsManager |
59 | = new TestCommunicationsManager(new OpenSim.Framework.NetworkServersInfo(42, 43)); | 62 | = new TestCommunicationsManager(new OpenSim.Framework.NetworkServersInfo(42, 43)); |
60 | 63 | ||
61 | commsManager.GridService.RegisterRegion( | 64 | commsManager.GridService.RegisterRegion( |
62 | new RegionInfo(42, 43, new IPEndPoint(IPAddress.Loopback, 9000), "localhost")); | 65 | new RegionInfo(42, 43, capsEndPoint, regionExternalName)); |
63 | commsManager.GridService.RegionLoginsEnabled = true; | 66 | commsManager.GridService.RegionLoginsEnabled = true; |
64 | 67 | ||
65 | LoginService loginService | 68 | LoginService loginService |
@@ -84,10 +87,17 @@ namespace OpenSim.Framework.Communications.Tests | |||
84 | // TODO: Not check inventory part of response yet. | 87 | // TODO: Not check inventory part of response yet. |
85 | // TODO: Not checking all of login response thoroughly yet. | 88 | // TODO: Not checking all of login response thoroughly yet. |
86 | 89 | ||
90 | Assert.That(responseData["first_name"], Is.EqualTo(firstName)); | ||
91 | Assert.That(responseData["last_name"], Is.EqualTo(lastName)); | ||
87 | Assert.That( | 92 | Assert.That( |
88 | responseData["circuit_code"], Is.GreaterThanOrEqualTo(0) & Is.LessThanOrEqualTo(System.Int32.MaxValue)); | 93 | responseData["circuit_code"], Is.GreaterThanOrEqualTo(0) & Is.LessThanOrEqualTo(System.Int32.MaxValue)); |
89 | Assert.That(responseData["first_name"], Is.EqualTo(firstName)); | 94 | |
90 | Assert.That(responseData["last_name"], Is.EqualTo(lastName)); | 95 | Regex capsSeedPattern |
96 | = new Regex("^http://" | ||
97 | + regionExternalName | ||
98 | + ":9000/CAPS/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{8}0000/$"); | ||
99 | |||
100 | Assert.That(capsSeedPattern.IsMatch((string)responseData["seed_capability"]), Is.True); | ||
91 | } | 101 | } |
92 | } | 102 | } |
93 | } | 103 | } |