diff options
author | Diva Canto | 2009-09-24 15:30:00 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-24 15:30:00 -0700 |
commit | 1faaa0a43a851c44af40336336ddbe3a7dbe83af (patch) | |
tree | ab1ec0d0238fc64b9538c9ecd6d55c71c665de5b /OpenSim/Tests/Clients/Grid | |
parent | Added test GridClient, which allowed me to remove a few bugs out of the new c... (diff) | |
download | opensim-SC_OLD-1faaa0a43a851c44af40336336ddbe3a7dbe83af.zip opensim-SC_OLD-1faaa0a43a851c44af40336336ddbe3a7dbe83af.tar.gz opensim-SC_OLD-1faaa0a43a851c44af40336336ddbe3a7dbe83af.tar.bz2 opensim-SC_OLD-1faaa0a43a851c44af40336336ddbe3a7dbe83af.tar.xz |
GridServerPostHandler finished. GridClient tests all work. More guards on getting parameters and replies over the wire.
Diffstat (limited to 'OpenSim/Tests/Clients/Grid')
-rw-r--r-- | OpenSim/Tests/Clients/Grid/GridClient.cs | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs index 0b84f9b..155f38e 100644 --- a/OpenSim/Tests/Clients/Grid/GridClient.cs +++ b/OpenSim/Tests/Clients/Grid/GridClient.cs | |||
@@ -35,21 +35,21 @@ namespace OpenSim.Tests.Clients.GridClient | |||
35 | GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000); | 35 | GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000); |
36 | GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); | 36 | GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); |
37 | 37 | ||
38 | Console.WriteLine("[GRID CLIENT]: Registering region 1"); | 38 | Console.WriteLine("[GRID CLIENT]: *** Registering region 1"); |
39 | bool success = m_Connector.RegisterRegion(UUID.Zero, r1); | 39 | bool success = m_Connector.RegisterRegion(UUID.Zero, r1); |
40 | if (success) | 40 | if (success) |
41 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 1"); | 41 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 1"); |
42 | else | 42 | else |
43 | Console.WriteLine("[GRID CLIENT]: region 1 failed to register"); | 43 | Console.WriteLine("[GRID CLIENT]: region 1 failed to register"); |
44 | 44 | ||
45 | Console.WriteLine("[GRID CLIENT]: Registering region 2"); | 45 | Console.WriteLine("[GRID CLIENT]: *** Registering region 2"); |
46 | success = m_Connector.RegisterRegion(UUID.Zero, r2); | 46 | success = m_Connector.RegisterRegion(UUID.Zero, r2); |
47 | if (success) | 47 | if (success) |
48 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 2"); | 48 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 2"); |
49 | else | 49 | else |
50 | Console.WriteLine("[GRID CLIENT]: region 2 failed to register"); | 50 | Console.WriteLine("[GRID CLIENT]: region 2 failed to register"); |
51 | 51 | ||
52 | Console.WriteLine("[GRID CLIENT]: Registering region 3"); | 52 | Console.WriteLine("[GRID CLIENT]: *** Registering region 3"); |
53 | success = m_Connector.RegisterRegion(UUID.Zero, r3); | 53 | success = m_Connector.RegisterRegion(UUID.Zero, r3); |
54 | if (success) | 54 | if (success) |
55 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); | 55 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); |
@@ -57,20 +57,20 @@ namespace OpenSim.Tests.Clients.GridClient | |||
57 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); | 57 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); |
58 | 58 | ||
59 | 59 | ||
60 | Console.WriteLine("[GRID CLIENT]: Deregistering region 3"); | 60 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); |
61 | success = m_Connector.DeregisterRegion(r3.RegionID); | 61 | success = m_Connector.DeregisterRegion(r3.RegionID); |
62 | if (success) | 62 | if (success) |
63 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); | 63 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); |
64 | else | 64 | else |
65 | Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); | 65 | Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); |
66 | Console.WriteLine("[GRID CLIENT]: Registering region 3 again"); | 66 | Console.WriteLine("[GRID CLIENT]: *** Registering region 3 again"); |
67 | success = m_Connector.RegisterRegion(UUID.Zero, r3); | 67 | success = m_Connector.RegisterRegion(UUID.Zero, r3); |
68 | if (success) | 68 | if (success) |
69 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); | 69 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); |
70 | else | 70 | else |
71 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); | 71 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); |
72 | 72 | ||
73 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1"); | 73 | Console.WriteLine("[GRID CLIENT]: *** GetNeighbours of region 1"); |
74 | List<GridRegion> regions = m_Connector.GetNeighbours(UUID.Zero, r1.RegionID); | 74 | List<GridRegion> regions = m_Connector.GetNeighbours(UUID.Zero, r1.RegionID); |
75 | if (regions == null) | 75 | if (regions == null) |
76 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 failed"); | 76 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 failed"); |
@@ -85,6 +85,58 @@ namespace OpenSim.Tests.Clients.GridClient | |||
85 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned 0 neighbours"); | 85 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned 0 neighbours"); |
86 | 86 | ||
87 | 87 | ||
88 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of region 2 (this should succeed)"); | ||
89 | GridRegion region = m_Connector.GetRegionByUUID(UUID.Zero, r2.RegionID); | ||
90 | if (region == null) | ||
91 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); | ||
92 | else | ||
93 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); | ||
94 | |||
95 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of non-existent region (this should fail)"); | ||
96 | region = m_Connector.GetRegionByUUID(UUID.Zero, UUID.Random()); | ||
97 | if (region == null) | ||
98 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); | ||
99 | else | ||
100 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); | ||
101 | |||
102 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of region 3 (this should succeed)"); | ||
103 | region = m_Connector.GetRegionByName(UUID.Zero, r3.RegionName); | ||
104 | if (region == null) | ||
105 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); | ||
106 | else | ||
107 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); | ||
108 | |||
109 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of non-existent region (this should fail)"); | ||
110 | region = m_Connector.GetRegionByName(UUID.Zero, "Foo"); | ||
111 | if (region == null) | ||
112 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); | ||
113 | else | ||
114 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); | ||
115 | |||
116 | Console.WriteLine("[GRID CLIENT]: *** GetRegionsByName (this should return 3 regions)"); | ||
117 | regions = m_Connector.GetRegionsByName(UUID.Zero, "Test", 10); | ||
118 | if (regions == null) | ||
119 | Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned null"); | ||
120 | else | ||
121 | Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned " + regions.Count + " regions"); | ||
122 | |||
123 | Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)"); | ||
124 | regions = m_Connector.GetRegionRange(UUID.Zero, | ||
125 | 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize, | ||
126 | 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize); | ||
127 | if (regions == null) | ||
128 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); | ||
129 | else | ||
130 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); | ||
131 | Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 0 regions)"); | ||
132 | regions = m_Connector.GetRegionRange(UUID.Zero, | ||
133 | 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize, | ||
134 | 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize); | ||
135 | if (regions == null) | ||
136 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); | ||
137 | else | ||
138 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); | ||
139 | |||
88 | } | 140 | } |
89 | 141 | ||
90 | private static GridRegion CreateRegion(string name, uint xcell, uint ycell) | 142 | private static GridRegion CreateRegion(string name, uint xcell, uint ycell) |