BEGIN { $| = 1;
print
"1..18\n"
; }
END {
print
"not ok 1\n"
unless
$loaded
;}
$loaded
= 1;
$i
= 1;
result(
$i
);
my
$position
;
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$position
= Bio::MAGE::DesignElement::Position->new();
}
result(
$position
->isa(
'Bio::MAGE::DesignElement::Position'
));
result(
$position
->
package
() eq
q[DesignElement]
);
result(
$position
->class_name() eq
q[Bio::MAGE::DesignElement::Position]
);
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$position
= Bio::MAGE::DesignElement::Position->new(
y
=> 1,
x
=> 2);
}
result (
$position
->getY() == 1);
$position
->setY(1);
result (
$position
->getY() == 1);
result (
$position
->getX() == 2);
$position
->setX(2);
result (
$position
->getX() == 2);
my
%assns
= Bio::MAGE::DesignElement::Position->associations();
my
$assn
;
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$position
= Bio::MAGE::DesignElement::Position->new(
distanceUnit
=> Bio::MAGE::Measurement::DistanceUnit->new(),
propertySets
=> [Bio::MAGE::NameValueType->new()]);
}
my
$distanceunit_assn
;
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$distanceunit_assn
= Bio::MAGE::Measurement::DistanceUnit->new();
}
result (UNIVERSAL::isa(
$position
->getDistanceUnit,
q[Bio::MAGE::Measurement::DistanceUnit]
));
result (
$position
->setDistanceUnit(
$distanceunit_assn
) ==
$distanceunit_assn
);
result (
$position
->getDistanceUnit() ==
$distanceunit_assn
);
(
$assn
) =
$assns
{distanceUnit};
result(is_object(
$assn
)
and
$assn
->isa(
'Bio::MAGE::Association'
)
and
defined
$assn
->description(),
and
defined
$assn
->cardinality(),
and
grep
{
$_
eq
$assn
->cardinality} (
'0..1'
,
'1'
,
'1..N'
,
'0..N'
),
and
defined
$assn
->is_ref(),
and (
$assn
->is_ref() == 0 or
$assn
->is_ref() == 1),
and
defined
$assn
->rank(),
and
$assn
->rank(),
and
defined
$assn
->ordered(),
and (
$assn
->ordered() == 0 or
$assn
->ordered() == 1),
and
defined
$assn
->class_name(),
and
$assn
->class_name(),
and
defined
$assn
->name(),
and
$assn
->name(),
);
my
$propertysets_assn
;
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$propertysets_assn
= Bio::MAGE::NameValueType->new();
}
result (UNIVERSAL::isa(
$position
->getPropertySets->[0],
q[Bio::MAGE::NameValueType]
));
result (
$position
->setPropertySets([
$propertysets_assn
]));
result (UNIVERSAL::isa(
$position
->getPropertySets,
'ARRAY'
)
and
scalar
@{
$position
->getPropertySets()} == 1
and
$position
->getPropertySets->[0] ==
$propertysets_assn
);
$position
->addPropertySets(
$propertysets_assn
);
result (UNIVERSAL::isa(
$position
->getPropertySets,
'ARRAY'
)
and
scalar
@{
$position
->getPropertySets()} == 2
and
$position
->getPropertySets->[0] ==
$propertysets_assn
and
$position
->getPropertySets->[1] ==
$propertysets_assn
);
(
$assn
) =
$assns
{propertySets};
result(is_object(
$assn
)
and
$assn
->isa(
'Bio::MAGE::Association'
)
and
defined
$assn
->description(),
and
defined
$assn
->cardinality(),
and
grep
{
$_
eq
$assn
->cardinality} (
'0..1'
,
'1'
,
'1..N'
,
'0..N'
),
and
defined
$assn
->is_ref(),
and (
$assn
->is_ref() == 0 or
$assn
->is_ref() == 1),
and
defined
$assn
->rank(),
and
$assn
->rank(),
and
defined
$assn
->ordered(),
and (
$assn
->ordered() == 0 or
$assn
->ordered() == 1),
and
defined
$assn
->class_name(),
and
$assn
->class_name(),
and
defined
$assn
->name(),
and
$assn
->name(),
);
result (
$position
->isa(
q[Bio::MAGE::Extendable]
));