client/servlet/test/src/webservice/tests/t9.sh

Code
Comments
Other
Rev Date Author Line
3486 16 Nov 09 gregory 1 # Mark file for deletion
3486 16 Nov 09 gregory 2 generate_name
3486 16 Nov 09 gregory 3 echo -e "Name\tDescription" > $A
3486 16 Nov 09 gregory 4 echo -e "${i}_$name\tThis is the ${i}:th file" >> $A
3486 16 Nov 09 gregory 5 PUT "$A" "$resource/files?$auth" 
3486 16 Nov 09 gregory 6 GET "$B" "$resource/files?$auth&select=Id&whereName==${i}_$name"
3486 16 Nov 09 gregory 7 lastid=`tail -n 1 $B | perl -ane '/(\d+)/; print \$1;'`
3486 16 Nov 09 gregory 8 DELETE "$resource/files/$lastid?$auth"
3486 16 Nov 09 gregory 9 GET "$C" "$resource/files?$auth&select=Name,Removed&whereName==${i}_$name"
3486 16 Nov 09 gregory 10 removed=`grep $name $C`
3486 16 Nov 09 gregory 11 if [ "$removed" != "" ]; then
3486 16 Nov 09 gregory 12   fail "$test" "File should have been marked as removed, but was not."
3486 16 Nov 09 gregory 13 fi
3486 16 Nov 09 gregory 14 # $Id$