File: 011_simpleType.t

package info (click to toggle)
libsoap-wsdl-perl 3.004-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,600 kB
  • sloc: perl: 8,433; xml: 1,769; java: 19; makefile: 15
file content (36 lines) | stat: -rw-r--r-- 1,311 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/perl
use Test::More qw(no_plan);
use strict;
use lib 'lib/';
use lib 't/lib/';
use lib '../lib/';

use_ok qw(MySimpleType);

# simple type derived from builtin via restriction
my $obj = MySimpleType->new({ value => 'test'});
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType')
    , 'inherited class';
is $obj, 'test', 'stringification';

# simple type derived from builtin via list
$obj = MySimpleListType->new({ value => [ 'test', 'test2' ]});
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType')
    , 'inherited class';
ok $obj->isa('SOAP::WSDL::XSD::Typelib::Builtin::list')
    , 'inherited class';
is $obj->serialize(), 'test test2', 'stringification';

# simple type derived from atomic simple type (restriction)
$obj = MyAtomicSimpleType->new({ value => 'test' });
ok $obj->isa('MySimpleType') , 'inherited class';
ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction')
    , 'inherited class';
is $obj, 'test', 'stringification';

# simple type derived from atomic simple type (list)
$obj = MyAtomicSimpleListType->new({ value => [ 'test', 'test2' ] });
ok $obj->isa('MySimpleListType') , 'inherited class';
ok $obj->isa('SOAP::WSDL::XSD::Typelib::SimpleType::restriction')
    , 'inherited class';
is $obj->serialize(), 'test test2', 'stringification';