script/03.shipped.write.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl
2  
3 BEGIN{push @INC, "./../blib/lib/"}
4  
5 use Biblio::ILL::ISO::Shipped;
6  
7 #
8 # transaction-id
9 #
10 my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","",
11 new Biblio::ILL::ISO::SystemId("MWPL"));
12  
13 #
14 # service-date-time
15 #
16 my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"),
17 new Biblio::ILL::ISO::DateTime("20030623","114015")
18 );
19 #
20 # requester-id
21 #
22 my $reqid = new Biblio::ILL::ISO::SystemId();
23 $reqid->set_person_name("David A. Christensen");
24  
25 #
26 # responder-id
27 #
28 my $resid = new Biblio::ILL::ISO::SystemId("MWPL");
29  
30 #
31 # responder-address
32 #
33 my $rad = new Biblio::ILL::ISO::SystemAddress("SMTP","DChristensen\@westman.wave.ca");
34  
35 #
36 # intermediary-id
37 #
38 my $iid = new Biblio::ILL::ISO::SystemId();
39 $iid->set_institution_name("The Great Library of Alexandria");
40  
41 #
42 # supplier-id
43 #
44 my $sid = new Biblio::ILL::ISO::SystemId("MWPL");
45  
46 #
47 # client-id
48 #
49 my $cid = new Biblio::ILL::ISO::ClientId("David Christensen","Most excellent","007");
50  
51 #
52 # transaction-type
53 #
54 my $tt = new Biblio::ILL::ISO::TransactionType("simple");
55  
56 #
57 # shipped-service-type
58 #
59 my $sst = new Biblio::ILL::ISO::ShippedServiceType("loan");
60  
61 #
62 # responder-optional-messages
63 #
64 my $rom = new Biblio::ILL::ISO::ResponderOptionalMessageType(1,1,"desires","requires");
65  
66 #
67 # supply-details
68 #
69 my $sd = new Biblio::ILL::ISO::SupplyDetails("20030813",
70 "20030920",
71 123,
72 "45.67",
73 new Biblio::ILL::ISO::ShippedConditions("no-reproduction"),
74 new Biblio::ILL::ISO::ShippedVia( new Biblio::ILL::ISO::TransportationMode("Canada Post") ),
75 new Biblio::ILL::ISO::Amount("50.00"),
76 "50.00",
77 new Biblio::ILL::ISO::UnitsPerMediumType( new Biblio::ILL::ISO::SupplyMediumType("audio-recording"), 3)
78 );
79  
80  
81 #
82 # return-to-address
83 #
84 my $rta = new Biblio::ILL::ISO::PostalAddress("Manitoba Public Library Services",
85 "",
86 "Unit 200",
87 "1525 First Street South",
88 "",
89 "Brandon",
90 "MB",
91 "CANADA",
92 "R7A 7A1"
93 );
94  
95  
96 #
97 # responder-note
98 #
99 my $rn = new Biblio::ILL::ISO::ILLString("This is a responder note.");
100  
101  
102 #-------------------------------------------------------------------------------------------
103  
104 my $msg = new Biblio::ILL::ISO::Shipped();
105  
106 # Minimum required:
107 $msg->set_protocol_version_num("version-2");
108 $msg->set_transaction_id( $tid );
109 $msg->set_service_date_time( $sdt );
110 $msg->set_transaction_type( $tt );
111 $msg->set_shipped_service_type( $sst );
112 $msg->set_supply_details( $sd );
113  
114 # Extra, useful info:
115 $msg->set_requester_id( $reqid );
116 $msg->set_responder_id( $resid );
117 $msg->set_responder_address( $rad );
118 $msg->set_intermediary_id( $iid );
119 $msg->set_supplier_id( $sid );
120 $msg->set_client_id( $cid );
121 $msg->set_return_to_address( $rta );
122 $msg->set_responder_note( $rn );
123  
124 #
125 #print "\n-as_pretty_string------------------------------------\n";
126 #print $msg->as_pretty_string();
127 #print "\n-----------------------------------------------------\n";
128 #
129 #print "\n-debug(ans->as_asn())--------------------------------\n";
130 #my $href = $msg->as_asn();
131 #print $msg->debug($href);
132 #print "\n-----------------------------------------------------\n";
133 #
134 #$msg->encode();
135 #
136  
137 #print "\n-write-----------------------------------------------\n";
138 $msg->write("msg_03.shipped.ber");
139 #print "\n-----------------------------------------------------\n";
140  
141 #print "---end---\n";
142