diff options
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/TestSuite/Main.cs')
-rw-r--r-- | OpenSim/TestSuite/Main.cs | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/OpenSim/TestSuite/Main.cs b/OpenSim/TestSuite/Main.cs deleted file mode 100644 index ee75bf5..0000000 --- a/OpenSim/TestSuite/Main.cs +++ /dev/null | |||
@@ -1,98 +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 Nini.Config; | ||
30 | |||
31 | namespace OpenSim.TestSuite | ||
32 | { | ||
33 | /// <summary> | ||
34 | /// Event Types from the BOT. Add new events here | ||
35 | /// </summary> | ||
36 | public enum EventType : int | ||
37 | { | ||
38 | NONE = 0, | ||
39 | CONNECTED = 1, | ||
40 | DISCONNECTED = 2 | ||
41 | } | ||
42 | |||
43 | public class TestSuite | ||
44 | { | ||
45 | public static void Main(string[] args) | ||
46 | { | ||
47 | // TODO: config parser | ||
48 | |||
49 | // TODO: load tests from addings | ||
50 | |||
51 | // TODO: create base bot cloud for use in tests | ||
52 | |||
53 | IConfig config = ParseConfig(args); | ||
54 | if (config.Get("help") != null || config.Get("loginuri") == null) | ||
55 | { | ||
56 | Help(); | ||
57 | } | ||
58 | else | ||
59 | { | ||
60 | // TODO: unused: int botcount = config.GetInt("botcount", 1); | ||
61 | |||
62 | // BotManager bm = new BotManager(); | ||
63 | |||
64 | Utils.TestPass("Completed Startup"); | ||
65 | } | ||
66 | } | ||
67 | |||
68 | private static IConfig ParseConfig(String[] args) | ||
69 | { | ||
70 | //Set up our nifty config.. thanks to nini | ||
71 | ArgvConfigSource cs = new ArgvConfigSource(args); | ||
72 | |||
73 | // TODO: unused: cs.AddSwitch("Startup", "botcount","n"); | ||
74 | cs.AddSwitch("Startup", "loginuri","l"); | ||
75 | cs.AddSwitch("Startup", "firstname"); | ||
76 | cs.AddSwitch("Startup", "lastname"); | ||
77 | cs.AddSwitch("Startup", "password"); | ||
78 | cs.AddSwitch("Startup", "help","h"); | ||
79 | |||
80 | IConfig ol = cs.Configs["Startup"]; | ||
81 | return ol; | ||
82 | } | ||
83 | |||
84 | private static void Help() | ||
85 | { | ||
86 | Console.WriteLine( | ||
87 | "usage: pCampBot <-loginuri loginuri> [OPTIONS]\n" + | ||
88 | "Spawns a set of bots to test an OpenSim region\n\n" + | ||
89 | " -l, -loginuri loginuri for sim to log into (required)\n" + | ||
90 | // TODO: unused: " -n, -botcount number of bots to start (default: 1)\n" + | ||
91 | " -firstname first name for the bot(s) (default: random string)\n" + | ||
92 | " -lastname lastname for the bot(s) (default: random string)\n" + | ||
93 | " -password password for the bots(s) (default: random string)\n" + | ||
94 | " -h, -help show this message" | ||
95 | ); | ||
96 | } | ||
97 | } | ||
98 | } | ||