createPrinter();//create printer
testUpdateResourceProperties_SCENARIO_B1();//set accepting job state to true
String response = sendPrinterRequest("Set_UpdateDocFormat.soap");
response = createJob(); //create Job
EnvelopeDocument responseEnvelope = loadResponseEnvelope(response);
setJobURL(responseEnvelope);
//set termination time
/* EnvelopeDocument getTermTime = loadDocument("GetTerminationTime.soap");
addReferencePropsToEnvelope(getTermTime, getJobEndpointReference(responseEnvelope).getReferenceProperties() );
response = sendRequest(m_jobURL, getTermTime.newInputStream());
EnvelopeDocument getTermTimeEnvel = loadResponseEnvelope(response);
XmlObject[] childElements = XmlBeanUtils.getChildElements(getTermTimeEnvel.getEnvelope().getBody());
GetResourcePropertyResponseDocument.GetResourcePropertyResponse termTime = (GetResourcePropertyResponseDocument.GetResourcePropertyResponse) childElements[0];
childElements = XmlBeanUtils.getChildElements(termTime);
XmlDateTimeImpl o = (XmlDateTimeImpl) childElements[0];
Calendar terminationTime = o.getCalendarValue();
*/
EnvelopeDocument setTerminationDoc = loadDocument("SetTerminationTime.soap");
addReferencePropsToEnvelope(setTerminationDoc, getJobEndpointReference(responseEnvelope).getReferenceProperties());
Calendar newTermTime = Calendar.getInstance();
newTermTime.set(Calendar.MINUTE, newTermTime.get(Calendar.MINUTE) + 1);
System.out.println("Setting termination time on JOB: ");
Envelope requestEnvelope = setTerminationDoc.getEnvelope();
XmlObject[] termElems = XmlBeanUtils.getChildElements(requestEnvelope.getBody());
SetTerminationTimeDocument.SetTerminationTime childElement = (SetTerminationTimeDocument.SetTerminationTime) termElems[0];
childElement.setRequestedTerminationTime(newTermTime);
response = sendRequest(m_jobURL, setTerminationDoc.newInputStream());
//send a document
EnvelopeDocument envelopeDocument = loadDocument("SendDocument.soap");
addReferencePropsToEnvelope(envelopeDocument, getJobEndpointReference(responseEnvelope).getReferenceProperties());
response = sendRequest(m_jobURL, envelopeDocument.newInputStream());
assertTrue(response.indexOf("Fault") == -1);
try
{
Thread.sleep(120000L);
}
catch (InterruptedException e)
{
;
}
//this request should be bad and return with a fault if the Job successfully timed out
envelopeDocument = loadDocument("SendDocument.soap");
addReferencePropsToEnvelope(envelopeDocument, getJobEndpointReference(responseEnvelope).getReferenceProperties());
response = sendRequest(m_jobURL, envelopeDocument.newInputStream());
assertTrue(response.indexOf("ResourceUnknownFault") > -1);
}