diff options
Diffstat (limited to 'OpenSim/Tests/Clients')
-rw-r--r-- | OpenSim/Tests/Clients/Assets/AssetsClient.cs | 126 | ||||
-rw-r--r-- | OpenSim/Tests/Clients/Grid/GridClient.cs | 205 | ||||
-rw-r--r-- | OpenSim/Tests/Clients/Grid/GridForm.html | 11 | ||||
-rw-r--r-- | OpenSim/Tests/Clients/InstantMessage/IMClient.cs | 75 | ||||
-rw-r--r-- | OpenSim/Tests/Clients/Presence/OpenSim.Server.ini | 33 | ||||
-rw-r--r-- | OpenSim/Tests/Clients/Presence/PresenceClient.cs | 115 | ||||
-rw-r--r-- | OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini | 33 | ||||
-rw-r--r-- | OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs | 144 |
8 files changed, 126 insertions, 616 deletions
diff --git a/OpenSim/Tests/Clients/Assets/AssetsClient.cs b/OpenSim/Tests/Clients/Assets/AssetsClient.cs new file mode 100644 index 0000000..e988d0e --- /dev/null +++ b/OpenSim/Tests/Clients/Assets/AssetsClient.cs | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Net; | ||
31 | using System.Text; | ||
32 | using System.Reflection; | ||
33 | using System.Threading; | ||
34 | |||
35 | using OpenMetaverse; | ||
36 | using log4net; | ||
37 | using log4net.Appender; | ||
38 | using log4net.Layout; | ||
39 | |||
40 | using OpenSim.Framework; | ||
41 | using OpenSim.Services.Interfaces; | ||
42 | using OpenSim.Services.Connectors; | ||
43 | |||
44 | namespace OpenSim.Tests.Clients.AssetsClient | ||
45 | { | ||
46 | public class AssetsClient | ||
47 | { | ||
48 | private static readonly ILog m_log = | ||
49 | LogManager.GetLogger( | ||
50 | MethodBase.GetCurrentMethod().DeclaringType); | ||
51 | |||
52 | private static int m_MaxThreadID = 0; | ||
53 | private static readonly int NREQS = 150; | ||
54 | private static int m_NReceived = 0; | ||
55 | |||
56 | public static void Main(string[] args) | ||
57 | { | ||
58 | ConsoleAppender consoleAppender = new ConsoleAppender(); | ||
59 | consoleAppender.Layout = | ||
60 | new PatternLayout("[%thread] - %message%newline"); | ||
61 | log4net.Config.BasicConfigurator.Configure(consoleAppender); | ||
62 | |||
63 | string serverURI = "http://127.0.0.1:8003"; | ||
64 | if (args.Length > 1) | ||
65 | serverURI = args[1]; | ||
66 | int max1, max2; | ||
67 | ThreadPool.GetMaxThreads(out max1, out max2); | ||
68 | m_log.InfoFormat("[ASSET CLIENT]: Connecting to {0} max threads = {1} - {2}", serverURI, max1, max2); | ||
69 | ThreadPool.GetMinThreads(out max1, out max2); | ||
70 | m_log.InfoFormat("[ASSET CLIENT]: Connecting to {0} min threads = {1} - {2}", serverURI, max1, max2); | ||
71 | |||
72 | if (!ThreadPool.SetMinThreads(1, 1)) | ||
73 | m_log.WarnFormat("[ASSET CLIENT]: Failed to set min threads"); | ||
74 | |||
75 | if (!ThreadPool.SetMaxThreads(10, 3)) | ||
76 | m_log.WarnFormat("[ASSET CLIENT]: Failed to set max threads"); | ||
77 | |||
78 | ThreadPool.GetMaxThreads(out max1, out max2); | ||
79 | m_log.InfoFormat("[ASSET CLIENT]: Post set max threads = {1} - {2}", serverURI, max1, max2); | ||
80 | ThreadPool.GetMinThreads(out max1, out max2); | ||
81 | m_log.InfoFormat("[ASSET CLIENT]: Post set min threads = {1} - {2}", serverURI, max1, max2); | ||
82 | |||
83 | ServicePointManager.DefaultConnectionLimit = 12; | ||
84 | |||
85 | AssetServicesConnector m_Connector = new AssetServicesConnector(serverURI); | ||
86 | m_Connector.MaxAssetRequestConcurrency = 30; | ||
87 | |||
88 | for (int i = 0; i < NREQS; i++) | ||
89 | { | ||
90 | UUID uuid = UUID.Random(); | ||
91 | m_Connector.Get(uuid.ToString(), null, ResponseReceived); | ||
92 | m_log.InfoFormat("[ASSET CLIENT]: [{0}] requested asset {1}", i, uuid); | ||
93 | } | ||
94 | |||
95 | for (int i = 0; i < 500; i++) | ||
96 | { | ||
97 | var x = i; | ||
98 | ThreadPool.QueueUserWorkItem(delegate | ||
99 | { | ||
100 | Dummy(x); | ||
101 | }); | ||
102 | } | ||
103 | |||
104 | Thread.Sleep(30 * 1000); | ||
105 | m_log.InfoFormat("[ASSET CLIENT]: Received responses {0}", m_NReceived); | ||
106 | } | ||
107 | |||
108 | private static void ResponseReceived(string id, Object sender, AssetBase asset) | ||
109 | { | ||
110 | if (Thread.CurrentThread.ManagedThreadId > m_MaxThreadID) | ||
111 | m_MaxThreadID = Thread.CurrentThread.ManagedThreadId; | ||
112 | int max1, max2; | ||
113 | ThreadPool.GetAvailableThreads(out max1, out max2); | ||
114 | m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3}) {4}", id, m_MaxThreadID, max1, max2, DateTime.Now.ToString("hh:mm:ss")); | ||
115 | m_NReceived++; | ||
116 | } | ||
117 | |||
118 | private static void Dummy(int i) | ||
119 | { | ||
120 | int max1, max2; | ||
121 | ThreadPool.GetAvailableThreads(out max1, out max2); | ||
122 | m_log.InfoFormat("[ASSET CLIENT]: ({0}) Hello! {1} - {2} {3}", i, max1, max2, DateTime.Now.ToString("hh:mm:ss")); | ||
123 | Thread.Sleep(2000); | ||
124 | } | ||
125 | } | ||
126 | } | ||
diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs deleted file mode 100644 index 8e33373..0000000 --- a/OpenSim/Tests/Clients/Grid/GridClient.cs +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using System.Reflection; | ||
32 | |||
33 | using OpenMetaverse; | ||
34 | using log4net; | ||
35 | using log4net.Appender; | ||
36 | using log4net.Layout; | ||
37 | |||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
41 | using OpenSim.Services.Connectors; | ||
42 | |||
43 | namespace OpenSim.Tests.Clients.GridClient | ||
44 | { | ||
45 | public class GridClient | ||
46 | { | ||
47 | // private static readonly ILog m_log = | ||
48 | // LogManager.GetLogger( | ||
49 | // MethodBase.GetCurrentMethod().DeclaringType); | ||
50 | |||
51 | public static void Main(string[] args) | ||
52 | { | ||
53 | ConsoleAppender consoleAppender = new ConsoleAppender(); | ||
54 | consoleAppender.Layout = | ||
55 | new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); | ||
56 | log4net.Config.BasicConfigurator.Configure(consoleAppender); | ||
57 | |||
58 | string serverURI = "http://127.0.0.1:8001"; | ||
59 | GridServicesConnector m_Connector = new GridServicesConnector(serverURI); | ||
60 | |||
61 | GridRegion r1 = CreateRegion("Test Region 1", 1000, 1000); | ||
62 | GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000); | ||
63 | GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); | ||
64 | |||
65 | Console.WriteLine("[GRID CLIENT]: *** Registering region 1"); | ||
66 | string msg = m_Connector.RegisterRegion(UUID.Zero, r1); | ||
67 | if (msg == String.Empty) | ||
68 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 1"); | ||
69 | else | ||
70 | Console.WriteLine("[GRID CLIENT]: region 1 failed to register"); | ||
71 | |||
72 | Console.WriteLine("[GRID CLIENT]: *** Registering region 2"); | ||
73 | msg = m_Connector.RegisterRegion(UUID.Zero, r2); | ||
74 | if (msg == String.Empty) | ||
75 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 2"); | ||
76 | else | ||
77 | Console.WriteLine("[GRID CLIENT]: region 2 failed to register"); | ||
78 | |||
79 | Console.WriteLine("[GRID CLIENT]: *** Registering region 3"); | ||
80 | msg = m_Connector.RegisterRegion(UUID.Zero, r3); | ||
81 | if (msg == String.Empty) | ||
82 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); | ||
83 | else | ||
84 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); | ||
85 | |||
86 | |||
87 | bool success; | ||
88 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); | ||
89 | success = m_Connector.DeregisterRegion(r3.RegionID); | ||
90 | if (success) | ||
91 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); | ||
92 | else | ||
93 | Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); | ||
94 | Console.WriteLine("[GRID CLIENT]: *** Registering region 3 again"); | ||
95 | msg = m_Connector.RegisterRegion(UUID.Zero, r3); | ||
96 | if (msg == String.Empty) | ||
97 | Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); | ||
98 | else | ||
99 | Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); | ||
100 | |||
101 | Console.WriteLine("[GRID CLIENT]: *** GetNeighbours of region 1"); | ||
102 | List<GridRegion> regions = m_Connector.GetNeighbours(UUID.Zero, r1.RegionID); | ||
103 | if (regions == null) | ||
104 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 failed"); | ||
105 | else if (regions.Count > 0) | ||
106 | { | ||
107 | if (regions.Count != 1) | ||
108 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned more neighbours than expected: " + regions.Count); | ||
109 | else | ||
110 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned the right neighbour " + regions[0].RegionName); | ||
111 | } | ||
112 | else | ||
113 | Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned 0 neighbours"); | ||
114 | |||
115 | |||
116 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of region 2 (this should succeed)"); | ||
117 | GridRegion region = m_Connector.GetRegionByUUID(UUID.Zero, r2.RegionID); | ||
118 | if (region == null) | ||
119 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); | ||
120 | else | ||
121 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); | ||
122 | |||
123 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of non-existent region (this should fail)"); | ||
124 | region = m_Connector.GetRegionByUUID(UUID.Zero, UUID.Random()); | ||
125 | if (region == null) | ||
126 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); | ||
127 | else | ||
128 | Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); | ||
129 | |||
130 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of region 3 (this should succeed)"); | ||
131 | region = m_Connector.GetRegionByName(UUID.Zero, r3.RegionName); | ||
132 | if (region == null) | ||
133 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); | ||
134 | else | ||
135 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); | ||
136 | |||
137 | Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of non-existent region (this should fail)"); | ||
138 | region = m_Connector.GetRegionByName(UUID.Zero, "Foo"); | ||
139 | if (region == null) | ||
140 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); | ||
141 | else | ||
142 | Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); | ||
143 | |||
144 | Console.WriteLine("[GRID CLIENT]: *** GetRegionsByName (this should return 3 regions)"); | ||
145 | regions = m_Connector.GetRegionsByName(UUID.Zero, "Test", 10); | ||
146 | if (regions == null) | ||
147 | Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned null"); | ||
148 | else | ||
149 | Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned " + regions.Count + " regions"); | ||
150 | |||
151 | Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)"); | ||
152 | regions = m_Connector.GetRegionRange(UUID.Zero, | ||
153 | 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize, | ||
154 | 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize); | ||
155 | if (regions == null) | ||
156 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); | ||
157 | else | ||
158 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); | ||
159 | Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 0 regions)"); | ||
160 | regions = m_Connector.GetRegionRange(UUID.Zero, | ||
161 | 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize, | ||
162 | 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize); | ||
163 | if (regions == null) | ||
164 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); | ||
165 | else | ||
166 | Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); | ||
167 | |||
168 | Console.Write("Proceed to deregister? Press enter..."); | ||
169 | Console.ReadLine(); | ||
170 | |||
171 | // Deregister them all | ||
172 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 1"); | ||
173 | success = m_Connector.DeregisterRegion(r1.RegionID); | ||
174 | if (success) | ||
175 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 1"); | ||
176 | else | ||
177 | Console.WriteLine("[GRID CLIENT]: region 1 failed to deregister"); | ||
178 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 2"); | ||
179 | success = m_Connector.DeregisterRegion(r2.RegionID); | ||
180 | if (success) | ||
181 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 2"); | ||
182 | else | ||
183 | Console.WriteLine("[GRID CLIENT]: region 2 failed to deregister"); | ||
184 | Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); | ||
185 | success = m_Connector.DeregisterRegion(r3.RegionID); | ||
186 | if (success) | ||
187 | Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); | ||
188 | else | ||
189 | Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); | ||
190 | |||
191 | } | ||
192 | |||
193 | private static GridRegion CreateRegion(string name, uint xcell, uint ycell) | ||
194 | { | ||
195 | GridRegion region = new GridRegion(xcell, ycell); | ||
196 | region.RegionName = name; | ||
197 | region.RegionID = UUID.Random(); | ||
198 | region.ExternalHostName = "127.0.0.1"; | ||
199 | region.HttpPort = 9000; | ||
200 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); | ||
201 | |||
202 | return region; | ||
203 | } | ||
204 | } | ||
205 | } | ||
diff --git a/OpenSim/Tests/Clients/Grid/GridForm.html b/OpenSim/Tests/Clients/Grid/GridForm.html deleted file mode 100644 index 252920f..0000000 --- a/OpenSim/Tests/Clients/Grid/GridForm.html +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | <html> | ||
2 | |||
3 | <form name="input" action="http://127.0.0.1:8002/grid" method="post"> | ||
4 | xmin:<input type="text" name="XMIN" value="0"> | ||
5 | xmax:<input type="text" name="XMAX" value="0"> | ||
6 | ymin:<input type="text" name="YMIN" value="0"> | ||
7 | ymax:<input type="text" name="YMAX" value="0"> | ||
8 | <input type="hidden" name="METHOD" value="get_region_range"> | ||
9 | <input type="submit" value="Submit" /> | ||
10 | </form> | ||
11 | </html> | ||
diff --git a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs b/OpenSim/Tests/Clients/InstantMessage/IMClient.cs deleted file mode 100644 index e7304a2..0000000 --- a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using System.Reflection; | ||
32 | |||
33 | using OpenMetaverse; | ||
34 | using log4net; | ||
35 | using log4net.Appender; | ||
36 | using log4net.Layout; | ||
37 | |||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using OpenSim.Services.Connectors.InstantMessage; | ||
41 | |||
42 | namespace OpenSim.Tests.Clients.InstantMessage | ||
43 | { | ||
44 | public class IMClient | ||
45 | { | ||
46 | private static readonly ILog m_log = | ||
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | public static void Main(string[] args) | ||
51 | { | ||
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(); | ||
59 | im.fromAgentID = new Guid(); | ||
60 | im.toAgentID = new Guid(); | ||
61 | im.message = "Hello"; | ||
62 | im.imSessionID = new Guid(); | ||
63 | |||
64 | bool success = InstantMessageServiceConnector.SendInstantMessage(serverURI, im); | ||
65 | |||
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 | } | ||
73 | |||
74 | } | ||
75 | } | ||
diff --git a/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini b/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini deleted file mode 100644 index 8610c78..0000000 --- a/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | ; * Run a ROBUST server shell like this, from bin: | ||
2 | ; * $ OpenSim.Server.exe -inifile ../OpenSim/Tests/Clients/Presence/OpenSim.Server.ini | ||
3 | ; * | ||
4 | ; * Then run this client like this, from bin: | ||
5 | ; * $ OpenSim.Tests.Clients.PresenceClient.exe | ||
6 | ; * | ||
7 | ; * | ||
8 | |||
9 | [Startup] | ||
10 | ServiceConnectors = "OpenSim.Server.Handlers.dll:PresenceServiceConnector" | ||
11 | |||
12 | ; * This is common for all services, it's the network setup for the entire | ||
13 | ; * server instance | ||
14 | ; * | ||
15 | [Network] | ||
16 | port = 8003 | ||
17 | |||
18 | ; * The following are for the remote console | ||
19 | ; * They have no effect for the local or basic console types | ||
20 | ; * Leave commented to diable logins to the console | ||
21 | ;ConsoleUser = Test | ||
22 | ;ConsolePass = secret | ||
23 | |||
24 | ; * As an example, the below configuration precisely mimicks the legacy | ||
25 | ; * asset server. It is read by the asset IN connector (defined above) | ||
26 | ; * and it then loads the OUT connector (a local database module). That, | ||
27 | ; * in turn, reads the asset loader and database connection information | ||
28 | ; * | ||
29 | [PresenceService] | ||
30 | LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService" | ||
31 | StorageProvider = "OpenSim.Data.MySQL.dll" | ||
32 | ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;Old Guids=true;" | ||
33 | |||
diff --git a/OpenSim/Tests/Clients/Presence/PresenceClient.cs b/OpenSim/Tests/Clients/Presence/PresenceClient.cs deleted file mode 100644 index fd3905a..0000000 --- a/OpenSim/Tests/Clients/Presence/PresenceClient.cs +++ /dev/null | |||
@@ -1,115 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using System.Reflection; | ||
32 | |||
33 | using OpenMetaverse; | ||
34 | using log4net; | ||
35 | using log4net.Appender; | ||
36 | using log4net.Layout; | ||
37 | |||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using OpenSim.Services.Connectors; | ||
41 | |||
42 | namespace OpenSim.Tests.Clients.PresenceClient | ||
43 | { | ||
44 | public class PresenceClient | ||
45 | { | ||
46 | private static readonly ILog m_log = | ||
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | public static void Main(string[] args) | ||
51 | { | ||
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:8003"; | ||
58 | PresenceServicesConnector m_Connector = new PresenceServicesConnector(serverURI); | ||
59 | |||
60 | UUID user1 = UUID.Random(); | ||
61 | UUID session1 = UUID.Random(); | ||
62 | UUID region1 = UUID.Random(); | ||
63 | |||
64 | bool success = m_Connector.LoginAgent(user1.ToString(), session1, UUID.Zero); | ||
65 | if (success) | ||
66 | m_log.InfoFormat("[PRESENCE CLIENT]: Successfully logged in user {0} with session {1}", user1, session1); | ||
67 | else | ||
68 | m_log.InfoFormat("[PRESENCE CLIENT]: failed to login user {0}", user1); | ||
69 | |||
70 | System.Console.WriteLine("\n"); | ||
71 | |||
72 | PresenceInfo pinfo = m_Connector.GetAgent(session1); | ||
73 | if (pinfo == null) | ||
74 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0}", user1); | ||
75 | else | ||
76 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}", | ||
77 | pinfo.UserID, pinfo.RegionID); | ||
78 | |||
79 | System.Console.WriteLine("\n"); | ||
80 | success = m_Connector.ReportAgent(session1, region1); | ||
81 | if (success) | ||
82 | m_log.InfoFormat("[PRESENCE CLIENT]: Successfully reported session {0} in region {1}", user1, region1); | ||
83 | else | ||
84 | m_log.InfoFormat("[PRESENCE CLIENT]: failed to report session {0}", session1); | ||
85 | pinfo = m_Connector.GetAgent(session1); | ||
86 | if (pinfo == null) | ||
87 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for second time", user1); | ||
88 | else | ||
89 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={2}", | ||
90 | pinfo.UserID, pinfo.RegionID); | ||
91 | |||
92 | System.Console.WriteLine("\n"); | ||
93 | success = m_Connector.LogoutAgent(session1); | ||
94 | if (success) | ||
95 | m_log.InfoFormat("[PRESENCE CLIENT]: Successfully logged out user {0}", user1); | ||
96 | else | ||
97 | m_log.InfoFormat("[PRESENCE CLIENT]: failed to logout user {0}", user1); | ||
98 | pinfo = m_Connector.GetAgent(session1); | ||
99 | if (pinfo == null) | ||
100 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for fourth time", user1); | ||
101 | else | ||
102 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}", | ||
103 | pinfo.UserID, pinfo.RegionID); | ||
104 | |||
105 | System.Console.WriteLine("\n"); | ||
106 | success = m_Connector.ReportAgent(session1, UUID.Random()); | ||
107 | if (success) | ||
108 | m_log.InfoFormat("[PRESENCE CLIENT]: Report agent succeeded, but this is wrong"); | ||
109 | else | ||
110 | m_log.InfoFormat("[PRESENCE CLIENT]: failed to report agent, as it should because user is not logged in"); | ||
111 | |||
112 | } | ||
113 | |||
114 | } | ||
115 | } | ||
diff --git a/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini b/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini deleted file mode 100644 index 453e17e..0000000 --- a/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | ; * Run a ROBUST server shell like this, from bin: | ||
2 | ; * $ OpenSim.Server.exe -inifile ../OpenSim/Tests/Clients/Presence/OpenSim.Server.ini | ||
3 | ; * | ||
4 | ; * Then run this client like this, from bin: | ||
5 | ; * $ OpenSim.Tests.Clients.UserAccountClient.exe | ||
6 | ; * | ||
7 | ; * | ||
8 | |||
9 | [Startup] | ||
10 | ServiceConnectors = "OpenSim.Server.Handlers.dll:UserAccountServiceConnector" | ||
11 | |||
12 | ; * This is common for all services, it's the network setup for the entire | ||
13 | ; * server instance | ||
14 | ; * | ||
15 | [Network] | ||
16 | port = 8003 | ||
17 | |||
18 | ; * The following are for the remote console | ||
19 | ; * They have no effect for the local or basic console types | ||
20 | ; * Leave commented to diable logins to the console | ||
21 | ;ConsoleUser = Test | ||
22 | ;ConsolePass = secret | ||
23 | |||
24 | ; * As an example, the below configuration precisely mimicks the legacy | ||
25 | ; * asset server. It is read by the asset IN connector (defined above) | ||
26 | ; * and it then loads the OUT connector (a local database module). That, | ||
27 | ; * in turn, reads the asset loader and database connection information | ||
28 | ; * | ||
29 | [UserAccountService] | ||
30 | LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" | ||
31 | StorageProvider = "OpenSim.Data.MySQL.dll" | ||
32 | ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;Old Guids=true;" | ||
33 | |||
diff --git a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs deleted file mode 100644 index 1e0a35b..0000000 --- a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs +++ /dev/null | |||
@@ -1,144 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using System.Reflection; | ||
32 | |||
33 | using OpenMetaverse; | ||
34 | using log4net; | ||
35 | using log4net.Appender; | ||
36 | using log4net.Layout; | ||
37 | |||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using OpenSim.Services.Connectors; | ||
41 | |||
42 | namespace OpenSim.Tests.Clients.PresenceClient | ||
43 | { | ||
44 | public class UserAccountsClient | ||
45 | { | ||
46 | private static readonly ILog m_log = | ||
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | public static void Main(string[] args) | ||
51 | { | ||
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:8003"; | ||
58 | UserAccountServicesConnector m_Connector = new UserAccountServicesConnector(serverURI); | ||
59 | |||
60 | UUID user1 = UUID.Random(); | ||
61 | string first = "Completely"; | ||
62 | string last = "Clueless"; | ||
63 | string email = "foo@bar.com"; | ||
64 | |||
65 | //UserAccount account = new UserAccount(user1); | ||
66 | //account.ScopeID = UUID.Zero; | ||
67 | //account.FirstName = first; | ||
68 | //account.LastName = last; | ||
69 | //account.Email = email; | ||
70 | //account.ServiceURLs = new Dictionary<string, object>(); | ||
71 | //account.ServiceURLs.Add("InventoryServerURI", "http://cnn.com"); | ||
72 | //account.ServiceURLs.Add("AssetServerURI", "http://cnn.com"); | ||
73 | |||
74 | //bool success = m_Connector.StoreUserAccount(account); | ||
75 | //if (success) | ||
76 | // m_log.InfoFormat("[USER CLIENT]: Successfully created account for user {0} {1}", account.FirstName, account.LastName); | ||
77 | //else | ||
78 | // m_log.InfoFormat("[USER CLIENT]: failed to create user {0} {1}", account.FirstName, account.LastName); | ||
79 | |||
80 | //System.Console.WriteLine("\n"); | ||
81 | |||
82 | //account = m_Connector.GetUserAccount(UUID.Zero, user1); | ||
83 | //if (account == null) | ||
84 | // m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); | ||
85 | //else | ||
86 | //{ | ||
87 | // m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
88 | // account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
89 | // foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
90 | // m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
91 | //} | ||
92 | |||
93 | //System.Console.WriteLine("\n"); | ||
94 | |||
95 | UserAccount account = m_Connector.GetUserAccount(UUID.Zero, first, last); | ||
96 | if (account == null) | ||
97 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by name "); | ||
98 | else | ||
99 | { | ||
100 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
101 | account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
102 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
103 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
104 | } | ||
105 | |||
106 | System.Console.WriteLine("\n"); | ||
107 | account = m_Connector.GetUserAccount(UUID.Zero, email); | ||
108 | if (account == null) | ||
109 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by email"); | ||
110 | else | ||
111 | { | ||
112 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
113 | account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
114 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
115 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
116 | } | ||
117 | |||
118 | System.Console.WriteLine("\n"); | ||
119 | account = m_Connector.GetUserAccount(UUID.Zero, user1); | ||
120 | if (account == null) | ||
121 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); | ||
122 | else | ||
123 | { | ||
124 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
125 | account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
126 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
127 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
128 | } | ||
129 | |||
130 | System.Console.WriteLine("\n"); | ||
131 | account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); | ||
132 | if (account == null) | ||
133 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve account 'DoesNot Exist'"); | ||
134 | else | ||
135 | { | ||
136 | m_log.InfoFormat("[USER CLIENT]: Account 'DoesNot Exist' retrieved correctly. REALLY??? userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
137 | account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
138 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
139 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
140 | } | ||
141 | } | ||
142 | |||
143 | } | ||
144 | } | ||