Revision 9234
Added by ben leinfelder over 9 years ago
src/perl/Metacat/Metacat.pm | ||
---|---|---|
184 | 184 |
|
185 | 185 |
my $response = $self->sendData(%postData); |
186 | 186 |
|
187 |
my $returnval = 1; |
|
188 |
if (($response) && $response->content =~ /<logout>/) { |
|
189 |
$returnval = 0; |
|
190 |
} |
|
191 |
|
|
187 | 192 |
# clear the cookie |
188 | 193 |
my $cookie_jar = $self->{'cookies'}; |
189 | 194 |
$$cookie_jar->clear(); |
190 | 195 |
|
191 |
return $response->content;
|
|
196 |
return $returnval;
|
|
192 | 197 |
} |
193 | 198 |
|
194 | 199 |
############################################################# |
src/perl/Metacat/test.pl | ||
---|---|---|
40 | 40 |
# Insert your test code below (better if it prints "ok 13" |
41 | 41 |
# (correspondingly "not ok 13") depending on the success of chunk 13 |
42 | 42 |
# of the test code): |
43 |
my $metacatUrl = "http://snow.joneseckert.org:8080/metacat/metacat";
|
|
44 |
my $username = 'uid=jones,o=NCEAS,dc=ecoinformatics,dc=org';
|
|
45 |
my $password = 'your-pw-goes-here';
|
|
43 |
my $metacatUrl = "https://dev.nceas.ucsb.edu/knb/metacat";
|
|
44 |
my $username = 'uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org';
|
|
45 |
my $password = 'kepler';
|
|
46 | 46 |
|
47 | 47 |
# Set up a date stamp |
48 | 48 |
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); |
... | ... | |
139 | 139 |
print $metacat->getMessage(); |
140 | 140 |
print "not ok 9 getlastid\n"; |
141 | 141 |
} |
142 |
|
|
143 |
# Chunk 10: Test metacat logout |
|
144 |
my $response = $metacat->logout($username, $password); |
|
145 |
if ($response) { |
|
146 |
print "ok 10 logout\n"; |
|
147 |
} else { |
|
148 |
print $metacat->getMessage(); |
|
149 |
print "not ok 10 logout\n"; |
|
150 |
} |
Also available in: Unified diff
correct logout method (old change still in workspace)