import SOAP-WSDL 2.00_25 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  2.00_25
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_25.tar.gz
This commit is contained in:
Martin Kutter
2009-12-12 19:48:11 -08:00
committed by Michael G. Schwern
parent 84b53d9261
commit a9033164e6
177 changed files with 3449 additions and 2063 deletions
+10 -3
View File
@@ -1,12 +1,19 @@
use Test::More tests => 5;
use Test::More tests => 9;
use strict;
use warnings;
use SOAP::WSDL::XSD::Typelib::Builtin::ENTITY;
my $ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new();
is $ENTITY->get_value(), undef;
$ENTITY->set_value(127);
is "$ENTITY", "127", 'stringification';
ok $ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new({ value => 127 });
is "$ENTITY", "127", 'stringification';
undef $ENTITY;
$ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new({});
is $ENTITY->get_value(), undef;
ok $ENTITY = SOAP::WSDL::XSD::Typelib::Builtin::ENTITY->new({ value => 127 });
is "$ENTITY", "127", 'stringification';
ok $ENTITY->isa('SOAP::WSDL::XSD::Typelib::Builtin::NCName'), 'inheritance';
is $ENTITY->get_value(), "127", 'stringification';
ok $ENTITY->isa('SOAP::WSDL::XSD::Typelib::Builtin::NCName'), 'inheritance';
+1 -1
View File
@@ -7,7 +7,7 @@ is $IDREFS->get_value(), undef;
$IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new({});
is $IDREFS->get_value(), undef;
ok $IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new({ value => [ 127 , 'Test' ] });
is "$IDREFS", "127 Test", 'stringification';
is $IDREFS->serialize(), "127 Test", 'stringification';
ok $IDREFS = SOAP::WSDL::XSD::Typelib::Builtin::IDREFS->new({ value => 'Test' });
is "$IDREFS", "Test", 'stringification';
+2 -2
View File
@@ -8,13 +8,13 @@ $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({});
is $NMTOKENS->get_value(), undef;
ok $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => [ 127 , 'Test' ] });
is "$NMTOKENS", '127 Test', 'stringification';
is $NMTOKENS->serialize, '127 Test', 'stringification';
ok $NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => 'Test' });
is "$NMTOKENS", "Test", 'stringification';
$NMTOKENS = SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS->new({ value => undef });
is "$NMTOKENS", q{}, 'stringification';
is $NMTOKENS, undef, 'stringification';
ok $NMTOKENS->isa('SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN'), 'inheritance';
@@ -1,12 +1,19 @@
use strict;
use warnings;
use Test::More tests => 20;
use Test::More tests => 23;
use Scalar::Util qw(blessed);
use lib '../../../../../../lib';
use_ok qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new();
my $id = ${ $obj };
undef $obj;
$obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new();
is ${ $obj }, $id;
ok blessed $obj, 'constructor returned blessed reference';
$obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({ value => 'test1' });
@@ -23,7 +30,8 @@ is $obj->end_tag({ name => 'test' }), '</test >', 'end_tag';
ok $obj->set_value('test'), 'set_value';
is $obj->get_value(), 'test', 'get_value';
is "$obj", q{test}, 'serialize overloading';
is "$obj", q{test}, 'stringification overloading';
is $obj->serialize, q{test}, 'stringification overloading';
ok ($obj)
? pass 'boolean overloading'
@@ -32,7 +40,11 @@ ok ($obj)
ok ! $obj->set_value(undef), 'set_value with explicit undef';
is $obj->get_value(), undef, 'get_value';
is "$obj", q{}, 'stringification overloading';
{
no warnings qw(uninitialized);
is "$obj", q{}, 'stringification overloading';
}
is $obj->serialize, q{}, 'stringification overloading';
ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({
value => 'test2',
@@ -47,4 +59,4 @@ is $obj->serialize({ name => 'foo' }), '<foo ></foo >'
is $obj->serialize(), q{}, 'serialize undef value without name';
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType'), 'inheritance';
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anyType'), 'inheritance';
+11 -2
View File
@@ -1,10 +1,19 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 3;
use Scalar::Util qw(blessed);
use lib '../../../../../../lib';
use_ok qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
is SOAP::WSDL::XSD::Typelib::Builtin::anyType->get_xmlns(), 'http://www.w3.org/2001/XMLSchema', 'get_xmlns';
is SOAP::WSDL::XSD::Typelib::Builtin::anyType->serialize(), q{}, 'serialize to empty';
exit 0;
__END__
# cannot instantiate abstract type...
my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anyType->new();
ok blessed $obj, 'constructor returned blessed reference';
@@ -3,7 +3,10 @@ use strict;
use warnings;
use SOAP::WSDL::XSD::Typelib::Builtin::base64Binary;
my $obj = SOAP::WSDL::XSD::Typelib::Builtin::base64Binary->new();
is "$obj", '', 'stringification';
{
no warnings qw(uninitialized);
is "$obj", '', 'stringification';
}
ok defined $obj;
ok $obj->set_value('AAAA==');
ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::base64Binary->new({ value => 'AAAA==' });
+23 -7
View File
@@ -1,4 +1,4 @@
use Test::More tests => 19;
use Test::More tests => 29;
use strict;
use warnings;
use SOAP::WSDL::XSD::Typelib::Builtin::boolean;
@@ -17,18 +17,19 @@ ok $bool = SOAP::WSDL::XSD::Typelib::Builtin::boolean->new({ value => 'true' });
is $bool * 1 , 1, 'numerification';
ok $bool, 'boolification';
is "$bool", 'true', 'stringification';
is $bool->serialize(), 'true', 'serialization';
$bool->set_value('1');
is $bool, 'true';
is $bool->serialize(), 'true';
is "$bool", 1, 'stringification';
$bool ? pass 'boolification' : fail 'boolification';
$bool->set_value('0');
is $bool, 'false';
is $bool->serialize(), 'false';
! $bool ? pass 'boolification' : fail 'boolification';
$bool->set_value(undef);
is $bool, 'false';
is $bool->serialize(), 'false';
! $bool ? pass 'boolification' : fail 'boolification';
@@ -41,7 +42,7 @@ else {
pass 'boolification';
}
is "$bool", 'false', 'stringification';
is "$bool", '0', 'stringification';
ok $bool->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType'), 'inheritance';
@@ -49,4 +50,19 @@ is $bool->serialize({ name => 'test'}), '<test >false</test >';
is $bool->serialize(), 'false';
$bool->delete_value();
is "$bool", '', 'serialized undef to empty string';
is $bool->serialize, '', 'serialized undef to empty string';
is "$bool", '', 'stringified undef to empty string';
$bool->set_value('');
is $bool->serialize, 'false', 'serialized empty string to false';
is "$bool", 0, 'stringified empty string to 0';
$SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType::___value->{ ${ $bool } } = 'true';
is $bool->serialize(), 'true', 'serialization';
is "$bool", 1, 'stringification';
is 3 * $bool, 3, 'numerification';
$SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType::___value->{ ${ $bool } } = 'false';
is $bool->serialize(), 'false', 'serialization';
is "$bool", 0, 'numerification';
is 3 * $bool, 0, 'stringification';
+7 -1
View File
@@ -1,4 +1,4 @@
use Test::More tests => 4;
use Test::More tests => 7;
use strict;
use warnings;
use lib '../lib';
@@ -34,3 +34,9 @@ while (my ($date, $converted) = each %dates ) {
is $obj->get_value() , $converted . timezone($date), 'conversion with timezone';
}
$obj->set_value('2007-12-31T00:00:00.0000000+01:00');
is $obj->get_value(), '2007-12-31T00:00:00.0000000+01:00';
$obj->set_value(undef);
is $obj->get_value(), undef;
eval { $obj->set_value(1) };
ok $@, 'Die on illegal datetime';
+28
View File
@@ -0,0 +1,28 @@
package ListTest;
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::list
SOAP::WSDL::XSD::Typelib::Builtin::string);
package main;
use Test::More tests => 11;
use strict;
use warnings;
my $obj = ListTest->new();
is $obj->get_value(), undef;
$obj = ListTest->new({});
is $obj->get_value(), undef;
ok $obj = ListTest->new({ value => 'Test' });
is "$obj", 'Test', 'stringification';
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::string'), 'inheritance';
$obj->set_value(undef);
is $obj->get_value, undef;
is $obj->serialize(), '', 'serialize undef to empty string';
is $obj->serialize({ empty => 1 }), '', 'serialize undef to empty string';
$obj->set_value(42);
is $obj->get_value, 42;
is $obj->serialize(), '42', 'serialize undef to empty string';
$obj->set_value([1,2,3]);
is $obj->serialize(), '1 2 3', 'list serialization';
@@ -1,4 +1,4 @@
use Test::More tests => 8;
use Test::More tests => 9;
use strict;
use warnings;
use SOAP::WSDL::XSD::Typelib::Builtin::normalizedString;
@@ -11,12 +11,14 @@ is "$obj", 'Test', 'stringification';
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::string'), 'inheritance';
$obj->set_value(undef);
is $obj->get_value, undef;
$obj->set_value( "&\t\"Aber\"\n\r<test>");
is $obj->get_value() , '& "Aber" <test>';
is $obj->get_value() , '& "Aber" <test>';
is $obj, '&amp; &qout;Aber&qout; &lt;test&gt;'
is $obj->serialize, '&amp; &quot;Aber&quot; &lt;test&gt;'
, 'escape text on serialization';
is $obj->serialize({ name => 'test'})
, '<test >&amp; &qout;Aber&qout; &lt;test&gt;</test >'
, '<test >&amp; &quot;Aber&quot; &lt;test&gt;</test >'
, 'Serialization with name';
+5 -5
View File
@@ -1,4 +1,4 @@
use Test::More tests => 5;
use Test::More tests => 6;
use strict;
use warnings;
use lib '../lib';
@@ -7,17 +7,17 @@ use_ok('SOAP::WSDL::XSD::Typelib::Builtin::string');
my $obj;
$obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => '& "Aber" <test>'});
is $obj, '&amp; &qout;Aber&qout; &lt;test&gt;'
is $obj->serialize, '&amp; &quot;Aber&quot; &lt;test&gt;'
, 'escape text on serialization';
$obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new();
$obj = SOAP::WSDL::XSD::Typelib::Builtin::string->new({});
$obj->set_value( '& "Aber" <test>');
is $obj->get_value() , '& "Aber" <test>';
is $obj, '&amp; &qout;Aber&qout; &lt;test&gt;'
is $obj, '& "Aber" <test>';
is $obj->serialize(), '&amp; &quot;Aber&quot; &lt;test&gt;'
, 'escape text on serialization';
is $obj->serialize({ name => 'test'})
, '<test >&amp; &qout;Aber&qout; &lt;test&gt;</test >'
, '<test >&amp; &quot;Aber&quot; &lt;test&gt;</test >'
, 'Serialization with name';
+23 -12
View File
@@ -34,7 +34,7 @@ __PACKAGE__->_factory(
);
package main;
use Test::More tests => 90;
use Test::More tests => 89;
use Data::Dumper;
use Storable;
my $obj;
@@ -77,14 +77,14 @@ $obj = MyType->new({
});
isa_ok $obj, 'MyType';
isa_ok $obj->get_test, 'ARRAY';
is $obj->get_test()->[0], 'Test', 'element content';
is $obj->get_test()->[1], 'Test2', 'element content';
is $obj->get_test()->[0], 'Test', 'element content (list content [0])';
is $obj->get_test()->[1], 'Test2', 'element content (list content [1])';
my $nested = MyType2->new({
test => $obj,
});
is $nested->get_test, $obj;
is $nested->get_test, $obj, 'getter';
$nested = MyType2->new({
test => [$obj, $obj],
});
@@ -105,7 +105,8 @@ $nested = MyType2->new({
},
});
is $nested->get_test->[0], $obj;
# isnt $nested->get_test->[0], $obj, 'element identity';
$obj = MyType->new();
isa_ok $obj, 'MyType';
@@ -114,7 +115,6 @@ is $obj->get_test, undef, 'undefined element content';
$obj->add_test(
SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'TestString0'})
);
is $obj->get_test, 'TestString0', 'added element content';
for my $count (1..5) {
@@ -137,13 +137,23 @@ $obj = MyType->new();
isa_ok $obj, 'MyType';
is $obj->get_test, undef;
eval { my $foo = @{ $obj->get_test() } };
like $@ , qr{Can't \s use \s an \s undefined}x, 'get_ELEMENT still undef on ARRAYIFY';
$obj->test(
SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'TestString0'})
);
{
no warnings;
my $foo;
eval { $foo = @{ $obj->get_test() } };
if (! $@) {
is $foo, undef;
# like $warnings, qr{ uninitialized \s value \s in array \s dereference }x, 'undef warning';
}
else {
like $@ , qr{Can't \s use \s an \s undefined}x, 'get_ELEMENT still undef on ARRAYIFY';
# pass 'failed array dereference';
}
$obj->test(
SOAP::WSDL::XSD::Typelib::Builtin::string->new({ value => 'TestString0'})
);
}
is $obj->get_test, 'TestString0';
eval { is @{ $obj->get_test() }, 1, 'ARRAYIFY get_ELEMENT' };
fail 'cannot ARRAYIFY get_ELEMENT' if ($@);
@@ -171,6 +181,7 @@ for my $count (1..5) {
}
eval {
$obj = MyType->new({
test => [
+2 -2
View File
@@ -25,7 +25,7 @@ isa_ok $obj, 'MyElement';
is $obj->get_value(), 'Test';
$obj->set_value(undef);
is $obj, '<MyElement xsi:nil="true" xmlns="http://www.w3.org/2001/XMLSchema" />';
is $obj->serialize_qualified, '<MyElement xsi:nil="true" xmlns="http://www.w3.org/2001/XMLSchema" />';
$obj->__set_nillable(0);
is $obj->__get_nillable(), 0;
@@ -41,4 +41,4 @@ $obj->set_value('Test');
eval { is @{ $obj }, 1, 'ARRAYIFY' };
fail 'ARRAYIFY' if ($@);
fail 'ARRAYIFY' if ($@);