import SOAP-WSDL 1.24 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  1.24
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-1.24.tar.gz
This commit is contained in:
Martin Kutter
2009-12-12 19:47:56 -08:00
committed by Michael G. Schwern
parent 7ba2f93e44
commit 9e85f63aa0
228 changed files with 2369 additions and 22762 deletions
@@ -1,20 +0,0 @@
use strict;
use warnings;
use Test::More qw(no_plan);
use Scalar::Util qw(blessed);
use lib '../../../../../../lib';
use_ok qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
my $obj = SOAP::WSDL::XSD::Typelib::Builtin::anyType->new({
xmlns => 'urn:Siemens.mosaic'
});
ok blessed $obj, 'constructor returned blessed reference';
ok $obj->set_xmlns('urn:SOAP-WSDL'), 'set_xmlns';
is $obj->get_xmlns(), 'urn:SOAP-WSDL', 'get_xmlns';
is $obj->start_tag({ name => 'test' }), '<test >', 'start_tag';
is $obj->end_tag({ name => 'test' }), '</test >', 'end_tag';
is "$obj", q{}, 'serialize overloading';
@@ -1,44 +0,0 @@
use strict;
use warnings;
use Test::More qw(no_plan);
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({});
ok $obj->set_xmlns('urn:SOAP-WSDL'), 'set_xmlns';
is $obj->get_xmlns(), 'urn:SOAP-WSDL', 'get_xmlns';
ok blessed $obj, 'constructor returned blessed reference';
is $obj->start_tag({ name => 'test' }), '<test >', 'start_tag';
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';
ok ($obj)
? pass 'boolean overloading'
: fail 'boolean overloading';
ok ! $obj->set_value(undef), 'set_value with explicit undef';
is $obj->get_value(), undef, 'get_value';
is "$obj", q{}, 'stringification overloading';
ok $obj = SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType->new({
xmlns => 'urn:XSD',
value => 'test2',
});
is $obj->get_xmlns(), 'urn:XSD', 'get_xmlns on attr value';
is $obj->get_value(), 'test2', 'get_value on attr value';
$obj->set_value(undef);
is $obj->serialize({ name => 'foo' }), '<foo ></foo >'
, 'serialize undef value with name';
is $obj->serialize(), q{}, 'serialize undef value without name'
@@ -1,74 +0,0 @@
use Test::More tests => 30;
use strict;
use Carp qw(cluck);
$SIG{__WARN__} = sub { cluck @_ };
use warnings;
use lib '../lib';
use Date::Format;
use Date::Parse;
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::date');
my $obj;
sub timezone {
my @time = map { defined $_ ? $_ : 0 } strptime shift;
my $tz = strftime('%z', @time);
substr $tz, -2, 0, ':';
return $tz;
}
my %dates = (
'2007/12/31' => '2007-12-31',
'2007:08:31' => '2007-08-31',
'30 Aug 2007' => '2007-08-30',
);
my %localized_date_of = (
'2007-12-31T00:00:00.0000000+0000' => '2007-12-31+00:00',
'2007-12-31T00:00:00.0000000+0130' => '2007-12-31+01:30',
'2007-12-31T00:00:00.0000000+0200' => '2007-12-31+02:00',
'2007-12-31T00:00:00.0000000+0300' => '2007-12-31+03:00',
'2007-12-31T00:00:00.0000000+0400' => '2007-12-31+04:00',
'2007-12-31T00:00:00.0000000+0500' => '2007-12-31+05:00',
'2007-12-31T00:00:00.0000000+0600' => '2007-12-31+06:00',
'2007-12-31T00:00:00.0000000+0700' => '2007-12-31+07:00',
'2007-12-31T00:00:00.0000000+0800' => '2007-12-31+08:00',
'2007-12-31T00:00:00.0000000+0900' => '2007-12-31+09:00',
'2007-12-31T00:00:00.0000000+1000' => '2007-12-31+10:00',
'2007-12-31T00:00:00.0000000+1100' => '2007-12-31+11:00',
'2007-12-31T00:00:00.0000000+1200' => '2007-12-31+12:00',
'2007-12-31T00:00:00.0000000-0100' => '2007-12-31-01:00',
'2007-12-31T00:00:00.0000000-0200' => '2007-12-31-02:00',
'2007-12-31T00:00:00.0000000-0300' => '2007-12-31-03:00',
'2007-12-31T00:00:00.0000000-0400' => '2007-12-31-04:00',
'2007-12-31T00:00:00.0000000-0500' => '2007-12-31-05:00',
'2007-12-31T00:00:00.0000000-0600' => '2007-12-31-06:00',
'2007-12-31T00:00:00.0000000-0700' => '2007-12-31-07:00',
'2007-12-31T00:00:00.0000000-0800' => '2007-12-31-08:00',
'2007-12-31T00:00:00.0000000-0900' => '2007-12-31-09:00',
'2007-12-31T00:00:00.0000000-1000' => '2007-12-31-10:00',
'2007-12-31T00:00:00.0000000-1100' => '2007-12-31-11:00',
'2007-12-31T00:00:00.0000000-1200' => '2007-12-31-12:00',
);
while (my ($date, $converted) = each %localized_date_of ) {
$obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new();
$obj->set_value( $date );
is $obj->get_value() , $converted , 'conversion';
}
while (my ($date, $converted) = each %dates ) {
$obj = SOAP::WSDL::XSD::Typelib::Builtin::date->new();
$obj->set_value( $date );
is $obj->get_value() , $converted . timezone($date), 'conversion';
}
$obj->set_value( '2037-12-31+12:00' );
is $obj->get_value() , '2037-12-31+12:00', 'no conversion on match';
@@ -1,25 +0,0 @@
use Test::More tests => 3;
use strict;
use warnings;
use lib '../lib';
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::time');
my $obj;
$obj = SOAP::WSDL::XSD::Typelib::Builtin::time->new();
$obj->set_value( '12:23:03' );
is $obj->get_value() , '12:23:03+01:00', 'conversion';
$obj->set_value( '12:23:03.12345+01:00' ), ;
is $obj->get_value() , '12:23:03.12345+01:00', 'no conversion';
# exit;
#~ use Benchmark;
#~ timethese 10000, {
#~ xml => sub { $obj->set_value('2037-12-31T00:00:00.0000000+01:00') },
#~ string => sub { $obj->set_value('2037-12-31') },
#~ }
@@ -1,32 +0,0 @@
use Test::More tests => 4;
use strict;
use warnings;
use lib '../lib';
use Date::Parse;
use Date::Format;
sub timezone {
my @time = strptime shift;
my $tz = strftime('%z', @time);
substr $tz, -2, 0, ':';
return $tz;
}
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::dateTime');
print "# timezone is " . timezone( scalar localtime(time) ) . "\n";
my $obj;
my %dates = (
'2007-12-31 12:32' => '2007-12-31T12:32:00',
'2007-08-31 00:32' => '2007-08-31T00:32:00',
'30 Aug 2007' => '2007-08-30T00:00:00',
);
while (my ($date, $converted) = each %dates ) {
$obj = SOAP::WSDL::XSD::Typelib::Builtin::dateTime->new();
$obj->set_value( $date );
is $obj->get_value() , $converted . timezone($date), 'conversion with timezone';
}
$obj->set_value('2007-12-31T00:00:00.0000000+01:00');
@@ -1,19 +0,0 @@
use Test::More tests => 4;
use strict;
use warnings;
use lib '../lib';
use_ok('SOAP::WSDL::XSD::Typelib::Builtin::string');
my $obj;
$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;'
, 'escape text on serialization';
is $obj->serialize({ name => 'test'})
, '<test >&amp; &qout;Aber&qout; &lt;test&gt;</test >'
, 'Serialization with name';