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

Code
Comments
Other
Rev Date Author Line
3486 16 Nov 09 gregory 1 # PUT empty file in project directory
3486 16 Nov 09 gregory 2 # Count file items
3486 16 Nov 09 gregory 3 generate_name
3486 16 Nov 09 gregory 4 echo "Name" > $A
3486 16 Nov 09 gregory 5 echo "$name" >> $A
3486 16 Nov 09 gregory 6 PUT "$A" "$resource/projects?$auth"
3493 23 Nov 09 gregory 7 GET "$B" "$resource/projects?$auth&select=Id&whereName==$name"
3486 16 Nov 09 gregory 8 lastid=`tail -n 1 $B | perl -ane '/(\d+)/; print \$1;'`
3486 16 Nov 09 gregory 9 GET "$C" "$resource/projects/$lastid/files?$auth" 
3486 16 Nov 09 gregory 10 # Should be 1, header only
3486 16 Nov 09 gregory 11 count=`grep -c -h "" $C`
3486 16 Nov 09 gregory 12   # Filename is the same as project name
3486 16 Nov 09 gregory 13 PUT "$A" "$resource/projects/$lastid/files?$auth" 
3493 23 Nov 09 gregory 14 GET "$D" "$resource/projects/$lastid/files?$auth&select=Id&whereName==$name"
3486 16 Nov 09 gregory 15 count2=`grep -c -h "" $D`
3486 16 Nov 09 gregory 16 if [ "$count2" != "2" ]; then
3486 16 Nov 09 gregory 17         fail "$test" "File was not created in the project directory. Check $A, $B and $C"
3486 16 Nov 09 gregory 18 fi
3486 16 Nov 09 gregory 19 # $Id$