| 1 | 1 | ▶ | use Test::More tests => 23; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | BEGIN { require_ok ( 'ASNMTAP::Asnmtap::Plugins::XML' ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | BEGIN { use_ok ( 'ASNMTAP::Asnmtap::Plugins::XML' ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | BEGIN { use_ok ( 'ASNMTAP::Asnmtap::Plugins::XML', qw(:ALL) ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | BEGIN { use_ok ( 'ASNMTAP::Asnmtap::Plugins::XML', qw(&extract_XML) ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | TODO: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use ASNMTAP::Asnmtap::Plugins v3.002.003; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use ASNMTAP::Asnmtap::Plugins qw(:PLUGINS); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | my $objectPlugins = ASNMTAP::Asnmtap::Plugins->new ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | _programName => 'XML.t', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | _programDescription => 'Testing ASNMTAP::Asnmtap::Plugins::XML', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | _programVersion => '3.002.003', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | _timeout => 30, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | _debug => 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | isa_ok( $objectPlugins, 'ASNMTAP::Asnmtap::Plugins' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | can_ok( $objectPlugins, qw(programName programDescription programVersion getOptionsArgv getOptionsValue debug dumpData printRevision printRevision printUsage printHelp) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | can_ok( $objectPlugins, qw(appendPerformanceData browseragent SSLversion clientCertificate pluginValue pluginValues proxy timeout setEndTime_and_getResponsTime write_debugfile call_system exit) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use constant HEADER => '<?xml version="1.0" encoding="UTF-8"?>'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | use constant FOOTER => '</MonitoringXML>'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | my $schema = "1.0"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | my $resultXML = <<EOT; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | <?xml version="1.0" encoding="UTF-8"?> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | <MonitoringXML> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | <Monitoring> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | <Schema Value="1.0"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | <Results> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | <Details Host="Host Name ..." Service="Service Name ..." Environment="LOCAL" Date="2005/11/04" Time="17:27:30" Epochtime="1131121650" Status="2" StatusMessage="StatusMessage ..." PerfData="'PerfData Label 1'=99ms;0;;; 'PerfData Label n'=99ms;0;;;"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | <ErrorDetail><![CDATA[ErrorDetail .1.]]></ErrorDetail> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | <ErrorStack><![CDATA[ErrorStack .1.]]></ErrorStack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | <Extension> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | <Element eName="one integer" eDescription="description a" eType="INTEGER" eValue="1" ePerfData="'PerfData Label 1'=99ms;0;;; 'PerfData Label n'=99ms;0;;;"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | <Element eName="one string" eDescription="description b" eType="STRING" eValue="string, no Format" ePerfData="'PerfData Label 1'=99ms;0;;; 'PerfData Label n'=99ms;0;;;"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | <Element eName="one string" eDescription="description c" eType="STRING" eFormat="" eValue="string, no Perfdata"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | <Element eName="one string" eDescription="description d" eType="STRING" eValue="string, no Format, no Perfdata"><![CDATA[ErrorDetail .1.]]></Element> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | </Extension> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | </Results> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | </Monitoring> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | </MonitoringXML> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | EOT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 1 | my ($returnCode, $xml, $errorStatus); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, custom => \&actionOnExtractedXML, resultXML => $resultXML, headerXML => HEADER, footerXML => FOOTER ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | ok ($returnCode == 0, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): custom'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, resultXML => $resultXML, headerXML => HEADER, footerXML => FOOTER, validateDTD => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | ok ($returnCode == 0, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): resultXML with validateDTD = 0'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, resultXML => $resultXML, headerXML => HEADER, footerXML => FOOTER, validateDTD => 1, filenameDTD => "../plugins/templates/dtd/Monitoring-$schema.dtd" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | ok ($returnCode == 0, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): resultXML with validateDTD = 1'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-$schema.xml", headerXML => HEADER, footerXML => FOOTER, validateDTD => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | ok ($returnCode == 0, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): filenameXML with validateDTD = 0'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-$schema.xml", headerXML => HEADER, footerXML => FOOTER, validateDTD => 1, filenameDTD => "../plugins/templates/dtd/Monitoring-$schema.dtd" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | ok ($returnCode == 0, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): filenameXML with validateDTD = 1'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | $errorStatus = ($returnCode != 0) ? $returnCode : ($xml->{Monitoring}{Schema}{Value} eq $schema and $xml->{Monitoring}{Results}{Details}{Host} eq 'Host Name ...' and $xml->{Monitoring}{Results}{Details}{Service} eq 'Service Name ...' and $xml->{Monitoring}{Results}{Details}{Environment} =~ /^L/i); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema and $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "Host Name ..." and $xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "Service Name ..." and $xml->{"Monitoring"}{"Results"}{"Details"}{"Environment"} =~ /^L/i
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema and $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "Host Name ..." and $xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "Service Name ..."
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema and $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "Host Name ..."
MC/DC0%0/4
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema and $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "Host Name ..." and $xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "Service Name ..." and $xml->{"Monitoring"}{"Results"}{"Details"}{"Environment"} =~ /^L/i
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema
$xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "Host Name ..."
$xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "Service Name ..."
$xml->{"Monitoring"}{"Results"}{"Details"}{"Environment"} =~ /^L/i
Truth table20%1/5
A and B and C and D
A= $xml->{"Monitoring"}{"Schema"}{"Value"} eq $schemaB= $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "Host Name ..."C= $xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "Service Name ..."D= $xml->{"Monitoring"}{"Results"}{"Details"}{"Environment"} =~ /^L/i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML: XML Monitoring validation OK'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1 | ▶ | $errorStatus = ! ($xml->{Monitoring}{Schema}{Value} eq $schema and $xml->{Monitoring}{Results}{Details}{Host} eq '... Host Name ...' and $xml->{Monitoring}{Results}{Details}{Service} eq '... Service Name ...' and $xml->{Monitoring}{Results}{Details}{Environment} =~ /^L/i); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%3/9
$xml->{'Monitoring'}{'Schema'}{'Value'} eq $schema && $xml->{'Monitoring'}{'Results'}{'Details'}{'Host'} eq '... Host Name ...' && $xml->{'Monitoring'}{'Results'}{'Details'}{'Service'} eq '... Service Name ...' && $xml->{'Monitoring'}{'Results'}{'Details'}{'Environment'} =~ /^L/i
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema and $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "... Host Name ..." and $xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "... Service Name ..."
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema and $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "... Host Name ..."
MC/DC0%0/4
$xml->{'Monitoring'}{'Schema'}{'Value'} eq $schema && $xml->{'Monitoring'}{'Results'}{'Details'}{'Host'} eq '... Host Name ...' && $xml->{'Monitoring'}{'Results'}{'Details'}{'Service'} eq '... Service Name ...' && $xml->{'Monitoring'}{'Results'}{'Details'}{'Environment'} =~ /^L/i
$xml->{"Monitoring"}{"Schema"}{"Value"} eq $schema
$xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "... Host Name ..."
$xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "... Service Name ..."
$xml->{'Monitoring'}{'Results'}{'Details'}{'Environment'} =~ /^L/i
Truth table20%1/5
A and B and C && D
A= $xml->{"Monitoring"}{"Schema"}{"Value"} eq $schemaB= $xml->{"Monitoring"}{"Results"}{"Details"}{"Host"} eq "... Host Name ..."C= $xml->{"Monitoring"}{"Results"}{"Details"}{"Service"} eq "... Service Name ..."D= $xml->{'Monitoring'}{'Results'}{'Details'}{'Environment'} =~ /^L/i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML: XML Monitoring validation NOK'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing resultXML and\/or filenameXML\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ m[Missing\ resultXML\ and\/or\ filenameXML]
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ m[Missing\ resultXML\ and\/or\ filenameXML]
$returnCode == 3
$objectPlugins->pluginValue('error') =~ m[Missing\ resultXML\ and\/or\ filenameXML]
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ m[Missing\ resultXML\ and\/or\ filenameXML]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): Missing resultXML and/or filenameXML'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "xml/Monitoring-1.0-UNKNOWN.xml" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QThe XML file 'xml\/Monitoring-1.0-UNKNOWN.xml' doesn't exist\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ m[The\ XML\ file\ \'xml\/Monitoring\-1\.0\-UNKNOWN\.xml\'\ doesn\'t\ exist]
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ m[The\ XML\ file\ \'xml\/Monitoring\-1\.0\-UNKNOWN\.xml\'\ doesn\'t\ exist]
$returnCode == 3
$objectPlugins->pluginValue('error') =~ m[The\ XML\ file\ \'xml\/Monitoring\-1\.0\-UNKNOWN\.xml\'\ doesn\'t\ exist]
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ m[The\ XML\ file\ \'xml\/Monitoring\-1\.0\-UNKNOWN\.xml\'\ doesn\'t\ exist]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): filenameXML: The XML file doesn\'t exist'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-$schema.xml" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing XML HEADER\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Missing\ XML\ HEADER/
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Missing\ XML\ HEADER/
$returnCode == 3
$objectPlugins->pluginValue('error') =~ /Missing\ XML\ HEADER/
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ /Missing\ XML\ HEADER/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): headerXML: Missing XML HEADER'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-$schema.xml", headerXML => HEADER ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing XML FOOTER\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Missing\ XML\ FOOTER/
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Missing\ XML\ FOOTER/
$returnCode == 3
$objectPlugins->pluginValue('error') =~ /Missing\ XML\ FOOTER/
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ /Missing\ XML\ FOOTER/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): footerXML: Missing XML FOOTER'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-$schema.xml", headerXML => HEADER, footerXML => FOOTER, validateDTD => 2 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QParameter validateDTD must be 0 or 1\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Parameter\ validateDTD\ must\ be\ 0\ or\ 1/
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Parameter\ validateDTD\ must\ be\ 0\ or\ 1/
$returnCode == 3
$objectPlugins->pluginValue('error') =~ /Parameter\ validateDTD\ must\ be\ 0\ or\ 1/
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ /Parameter\ validateDTD\ must\ be\ 0\ or\ 1/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): validateDTD: Parameter validateDTD must be 0 or 1'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-$schema.xml", headerXML => 'HEADER', footerXML => FOOTER, validateDTD => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QWrong XML HEADER\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Wrong\ XML\ HEADER/
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Wrong\ XML\ HEADER/
$returnCode == 3
$objectPlugins->pluginValue('error') =~ /Wrong\ XML\ HEADER/
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ /Wrong\ XML\ HEADER/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): headerXML: Wrong XML HEADER'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-$schema.xml", headerXML => HEADER, footerXML => 'FOOTER', validateDTD => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QWrong XML FOOTER\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Wrong\ XML\ FOOTER/
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /Wrong\ XML\ FOOTER/
$returnCode == 3
$objectPlugins->pluginValue('error') =~ /Wrong\ XML\ FOOTER/
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ /Wrong\ XML\ FOOTER/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): footerXML: Wrong XML FOOTER'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-1.0.xml", headerXML => HEADER, footerXML => FOOTER, validateDTD => 1, filenameDTD => "dtd/Monitoring-1.0-UNKNOWN.dtd" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QThe DTD file 'dtd\/Monitoring-1.0-UNKNOWN.dtd' doesn't exist\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ m[The\ DTD\ file\ \'dtd\/Monitoring\-1\.0\-UNKNOWN\.dtd\'\ doesn\'t\ exist]
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ m[The\ DTD\ file\ \'dtd\/Monitoring\-1\.0\-UNKNOWN\.dtd\'\ doesn\'t\ exist]
$returnCode == 3
$objectPlugins->pluginValue('error') =~ m[The\ DTD\ file\ \'dtd\/Monitoring\-1\.0\-UNKNOWN\.dtd\'\ doesn\'t\ exist]
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ m[The\ DTD\ file\ \'dtd\/Monitoring\-1\.0\-UNKNOWN\.dtd\'\ doesn\'t\ exist]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): filenameDTD: The DTD file doesn\'t exist'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 1 | ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectPlugins, filenameXML => "../plugins/templates/xml/Monitoring-1.0-doNotValidate.xml", headerXML => HEADER, footerXML => FOOTER, validateDTD => 1, filenameDTD => "../plugins/templates/dtd/Monitoring-$schema.dtd" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 1 | ▶ | $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QThe XML doesn't validate\E/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /The\ XML\ doesn\'t\ validate/
MC/DC0%0/2
$returnCode == 3 && $objectPlugins->pluginValue('error') =~ /The\ XML\ doesn\'t\ validate/
$returnCode == 3
$objectPlugins->pluginValue('error') =~ /The\ XML\ doesn\'t\ validate/
Truth table33%1/3
A && B
A= $returnCode == 3B= $objectPlugins->pluginValue('error') =~ /The\ XML\ doesn\'t\ validate/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 1 | ok ($errorStatus, 'ASNMTAP::Asnmtap::Plugins::XML::extract_XML(): The XML doesn\'t validate'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 1 | ▶ | no warnings 'deprecated'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 1 | $objectPlugins->{_pluginValues}->{stateValue} = $ERRORS{OK}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 1 | $objectPlugins->{_pluginValues}->{stateError} = $STATE{$ERRORS{OK}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 1 | $objectPlugins->exit (0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 1 | ▶ | sub actionOnExtractedXML { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
actionOnExtractedXML: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 1 | my ($asnmtapInherited, $xml) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 1 | return ( $ERRORS{OK} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||