# check-job-state.test - include file for use with any test # Test that the job still exists and is in the expected state. # NOTE: Cannot be used to test 'canceled' or 'completed' # where some implementations MAY not keep the job around. # Version 0.1 # Last revised by Xerox Corporation on 99-02-28 13:00 PST. # Copyright (c) 1998, 1999 by Xerox Corporation. All rights reserved. # User is granted the right to modify this file for use with # the IPP Server Test Tool, as described in the file # LICENSE-IppTest.txt. # # The calling program has already set the three symbols: # first-job-id - job-id of job to be tested to see if canceled # first-job-uri - job-uri of job to be tested to see if canceled # expected-job-state - the expected job state: pending, processing, ... # IfNDef first-job-id Echo 'ERROR IN SCRIPT: first-job-id symbol not defined;' Echo 'needed by check-job-state.test include file procedure' Define first-job-id 1 Else IfNDef first-job-uri Define first-job-uri 'http://dummy-url' EndIf # Get all job attributes - be forgiving Get-Job-Attributes \ target: $target, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ printer-uri: $target, \ job-id: $first-job-id, \ requested-attributes: \ ) \ ) \ @ Check that the job $first-job-id is NOW in the expected state # Be forgiving, we're only interested in the job state. Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ ... \ ), \ Job: ( \ job-uri: $first-job-uri, \ job-id: $first-job-id, \ job-state: $expected-job-state, \ ... \ ), \ ) # Now try by job-uri: Get-Job-Attributes \ target: $first-job-uri, \ attributes: ( \ Operation: ( \ attributes-charset: utf-8, \ attributes-natural-language: en-us, \ job-uri: $first-job-uri, \ requested-attributes: \ ) \ ) \ @ Check that the job $first-job-uri is NOW in the expected state # Be forgiving, we're only interested in the job state. Expect Response \ status-code: successful-ok, \ attributes: ( \ Operation: ( \ ... \ ), \ Job: ( \ job-uri: $first-job-uri, \ job-id: $first-job-id, \ job-state: $expected-job-state, \ ... \ ), \ ) EndIf