| 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 ExtUtils::MakeMaker loads. |
|---|
| 12 |
BEGIN { use_ok('ExtUtils::MakeMaker', qw(prompt)) or diag("Can't load ExtUtils::MakeMaker package. Check to make sure the package library is correctly listed within the path."); } |
|---|
| 13 |
require_ok('ExtUtils::MakeMaker'); |
|---|
| 14 |
can_ok('ExtUtils::MakeMaker', 'prompt'); |
|---|
| 15 |
use ExtUtils::MakeMaker qw(prompt); |
|---|
| 16 |
|
|---|
| 17 |
# Make sure Log::Log4perl loads |
|---|
| 18 |
BEGIN { use_ok('Log::Log4perl', qw(:nowarn)) |
|---|
| 19 |
or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly listed within the path."); |
|---|
| 20 |
|
|---|
| 21 |
# Suppress all logging messages, since we need clean output for unit testing. |
|---|
| 22 |
Log::Log4perl->init({ |
|---|
| 23 |
"log4perl.rootLogger" => "DEBUG, Buffer", |
|---|
| 24 |
"log4perl.appender.Buffer" => "Log::Log4perl::Appender::TestBuffer", |
|---|
| 25 |
"log4perl.appender.Buffer.min_level" => "fatal", |
|---|
| 26 |
"log4perl.appender.Buffer.layout" => "Log::Log4perl::Layout::PatternLayout", |
|---|
| 27 |
"log4perl.appender.Buffer.layout.ConversionPattern" => "%d{yyyy-MM-dd HH:mm:ss} %5p [%M] (%F:%L) - %m%n", |
|---|
| 28 |
}); |
|---|
| 29 |
} |
|---|
| 30 |
require_ok('Log::Log4perl'); |
|---|
| 31 |
use Log::Log4perl qw(:easy); |
|---|
| 32 |
|
|---|
| 33 |
# Make sure HoneyClient::Util::Config loads. |
|---|
| 34 |
BEGIN { use_ok('HoneyClient::Util::Config', qw(getVar)) |
|---|
| 35 |
or diag("Can't load HoneyClient::Util::Config package. Check to make sure the package library is correctly listed within the path."); |
|---|
| 36 |
|
|---|
| 37 |
# Suppress all logging messages, since we need clean output for unit testing. |
|---|
| 38 |
Log::Log4perl->init({ |
|---|
| 39 |
"log4perl.rootLogger" => "DEBUG, Buffer", |
|---|
| 40 |
"log4perl.appender.Buffer" => "Log::Log4perl::Appender::TestBuffer", |
|---|
| 41 |
"log4perl.appender.Buffer.min_level" => "fatal", |
|---|
| 42 |
"log4perl.appender.Buffer.layout" => "Log::Log4perl::Layout::PatternLayout", |
|---|
| 43 |
"log4perl.appender.Buffer.layout.ConversionPattern" => "%d{yyyy-MM-dd HH:mm:ss} %5p [%M] (%F:%L) - %m%n", |
|---|
| 44 |
}); |
|---|
| 45 |
} |
|---|
| 46 |
require_ok('HoneyClient::Util::Config'); |
|---|
| 47 |
can_ok('HoneyClient::Util::Config', 'getVar'); |
|---|
| 48 |
use HoneyClient::Util::Config qw(getVar); |
|---|
| 49 |
|
|---|
| 50 |
# Suppress all logging messages, since we need clean output for unit testing. |
|---|
| 51 |
Log::Log4perl->init({ |
|---|
| 52 |
"log4perl.rootLogger" => "DEBUG, Buffer", |
|---|
| 53 |
"log4perl.appender.Buffer" => "Log::Log4perl::Appender::TestBuffer", |
|---|
| 54 |
"log4perl.appender.Buffer.min_level" => "fatal", |
|---|
| 55 |
"log4perl.appender.Buffer.layout" => "Log::Log4perl::Layout::PatternLayout", |
|---|
| 56 |
"log4perl.appender.Buffer.layout.ConversionPattern" => "%d{yyyy-MM-dd HH:mm:ss} %5p [%M] (%F:%L) - %m%n", |
|---|
| 57 |
}); |
|---|
| 58 |
|
|---|
| 59 |
# Make sure the module loads properly, with the exportable |
|---|
| 60 |
# functions shared. |
|---|
| 61 |
BEGIN { use_ok('HoneyClient::Manager', qw(init destroy)) or diag("Can't load HoneyClient::Manager package. Check to make sure the package library is correctly listed within the path."); } |
|---|
| 62 |
require_ok('HoneyClient::Manager'); |
|---|
| 63 |
can_ok('HoneyClient::Manager', 'init'); |
|---|
| 64 |
can_ok('HoneyClient::Manager', 'destroy'); |
|---|
| 65 |
use HoneyClient::Manager qw(init destroy); |
|---|
| 66 |
|
|---|
| 67 |
# Make sure HonyClient::Manager::VM::Clone loads. |
|---|
| 68 |
BEGIN { use_ok('HoneyClient::Manager::VM::Clone') or diag("Can't load HoneyClient::Manager::VM::Clone package. Check to make sure the package library is correctly listed within the path."); } |
|---|
| 69 |
require_ok('HoneyClient::Manager::VM::Clone'); |
|---|
| 70 |
use HoneyClient::Manager::VM::Clone; |
|---|
| 71 |
|
|---|
| 72 |
# Make sure HoneyClient::Util::SOAP loads. |
|---|
| 73 |
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."); } |
|---|
| 74 |
require_ok('HoneyClient::Util::SOAP'); |
|---|
| 75 |
can_ok('HoneyClient::Util::SOAP', 'getServerHandle'); |
|---|
| 76 |
can_ok('HoneyClient::Util::SOAP', 'getClientHandle'); |
|---|
| 77 |
use HoneyClient::Util::SOAP qw(getServerHandle getClientHandle); |
|---|
| 78 |
|
|---|
| 79 |
# Make sure HoneyClient::Util::Config loads. |
|---|
| 80 |
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."); } |
|---|
| 81 |
require_ok('HoneyClient::Util::Config'); |
|---|
| 82 |
can_ok('HoneyClient::Util::Config', 'getVar'); |
|---|
| 83 |
use HoneyClient::Util::Config qw(getVar); |
|---|
| 84 |
|
|---|
| 85 |
# Check if HoneyClient::Manager::Database support is enabled. |
|---|
| 86 |
my $DB_ENABLE = getVar(name => "enable", |
|---|
| 87 |
namespace => "HoneyClient::Manager::Database"); |
|---|
| 88 |
if ($DB_ENABLE) { |
|---|
| 89 |
# Make sure HoneyClient::Manager::Database loads. |
|---|
| 90 |
require_ok('HoneyClient::Manager::Database'); |
|---|
| 91 |
require HoneyClient::Manager::Database; |
|---|
| 92 |
} |
|---|
| 93 |
|
|---|
| 94 |
# Make sure Storable loads. |
|---|
| 95 |
BEGIN { use_ok('Storable', qw(nfreeze thaw)) or diag("Can't load Storable package. Check to make sure the package library is correctly listed within the path."); } |
|---|
| 96 |
require_ok('Storable'); |
|---|
| 97 |
can_ok('Storable', 'nfreeze'); |
|---|
| 98 |
can_ok('Storable', 'thaw'); |
|---|
| 99 |
use Storable qw(nfreeze thaw); |
|---|
| 100 |
|
|---|
| 101 |
# Make sure MIME::Base64 loads. |
|---|
| 102 |
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."); } |
|---|
| 103 |
require_ok('MIME::Base64'); |
|---|
| 104 |
can_ok('MIME::Base64', 'encode_base64'); |
|---|
| 105 |
can_ok('MIME::Base64', 'decode_base64'); |
|---|
| 106 |
use MIME::Base64 qw(encode_base64 decode_base64); |
|---|
| 107 |
} |
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
1; |
|---|