root/honeyclient/branches/rel/1.0/t/honeyclient_agent.t

Revision 751, 3.7 kB (checked in by kindlund, 1 year ago)

sva: merging branch using tags svn+ssh://kindlund@www.honeyclient.org/home/svn/honeyclient/honeyclient/tags/exp/PRE-kindlund-firefox and svn+ssh://kindlund@www.honeyclient.org/home/svn/honeyclient/honeyclient/branches/exp/kindlund-firefox

Line 
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Test::More 'no_plan';
5 $| = 1;
6
7
8
9 # =begin testing
10 {
11 # Make sure the module loads properly, with the exportable
12 # functions shared.
13 BEGIN { use_ok('HoneyClient::Agent') or diag("Can't load HoneyClient::Agent package.  Check to make sure the package library is correctly listed within the path."); }
14 require_ok('HoneyClient::Agent');
15 can_ok('HoneyClient::Agent', 'init');
16 can_ok('HoneyClient::Agent', 'destroy');
17 use HoneyClient::Agent;
18
19 # Make sure HoneyClient::Util::SOAP loads.
20 BEGIN { use_ok('HoneyClient::Util::SOAP', qw(getServerHandle getClientHandle)) or diag("Can't load HoneyClient::Util::SOAP package.  Check to make sure the package library is correctly listed within the path."); }
21 require_ok('HoneyClient::Util::SOAP');
22 can_ok('HoneyClient::Util::SOAP', 'getServerHandle');
23 can_ok('HoneyClient::Util::SOAP', 'getClientHandle');
24 use HoneyClient::Util::SOAP qw(getServerHandle getClientHandle);
25
26 # Make sure HoneyClient::Util::Config loads.
27 BEGIN { use_ok('HoneyClient::Util::Config', qw(getVar)) or diag("Can't load HoneyClient::Util::Config package.  Check to make sure the package library is correctly listed within the path."); }
28 require_ok('HoneyClient::Util::Config');
29 can_ok('HoneyClient::Util::Config', 'getVar');
30 use HoneyClient::Util::Config qw(getVar);
31
32 # TODO: Include FF
33 # Make sure HoneyClient::Agent::Driver::Browser::IE loads.
34 BEGIN { use_ok('HoneyClient::Agent::Driver::Browser::IE') or diag("Can't load HoneyClient::Agent::Driver::Browser::IE package.  Check to make sure the package library is correctly listed within the path."); }
35 require_ok('HoneyClient::Agent::Driver::Browser::IE');
36 # TODO: Update this list of function names.
37 can_ok('HoneyClient::Agent::Driver::Browser::IE', 'new');
38 can_ok('HoneyClient::Agent::Driver::Browser::IE', 'drive');
39 can_ok('HoneyClient::Agent::Driver::Browser::IE', 'getNextLink');
40 can_ok('HoneyClient::Agent::Driver::Browser::IE', 'next');
41 can_ok('HoneyClient::Agent::Driver::Browser::IE', 'isFinished');
42 can_ok('HoneyClient::Agent::Driver::Browser::IE', 'status');
43 use HoneyClient::Agent::Driver::Browser::IE;
44
45 # Make sure Storable loads.
46 BEGIN { use_ok('Storable', qw(freeze nfreeze thaw dclone)) or diag("Can't load Storable package.  Check to make sure the package library is correctly listed within the path."); }
47 require_ok('Storable');
48 can_ok('Storable', 'freeze');
49 can_ok('Storable', 'nfreeze');
50 can_ok('Storable', 'thaw');
51 can_ok('Storable', 'dclone');
52 use Storable qw(freeze nfreeze thaw dclone);
53
54 # Make sure MIME::Base64 loads.
55 BEGIN { use_ok('MIME::Base64', qw(encode_base64 decode_base64)) or diag("Can't load MIME::Base64 package.  Check to make sure the package library is correctly listed within the path."); }
56 require_ok('MIME::Base64');
57 can_ok('MIME::Base64', 'encode_base64');
58 can_ok('MIME::Base64', 'decode_base64');
59 use MIME::Base64 qw(encode_base64 decode_base64);
60
61 #XXX: Check to see if the port number should be externalized.
62 # Global test variables.
63 our $PORT = getVar(name      => "port",
64                    namespace => "HoneyClient::Agent");
65 our ($stub, $som);
66 }
67
68
69
70 # =begin testing
71 {
72 # XXX: Test init() method.
73 our $URL = HoneyClient::Agent->init();
74 our $PORT = getVar(name      => "port",
75                    namespace => "HoneyClient::Agent");
76 our $HOST = getVar(name      => "address",
77                    namespace => "HoneyClient::Agent");
78 is($URL, "http://$HOST:$PORT/HoneyClient/Agent", "init()") or diag("Failed to start up the VM SOAP server.  Check to see if any other daemon is listening on TCP port $PORT.");
79 }
80
81
82
83 # =begin testing
84 {
85 # XXX: Test destroy() method.
86 is(HoneyClient::Agent->destroy(), 1, "destroy()") or diag("Unable to terminate Agent SOAP server.  Be sure to check for any stale or lingering processes.");
87
88 # TODO: delete this.
89 #exit;
90 }
91
92
93
94
95 1;
Note: See TracBrowser for help on using the browser.