use warnings;
use strict;
use Test::More 'no_plan';
use Data::Dumper;
use English qw( -no_match_vars);
use FreezeThaw qw(cmpStr);
use Log::Log4perl;
use_ok('perfSONAR_PS::Datatypes::v2_0::nmwgt::Message::Metadata::Subject::EndPointPair::Dst');
use perfSONAR_PS::Datatypes::v2_0::nmwgt::Message::Metadata::Subject::EndPointPair::Dst;
Log::Log4perl->init("logger.conf");
my $obj1 = undef;
#2
eval {
$obj1 = perfSONAR_PS::Datatypes::v2_0::nmwgt::Message::Metadata::Subject::EndPointPair::Dst->new({
'value' => 'value_value', 'type' => 'value_type', 'port' => 'value_port',})
};
ok( $obj1 && !$EVAL_ERROR , "Create object perfSONAR_PS::Datatypes::v2_0::nmwgt::Message::Metadata::Subject::EndPointPair::Dst..." . $EVAL_ERROR);
$EVAL_ERROR = undef;
#3
my $ns = $obj1->nsmap->mapname('dst');
ok($ns eq 'nmwgt', " mapname('dst')... ");
#4
my $value = $obj1->value;
ok($value eq 'value_value', " checking accessor obj1->value ... ");
#5
my $type = $obj1->type;
ok($type eq 'value_type', " checking accessor obj1->type ... ");
#6
my $port = $obj1->port;
ok($port eq 'value_port', " checking accessor obj1->port ... ");
#7
my $string = undef;
eval {
$string = $obj1->asString
};
ok($string && !$EVAL_ERROR , " Converting to string XML: $string " . $EVAL_ERROR);
$EVAL_ERROR = undef;
#8
my $obj22 = undef;
eval {
$obj22 = perfSONAR_PS::Datatypes::v2_0::nmwgt::Message::Metadata::Subject::EndPointPair::Dst->new({xml => $string});
};
ok( $obj22 && !$EVAL_ERROR , " re-create object from XML string: ". $EVAL_ERROR);
$EVAL_ERROR = undef;
#9
my $dom1 = $obj1->getDOM();
my $obj2 = undef;
eval {
$obj2 = perfSONAR_PS::Datatypes::v2_0::nmwgt::Message::Metadata::Subject::EndPointPair::Dst->new($dom1);
};
ok( $obj2 && !$EVAL_ERROR , " re-create object from DOM XML: ". $EVAL_ERROR);
$EVAL_ERROR = undef;