diff options
author | Jeff Ames | 2008-08-28 14:41:54 +0000 |
---|---|---|
committer | Jeff Ames | 2008-08-28 14:41:54 +0000 |
commit | 3bf88587277b83c0b6f058fabba7d46a3b5a6a00 (patch) | |
tree | ed4ad9dc27e649a6f52661665fb681984251f480 /OpenSim/ApplicationPlugins/Rest/Inventory/tests | |
parent | Thannk you, Ralphos, for a patch the corrects an improper cast in (diff) | |
download | opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.zip opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.gz opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.bz2 opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.xz |
Update svn properties, formatting cleanup.
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/tests')
-rw-r--r-- | OpenSim/ApplicationPlugins/Rest/Inventory/tests/Remote.cs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/tests/Remote.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/tests/Remote.cs index c50a945..1cbe38f 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/tests/Remote.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/tests/Remote.cs | |||
@@ -23,7 +23,6 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | using libsecondlife; | 28 | using libsecondlife; |
@@ -41,10 +40,8 @@ using OpenSim.Framework.Communications.Cache; | |||
41 | 40 | ||
42 | namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | 41 | namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests |
43 | { | 42 | { |
44 | |||
45 | public class Remote : ITest | 43 | public class Remote : ITest |
46 | { | 44 | { |
47 | |||
48 | private static readonly int PARM_TESTID = 0; | 45 | private static readonly int PARM_TESTID = 0; |
49 | private static readonly int PARM_COMMAND = 1; | 46 | private static readonly int PARM_COMMAND = 1; |
50 | 47 | ||
@@ -72,7 +69,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
72 | } | 69 | } |
73 | 70 | ||
74 | // Called by the plug-in to halt REST processing. Local processing is | 71 | // Called by the plug-in to halt REST processing. Local processing is |
75 | // disabled, and control blocks until all current processing has | 72 | // disabled, and control blocks until all current processing has |
76 | // completed. No new processing will be started | 73 | // completed. No new processing will be started |
77 | 74 | ||
78 | public void Close() | 75 | public void Close() |
@@ -91,11 +88,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
91 | // Remote Handler | 88 | // Remote Handler |
92 | // Key information of interest here is the Parameters array, each | 89 | // Key information of interest here is the Parameters array, each |
93 | // entry represents an element of the URI, with element zero being | 90 | // entry represents an element of the URI, with element zero being |
94 | // the | 91 | // the |
95 | 92 | ||
96 | public void Execute(RequestData rdata) | 93 | public void Execute(RequestData rdata) |
97 | { | 94 | { |
98 | |||
99 | if (!enabled) return; | 95 | if (!enabled) return; |
100 | 96 | ||
101 | // If we can't relate to what's there, leave it for others. | 97 | // If we can't relate to what's there, leave it for others. |
@@ -125,7 +121,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
125 | { | 121 | { |
126 | DoHelp(rdata); | 122 | DoHelp(rdata); |
127 | } | 123 | } |
128 | } | 124 | } |
129 | 125 | ||
130 | private void DoHelp(RequestData rdata) | 126 | private void DoHelp(RequestData rdata) |
131 | { | 127 | { |
@@ -138,7 +134,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
138 | { | 134 | { |
139 | if (rdata.Parameters.Length >= 6) | 135 | if (rdata.Parameters.Length >= 6) |
140 | { | 136 | { |
141 | |||
142 | string[] names = rdata.Parameters[PARM_MOVE_AVATAR].Split(Rest.CA_SPACE); | 137 | string[] names = rdata.Parameters[PARM_MOVE_AVATAR].Split(Rest.CA_SPACE); |
143 | ScenePresence avatar = null; | 138 | ScenePresence avatar = null; |
144 | Scene scene = null; | 139 | Scene scene = null; |
@@ -149,7 +144,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
149 | String.Format("invalid avatar name: <{0}>",rdata.Parameters[PARM_MOVE_AVATAR])); | 144 | String.Format("invalid avatar name: <{0}>",rdata.Parameters[PARM_MOVE_AVATAR])); |
150 | } | 145 | } |
151 | 146 | ||
152 | Rest.Log.WarnFormat("{0} '{1}' command received for {2} {3}", | 147 | Rest.Log.WarnFormat("{0} '{1}' command received for {2} {3}", |
153 | MsgId, rdata.Parameters[0], names[0], names[1]); | 148 | MsgId, rdata.Parameters[0], names[0], names[1]); |
154 | 149 | ||
155 | // The first parameter should be an avatar name, look for the | 150 | // The first parameter should be an avatar name, look for the |
@@ -171,8 +166,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
171 | 166 | ||
172 | if (avatar != null) | 167 | if (avatar != null) |
173 | { | 168 | { |
174 | 169 | Rest.Log.DebugFormat("{0} Move : Avatar {1} located in region {2}", | |
175 | Rest.Log.DebugFormat("{0} Move : Avatar {1} located in region {2}", | ||
176 | MsgId, rdata.Parameters[PARM_MOVE_AVATAR], scene.RegionInfo.RegionName); | 170 | MsgId, rdata.Parameters[PARM_MOVE_AVATAR], scene.RegionInfo.RegionName); |
177 | 171 | ||
178 | try | 172 | try |
@@ -185,16 +179,16 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
185 | } | 179 | } |
186 | catch (Exception e) | 180 | catch (Exception e) |
187 | { | 181 | { |
188 | rdata.Fail(Rest.HttpStatusCodeBadRequest, | 182 | rdata.Fail(Rest.HttpStatusCodeBadRequest, |
189 | String.Format("invalid parameters: {0}", e.Message)); | 183 | String.Format("invalid parameters: {0}", e.Message)); |
190 | } | 184 | } |
191 | 185 | ||
192 | } | 186 | } |
193 | else | 187 | else |
194 | { | 188 | { |
195 | rdata.Fail(Rest.HttpStatusCodeBadRequest, | 189 | rdata.Fail(Rest.HttpStatusCodeBadRequest, |
196 | String.Format("avatar {0} not present", rdata.Parameters[PARM_MOVE_AVATAR])); | 190 | String.Format("avatar {0} not present", rdata.Parameters[PARM_MOVE_AVATAR])); |
197 | } | 191 | } |
198 | 192 | ||
199 | rdata.Complete(); | 193 | rdata.Complete(); |
200 | rdata.Respond("OK"); | 194 | rdata.Respond("OK"); |
@@ -205,7 +199,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
205 | Rest.Log.WarnFormat("{0} Move: No movement information provided", MsgId); | 199 | Rest.Log.WarnFormat("{0} Move: No movement information provided", MsgId); |
206 | rdata.Fail(Rest.HttpStatusCodeBadRequest, "no movement information provided"); | 200 | rdata.Fail(Rest.HttpStatusCodeBadRequest, "no movement information provided"); |
207 | } | 201 | } |
208 | |||
209 | } | 202 | } |
210 | 203 | ||
211 | private static readonly string Help = | 204 | private static readonly string Help = |
@@ -220,6 +213,5 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests | |||
220 | + "</body>" | 213 | + "</body>" |
221 | + "</html>" | 214 | + "</html>" |
222 | ; | 215 | ; |
223 | |||
224 | } | 216 | } |
225 | } | 217 | } |