root/honeyclient/branches/exp/kindlund-filesystem/t/honeyclient_agent.t

Revision 627, 3.6 kB (checked in by kindlund, 1 year ago)

Merged trunk changes back into filesystem branch.

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: Change Driver::IE to Driver::Browser::IE
33 # Make sure HoneyClient::Agent::Driver::IE loads.
34 BEGIN { use_ok('HoneyClient::Agent::Driver::IE') or diag("Can't load HoneyClient::Agent::Driver::IE package.  Check to make sure the package library is correctly listed within the path."); }
35 require_ok('HoneyClient::Agent::Driver::IE');
36 can_ok('HoneyClient::Agent::Driver::IE', 'new');
37 can_ok('HoneyClient::Agent::Driver::IE', 'drive');
38 can_ok('HoneyClient::Agent::Driver::IE', 'getNextLink');
39 can_ok('HoneyClient::Agent::Driver::IE', 'next');
40 can_ok('HoneyClient::Agent::Driver::IE', 'isFinished');
41 can_ok('HoneyClient::Agent::Driver::IE', 'status');
42 use HoneyClient::Agent::Driver::IE;
43
44 # Make sure Storable loads.
45 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."); }
46 require_ok('Storable');
47 can_ok('Storable', 'freeze');
48 can_ok('Storable', 'nfreeze');
49 can_ok('Storable', 'thaw');
50 can_ok('Storable', 'dclone');
51 use Storable qw(freeze nfreeze thaw dclone);
52
53 # Make sure MIME::Base64 loads.
54 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."); }
55 require_ok('MIME::Base64');
56 can_ok('MIME::Base64', 'encode_base64');
57 can_ok('MIME::Base64', 'decode_base64');
58 use MIME::Base64 qw(encode_base64 decode_base64);
59
60 #XXX: Check to see if the port number should be externalized.
61 # Global test variables.
62 our $PORT = getVar(name      => "port",
63                    namespace => "HoneyClient::Agent");
64 our ($stub, $som);
65 }
66
67
68
69 # =begin testing
70 {
71 # XXX: Test init() method.
72 our $URL = HoneyClient::Agent->init();
73 our $PORT = getVar(name      => "port",
74                    namespace => "HoneyClient::Agent");
75 our $HOST = getVar(name      => "address",
76                    namespace => "HoneyClient::Agent");
77 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.");
78 }
79
80
81
82 # =begin testing
83 {
84 # XXX: Test destroy() method.
85 is(HoneyClient::Agent->destroy(), 1, "destroy()") or diag("Unable to terminate Agent SOAP server.  Be sure to check for any stale or lingering processes.");
86
87 # TODO: delete this.
88 #exit;
89 }
90
91
92
93 # =begin testing
94 {
95 # XXX: Fill this in.
96 1;
97 }
98
99
100
101
102 1;
Note: See TracBrowser for help on using the browser.