import SOAP-WSDL 2.00_03 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_03 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_03.tar.gz
This commit is contained in:
1 parent
7716d4349a
commit
21b5330a8d
98 files changed
+3231
-3156
No files matched your search
+45
-36
@@ -1,38 +1,47 @@
|
||||
use Test::More tests => 9;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Test::More tests => 10;
|
||||
use strict;
|
||||
use warnings;
|
||||
use diagnostics;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Data::Dumper;
|
||||
use lib '../lib';
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
$path =~s{/attic}{}xms;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
|
||||
ok( ($soap->servicename('testService') ), 'set service' );
|
||||
ok( ($soap->portname('testPort') ) ,'set portname');
|
||||
|
||||
ok( ($soap->portname() eq 'testPort' ),
|
||||
"Found first port definition" );
|
||||
|
||||
ok( ($soap->portname('testPort2') ),
|
||||
"Found second port definition (based on URL)" );
|
||||
|
||||
ok( ($soap->portname('testPort3') ),
|
||||
"Found third port definition (based on Name)" );
|
||||
|
||||
ok( $soap->wsdlinit( servicename => 'testService', portname => 'testPort'), 'parsed WSDL' );
|
||||
|
||||
$soap->_wsdl_init_methods();
|
||||
|
||||
use lib '../lib';
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
ok( ($soap->servicename('testService') eq 'testService' ) );
|
||||
ok( ($soap->portname('testPort') eq 'testPort' ) );
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
|
||||
ok( ($soap->portname() eq 'testPort' ),
|
||||
"Found first port definition" );
|
||||
|
||||
ok( ($soap->portname('testPort2') eq 'testPort2' ),
|
||||
"Found second port definition (based on URL)" );
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
ok( ($soap->portname('testPort3') eq 'testPort3' ),
|
||||
"Found third port definition (based on Name)" );
|
||||
|
||||
|
||||
ok( $soap->wsdlinit( servicename => 'testService', portname => 'testPort'), 'parsed WSDL' );
|
||||
ok( ($soap->portname() eq 'testPort' ), 'found port passed to wsdlinit');
|
||||
@@ -1,32 +1,32 @@
|
||||
BEGIN
|
||||
use Test::More tests => 8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
$SKIP = "Test::Differences required for testing. ";
|
||||
}
|
||||
|
||||
|
||||
my $path = cwd();
|
||||
my $name = $0;
|
||||
$name =~s/\.t$//;
|
||||
$name =~s/^t\///;
|
||||
|
||||
$path =~s{/attic}{}xms;
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
print "# SOAP::WSDL Version: $SOAP::WSDL::VERSION\n";
|
||||
|
||||
my $xml;
|
||||
my $soap;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
@@ -36,21 +36,14 @@ ok( $soap = SOAP::WSDL->new(
|
||||
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(
|
||||
checkoccurs => 1,
|
||||
), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
ok $soap->wsdlinit( checkoccurs => 1, ), 'parse WSDL';
|
||||
ok $soap->no_dispatch(1), 'set no dispatch';
|
||||
|
||||
ok ($xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => {
|
||||
Test1 => 'Test 1',
|
||||
Test2 => 'Test 2',
|
||||
}
|
||||
) ), 'Serialized complexType' );
|
||||
ok ($xml = $soap->call('test',
|
||||
Test1 => 'Test 1',
|
||||
Test2 => 'Test 2',
|
||||
), 'Serialized complexType' );
|
||||
|
||||
# oprint $xml;
|
||||
|
||||
#exit;
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die "Cannot open acceptance results file";
|
||||
@@ -58,13 +51,15 @@ my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
SKIP: {
|
||||
print $SKIP;
|
||||
skip( $SKIP, 1 ) if ($SKIP);
|
||||
eval { soap_eq_or_diff( $xml, $testXML, 'Got expected result') };
|
||||
};
|
||||
|
||||
# $soap->wsdl_checkoccurs(1);
|
||||
|
||||
TODO: {
|
||||
local $TODO = "not implemented yet";
|
||||
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
@@ -92,3 +87,4 @@ eval {
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Test::More tests => 2;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@) {
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
my $soap = SOAP::WSDL->new();
|
||||
|
||||
|
||||
TODO: {
|
||||
local $TODO="implement <choice> support";
|
||||
fail "serialize choice element";
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Test::More tests => 2;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@) {
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
my $soap = SOAP::WSDL->new();
|
||||
|
||||
|
||||
TODO: {
|
||||
local $TODO="implement <complexContent> support";
|
||||
fail "serialize complexContent element";
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Test::More tests => 2;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@) {
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
my $soap = SOAP::WSDL->new();
|
||||
|
||||
|
||||
TODO: {
|
||||
local $TODO="implement <group> support";
|
||||
fail "serialize group element";
|
||||
}
|
||||
@@ -24,6 +24,8 @@ my $path = cwd();
|
||||
my $name = $0;
|
||||
$name =~s/\.t$//;
|
||||
|
||||
$path=~s{/attic}{}xms;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file://' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
@@ -34,16 +36,16 @@ ok( $soap->wsdlinit(
|
||||
checkoccurs => 1,
|
||||
), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
$soap->serializer()->envprefix('SOAP-ENV');
|
||||
$soap->serializer()->encprefix('SOAP-ENC');
|
||||
|
||||
#4
|
||||
ok ($xml = $soap->serializer->method( $soap->call('test',
|
||||
ok $xml = $soap->call('test',
|
||||
testSequence => {
|
||||
Test1 => 'Test 1',
|
||||
Test2 => 'Test 2',
|
||||
}
|
||||
) ), 'Serialized complexType' );
|
||||
), 'Serialized complexType';
|
||||
|
||||
#5
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
@@ -53,7 +55,7 @@ close $fh;
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( 1, $SKIP ) if ($SKIP);
|
||||
skip( $SKIP, 1 ) if ($SKIP);
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
}
|
||||
#6
|
||||
@@ -86,7 +88,3 @@ eval
|
||||
ok( ($@),
|
||||
"Died on illegal number of elements"
|
||||
);
|
||||
|
||||
|
||||
# chdir back to where we came from
|
||||
chdir $cwd;
|
||||
@@ -1,19 +1,22 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Test::More tests => 2;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
}
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@) {
|
||||
$SKIP = "Test::Differences required for testing. $@";
|
||||
}
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
my $soap = SOAP::WSDL->new();
|
||||
|
||||
|
||||
TODO: {
|
||||
local $TODO="implement <simpleContent> support";
|
||||
fail "serialize simpleContent element";
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
use Test::More tests => 1;
|
||||
use Test::More skip_all => 'TODO: implement tests';
|
||||
use lib '../lib';
|
||||
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More;
|
||||
use strict;
|
||||
use warnings;
|
||||
plan qw/no_plan/;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use Test::More;
|
||||
plan qw/no_plan/;
|
||||
# plan "skip_all", "Not yet supported";
|
||||
# use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing.";
|
||||
}
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@) {
|
||||
$SKIP = "Test::Differences required for testing.";
|
||||
}
|
||||
|
||||
|
||||
@@ -25,15 +19,13 @@ use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $xml;
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
my $path = cwd;
|
||||
|
||||
$path =~s{/attic}{}xms;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
@@ -41,53 +33,35 @@ ok( $soap = SOAP::WSDL->new(
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
$soap->readable(1);
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 1 )
|
||||
),
|
||||
ok ( $xml = $soap->call('test', testElement1 => 1 ) ,
|
||||
'Serialized (simpler) element' );
|
||||
|
||||
# print $xml, "\n";
|
||||
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die 'Cannot open acceptance file '
|
||||
. $path . '/acceptance/results/' . $name . '.xml';
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die 'Cannot open acceptance file '
|
||||
. $path . '/acceptance/results/' . $name . '.xml';
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
SKIP: {
|
||||
skip($SKIP, 1) if ($SKIP);
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
};
|
||||
skip($SKIP, 1) if ($SKIP);
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
}
|
||||
|
||||
TODO: {
|
||||
local $TODO="implement min/maxOccurs checks";
|
||||
|
||||
eval { $soap->call('test', testAll => [ 2, 3 ] ); };
|
||||
|
||||
like $@, qr{illegal\snumber\sof\selements}, "Died on illegal number of elements (too many)";
|
||||
|
||||
eval { $soap->call('test', testAll => undef ) };
|
||||
ok $@, 'Died on illegal number of elements (not enough)';
|
||||
}
|
||||
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 2, 3 ]
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
# print $@;
|
||||
|
||||
ok( ($@ =~m/illegal\snumber\sof\selements/),
|
||||
"Died on illegal number of elements (too many)"
|
||||
);
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
chdir $cwd;
|
||||
+40
-42
@@ -1,74 +1,72 @@
|
||||
BEGIN
|
||||
{
|
||||
chdir 't/' if (-d 't/');
|
||||
use Test::More tests => 7;;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use Test::More tests => 7;;
|
||||
use lib '../lib';
|
||||
use lib 't/lib';
|
||||
use lib 'lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@)
|
||||
{
|
||||
$SKIP = "Test::Differences required for testing.";
|
||||
}
|
||||
our $SKIP;
|
||||
eval "use Test::SOAPMessage";
|
||||
if ($@) {
|
||||
$SKIP = "Test::Differences required for testing.";
|
||||
}
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $soap;
|
||||
my $xml;
|
||||
my $path = cwd();
|
||||
my $name = $0;
|
||||
$name =~s/\.t$//;
|
||||
|
||||
$path =~s{/attic}{}xsm;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file://' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
$soap->readable(1);
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
ok ($xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 'Test'
|
||||
) ), 'Serialized (simpler) element' );
|
||||
ok ($xml = $soap->call('test',
|
||||
testElement1 => 'Test'
|
||||
), 'Serialized (simple) element' );
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| die "Cannot open acceptance results file";
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( $SKIP, 1 ) if ($SKIP);
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
SKIP: {
|
||||
if ($SKIP){
|
||||
print $xml;
|
||||
skip( $SKIP, 1 );
|
||||
}
|
||||
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
};
|
||||
|
||||
eval
|
||||
{
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
TODO: {
|
||||
local $TODO="implement min/maxOccurs checks";
|
||||
|
||||
eval {
|
||||
$xml = $soap->call('test',
|
||||
testAll => [ 'Test 2', 'Test 3' ]
|
||||
)
|
||||
);
|
||||
};
|
||||
);
|
||||
};
|
||||
|
||||
ok( ($@ =~m/illegal\snumber\sof\selements/),
|
||||
ok( ($@ =~m/illegal\snumber\sof\selements/),
|
||||
"Died on illegal number of elements (too many)"
|
||||
);
|
||||
);
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
eval {
|
||||
$xml = $soap->call('test', testAll => undef );
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
}
|
||||
|
||||
@@ -1,98 +1,53 @@
|
||||
use Test::More tests => 10;
|
||||
use Test::More tests => 8;
|
||||
use strict;
|
||||
use lib '../lib';
|
||||
use lib 'lib';
|
||||
use lib 't/lib';
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use Test::SOAPMessage;
|
||||
use diagnostics;
|
||||
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
unless ($SOAP::WSDL::MISSING) { };
|
||||
|
||||
my ($xml, $xml2);
|
||||
my ($soap, $xml, $xml2);
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
my $path = cwd;
|
||||
$path =~s{/attic}{}xms;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
$soap->readable(1);
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
|
||||
#4
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => [ 1, 2 ] )
|
||||
),
|
||||
'Serialized (simple) call (list)' );
|
||||
ok $xml = $soap->call('test', testAll => [ 1, 2 ] ), 'Serialize list call';
|
||||
|
||||
#print $xml, "\n";
|
||||
|
||||
SKIP: {
|
||||
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| skip("Cannot open acceptance results file", 1);
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
#5
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
}
|
||||
print $xml, "\n";
|
||||
|
||||
#5
|
||||
ok ( $xml2 = $soap->call('test', testAll => "1 2" ) , 'Serialized scalar call' );
|
||||
#6
|
||||
ok ( $xml2 = $soap->serializer->method( $soap->call('test',
|
||||
testAll => "1 2" )
|
||||
),
|
||||
'Serialized (simple) call (scalar)' );
|
||||
#7
|
||||
ok( $xml eq $xml2, 'Got expected result');
|
||||
|
||||
#8
|
||||
ok (
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => 2
|
||||
)
|
||||
), "Serialized simple call (scalar value)"
|
||||
);
|
||||
|
||||
#9
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
|
||||
#10
|
||||
SKIP:
|
||||
{
|
||||
skip ("maxLength test not implemented", 1)
|
||||
if ( $SOAP::WSDL::MISSING->{ simpleType }->{ list }->{ maxLength } );
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ]
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (more than maxLength)');
|
||||
|
||||
#7
|
||||
TODO: {
|
||||
local $TODO = "implement minLength check";
|
||||
eval { $xml = $soap->call('test', testAll => undef ) };
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
}
|
||||
|
||||
chdir $cwd;
|
||||
#8
|
||||
TODO: {
|
||||
local $TODO = "maxLength test not implemented";
|
||||
eval { $xml = $soap->call('test', testAll => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ] ) };
|
||||
ok($@, 'Died on illegal number of elements (more than maxLength)');
|
||||
}
|
||||
@@ -1,105 +1,57 @@
|
||||
use Test::More tests => 9;
|
||||
use Test::More tests => 8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use diagnostics;
|
||||
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use lib '../lib';
|
||||
use lib 'lib';
|
||||
use lib 't/lib';
|
||||
|
||||
use Test::SOAPMessage;
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
|
||||
my $xml;
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
my $path = cwd;
|
||||
$path =~s{/attic}{}xms;
|
||||
|
||||
my $soap;
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
|
||||
#3
|
||||
$soap->readable(1);
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->no_dispatch(1);
|
||||
$soap->autotype(0);
|
||||
|
||||
#4
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 1 )
|
||||
),
|
||||
'Serialized (simple) call (list)' );
|
||||
ok $xml = $soap->call('test', testAll => [ 1, 2 ] ) , 'Serialize list call';
|
||||
|
||||
print $xml, "\n";
|
||||
# print $xml, "\n";
|
||||
|
||||
|
||||
SKIP: {
|
||||
skip 'broken', 1;
|
||||
open (my $fh, $path . '/acceptance/results/' . $name . '.xml')
|
||||
|| skip("Cannot open acceptance results file ". $name . '.xml', 1);
|
||||
my $testXML = <$fh>;
|
||||
close $fh;
|
||||
chomp $testXML;
|
||||
chomp $xml;
|
||||
TODO: {
|
||||
local $TODO = "implement minLength/maxLength checks";
|
||||
eval { $soap->call('test', testAll => [ 1, 2, 3 ] ) };
|
||||
ok($@, 'Died on illegal number of elements (too many)');
|
||||
|
||||
soap_eq_or_diff( $xml, $testXML, 'Got expected result');
|
||||
eval { $soap->call('test', testAll => [] ) };
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
}
|
||||
|
||||
# 6
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => [ 1, 2 ]
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => undef
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( "minValue check not implemented ", 1)
|
||||
if ($SOAP::WSDL::MISSING->{ simpleType }->{ restriction }->{ minValue });
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => 0
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal value');
|
||||
TODO: {
|
||||
local $TODO = "minValue check not implemented ";
|
||||
eval { $xml = $soap->call('test', testAll => 0 ) };
|
||||
ok($@, 'Died on illegal value');
|
||||
}
|
||||
|
||||
SKIP:
|
||||
{
|
||||
skip( "maxValue check not implemented ", 1)
|
||||
if ($SOAP::WSDL::MISSING->{ simpleType }->{ restriction }->{ maxValue });
|
||||
eval {
|
||||
$xml = $soap->serializer->method(
|
||||
$soap->call('test',
|
||||
testAll => 100
|
||||
)
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal value');
|
||||
TODO: {
|
||||
local $TODO = "maxValue check not implemented ";
|
||||
eval { $xml = $soap->call('test', testAll => 100 ) };
|
||||
ok($@, 'Died on illegal value');
|
||||
}
|
||||
|
||||
|
||||
chdir $cwd;
|
||||
@@ -1,41 +1,36 @@
|
||||
use Test::More tests => 9;
|
||||
use Test::More skip_all => 'Not supported yet';
|
||||
use strict;
|
||||
use warnings;
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
|
||||
use lib '../lib';
|
||||
|
||||
use_ok(qw/SOAP::WSDL/);
|
||||
use_ok qw/SOAP::WSDL/;
|
||||
|
||||
my $xml;
|
||||
|
||||
# chdir to my location
|
||||
my $cwd = cwd;
|
||||
my $path = dirname( $0 );
|
||||
my $soap = undef;
|
||||
my $name = basename( $0 );
|
||||
$name =~s/\.(t|pl)$//;
|
||||
chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
my $path = cwd;
|
||||
|
||||
$path =~s{/attic}{}xms;
|
||||
|
||||
#2
|
||||
ok( $soap = SOAP::WSDL->new(
|
||||
ok $soap = SOAP::WSDL->new(
|
||||
wsdl => 'file:///' . $path . '/acceptance/wsdl/' . $name . '.wsdl'
|
||||
), 'Instantiated object' );
|
||||
), 'Instantiated object';
|
||||
|
||||
#3
|
||||
ok( $soap->wsdlinit(), 'parsed WSDL' );
|
||||
$soap->readable(1);
|
||||
ok $soap->wsdlinit(), 'parsed WSDL';
|
||||
$soap->no_dispatch(1);
|
||||
$soap->serializer()->namespace('SOAP-ENV');
|
||||
$soap->serializer()->encodingspace('SOAP-ENC');
|
||||
|
||||
#4
|
||||
ok ( $xml = $soap->serializer->method( $soap->call('test',
|
||||
testAll => 1 )
|
||||
),
|
||||
'Serialized (simple) call (list)' );
|
||||
ok $xml = $soap->call('test', testAll => 1 ) , 'Serialized call';
|
||||
|
||||
# print $xml, "\n";
|
||||
print $xml, "\n";
|
||||
|
||||
SKIP: {
|
||||
|
||||
@@ -81,5 +76,3 @@ eval {
|
||||
)
|
||||
};
|
||||
ok($@, 'Died on illegal number of elements (not enough)');
|
||||
|
||||
chdir $cwd;
|
||||
@@ -28,19 +28,6 @@ print "Acceptance test against sample output with simple WSDL\n";
|
||||
my $data = {
|
||||
name => 'test',
|
||||
givenName => 'test',
|
||||
# test => {
|
||||
# name => 'TESTNAME',
|
||||
# givenName => 'GIVENNAME',
|
||||
# },
|
||||
# test1 => {
|
||||
# name => 'TESTNAME',
|
||||
# givenName => 'GIVENNAME',
|
||||
# extend => 'EXTEND',
|
||||
# },
|
||||
# test2 => {
|
||||
# name => 'TESTNAME',
|
||||
# givenName => 'GIVENNAME',
|
||||
# }
|
||||
};
|
||||
|
||||
my $t0 = [gettimeofday];
|
||||
@@ -54,6 +41,8 @@ chdir $path;
|
||||
|
||||
$path = cwd;
|
||||
|
||||
$path =~s{/attic}{}xms;
|
||||
|
||||
|
||||
ok( $soap=SOAP::WSDL->new(
|
||||
wsdl => 'file:///'.$path.'/acceptance/wsdl/11_helloworld.wsdl',
|
||||
@@ -71,9 +60,9 @@ print "WSDL init (".tv_interval ( $t0, [gettimeofday]) ."s)\n" ;
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
do {
|
||||
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
|
||||
my $xml = $soap->call('sayHello', 'sayHello' => %{ $data });
|
||||
|
||||
open (FILE, "acceptance/results/11_helloworld.xml")
|
||||
open (FILE, "../acceptance/results/11_helloworld.xml")
|
||||
|| open (FILE, "t/acceptance/results/11_helloworld.xml") || die "can't open acceptance file";
|
||||
my $xml_test=<FILE>;
|
||||
close FILE;
|
||||
@@ -94,9 +83,9 @@ do {
|
||||
|
||||
$t0 = [gettimeofday];
|
||||
do {
|
||||
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
|
||||
my $xml = $soap->call(sayHello => %{ $data });
|
||||
|
||||
open (FILE, "acceptance/results/11_helloworld.xml")
|
||||
open (FILE, "../acceptance/results/11_helloworld.xml")
|
||||
|| open FILE, ("t/acceptance/results/11_helloworld.xml") || die "can't open acceptance file";
|
||||
my $xml_test=<FILE>;
|
||||
close FILE;
|
||||
|
||||
Reference in new issue
Block a user