You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by sc...@apache.org on 2005/03/01 21:26:57 UTC

svn commit: r155820 - in incubator/apollo/trunk/src/site/content/example: requests/ src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/ src/test/org/oasisOpen/docs/wsrf/

Author: scamp
Date: Tue Mar  1 12:26:55 2005
New Revision: 155820

URL: http://svn.apache.org/viewcvs?view=rev&rev=155820
Log:
updated for interop scenarios

Added:
    incubator/apollo/trunk/src/site/content/example/requests/QueryJobsCompleted.soap
    incubator/apollo/trunk/src/site/content/example/requests/SetTerminationTime.soap
    incubator/apollo/trunk/src/site/content/example/requests/Set_DeleteDocFormat.soap
    incubator/apollo/trunk/src/site/content/example/requests/Set_InsertDocFormat.soap
Modified:
    incubator/apollo/trunk/src/site/content/example/requests/QueryPropertiesDoc.soap
    incubator/apollo/trunk/src/site/content/example/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortResource.java
    incubator/apollo/trunk/src/site/content/example/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java

Added: incubator/apollo/trunk/src/site/content/example/requests/QueryJobsCompleted.soap
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/requests/QueryJobsCompleted.soap?view=auto&rev=155820
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/requests/QueryJobsCompleted.soap (added)
+++ incubator/apollo/trunk/src/site/content/example/requests/QueryJobsCompleted.soap Tue Mar  1 12:26:55 2005
@@ -0,0 +1,20 @@
+
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+	  xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
+          xmlns:wsrf-pr="http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.xsd">
+
+   <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+      <wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterPort</wsa:To>
+      <wsa:Action mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterPort</wsa:Action>  
+     
+   </Header>
+
+   <Body>
+       <wsrf-rp:QueryResourceProperties>
+         <wsrf-rp:QueryExpression Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">         
+         job_properties[contains(job_state,"completed")]
+         </wsrf-rp:QueryExpression>
+      </wsrf-rp:QueryResourceProperties>           
+   </Body>
+
+</Envelope>

Modified: incubator/apollo/trunk/src/site/content/example/requests/QueryPropertiesDoc.soap
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/requests/QueryPropertiesDoc.soap?view=diff&r1=155819&r2=155820
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/requests/QueryPropertiesDoc.soap (original)
+++ incubator/apollo/trunk/src/site/content/example/requests/QueryPropertiesDoc.soap Tue Mar  1 12:26:55 2005
@@ -10,7 +10,7 @@
    </Header>
 
    <Body>
-       <wsrf-rp:QueryResourceProperties xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
+       <wsrf-rp:QueryResourceProperties>
          <wsrf-rp:QueryExpression Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">         
          contains(/*/*[namespace-uri()='http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.xsd' and local-name()='operations_supported'],"Print_Job")
          </wsrf-rp:QueryExpression>

Added: incubator/apollo/trunk/src/site/content/example/requests/SetTerminationTime.soap
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/requests/SetTerminationTime.soap?view=auto&rev=155820
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/requests/SetTerminationTime.soap (added)
+++ incubator/apollo/trunk/src/site/content/example/requests/SetTerminationTime.soap Tue Mar  1 12:26:55 2005
@@ -0,0 +1,20 @@
+
+
+
+
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"	 
+          xmlns:wsrf-rl="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsd">
+
+   <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+      <wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterFactory</wsa:To>
+      <wsa:Action mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterFactory</wsa:Action>     
+   </Header>
+
+   <Body>      
+     <wsrf-rl:SetTerminationTime>
+        <wsrf-rl:RequestedTerminationTime>2005-03-01T09:25:00.0Z                                                  
+        </wsrf-rl:RequestedTerminationTime>
+     </wsrf-rl:SetTerminationTime>              
+   </Body>
+
+</Envelope>

Added: incubator/apollo/trunk/src/site/content/example/requests/Set_DeleteDocFormat.soap
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/requests/Set_DeleteDocFormat.soap?view=auto&rev=155820
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/requests/Set_DeleteDocFormat.soap (added)
+++ incubator/apollo/trunk/src/site/content/example/requests/Set_DeleteDocFormat.soap Tue Mar  1 12:26:55 2005
@@ -0,0 +1,19 @@
+
+
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+	  xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
+          xmlns:wsrf-pr="http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.xsd">
+
+   <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+      <wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterFactory</wsa:To>
+      <wsa:Action mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterFactory</wsa:Action>         
+   </Header>
+
+   <Body>
+      <wsrf-rp:SetResourceProperties>
+        <wsrf-rp:Delete 
+            ResourceProperty="wsrf-pr:document_format_supported" />       
+   </wsrf-rp:SetResourceProperties>
+   </Body>
+
+</Envelope>

Added: incubator/apollo/trunk/src/site/content/example/requests/Set_InsertDocFormat.soap
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/requests/Set_InsertDocFormat.soap?view=auto&rev=155820
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/requests/Set_InsertDocFormat.soap (added)
+++ incubator/apollo/trunk/src/site/content/example/requests/Set_InsertDocFormat.soap Tue Mar  1 12:26:55 2005
@@ -0,0 +1,23 @@
+
+
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+	  xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
+          xmlns:wsrf-pr="http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.xsd">
+
+   <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+      <wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterFactory</wsa:To>
+      <wsa:Action mustUnderstand="1">http://localhost:8080/wsrf/services/PrinterFactory</wsa:Action>         
+   </Header>
+
+   <Body>
+      <wsrf-rp:SetResourceProperties>
+          <wsrf-rp:Insert>        
+           <document_format_supported>
+	    <mimeMediaType>foo</mimeMediaType>
+	    <mimeMediaType>bar</mimeMediaType>
+           </document_format_supported>      
+      </wsrf-rp:Insert>
+   </wsrf-rp:SetResourceProperties>
+   </Body>
+
+</Envelope>

Modified: incubator/apollo/trunk/src/site/content/example/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortResource.java
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortResource.java?view=diff&r1=155819&r2=155820
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortResource.java (original)
+++ incubator/apollo/trunk/src/site/content/example/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortResource.java Tue Mar  1 12:26:55 2005
@@ -15,26 +15,24 @@
  *=============================================================================*/
 package org.oasisOpen.docs.wsrf.x2005.x01.wsrfInterop20Draft03Wsdl;
 
+import commonj.timers.Timer;
+import commonj.timers.TimerListener;
+import commonj.timers.TimerManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.properties.ResourceProperty;
 import org.apache.ws.resource.properties.impl.XmlBeansResourceProperty;
 import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
-import org.apache.ws.resource.i18n.MessagesImpl;
-import org.apache.ws.util.timer.TimerImpl;
-import org.apache.ws.util.timer.TimerManagerImpl;
 import org.apache.ws.util.i18n.Messages;
+import org.apache.ws.util.timer.TimerManagerImpl;
 import org.apache.xmlbeans.XmlInteger;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.oasisOpen.docs.wsrf.x2005.x01.wsrfInterop20Draft03.*;
 import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType;
 
 import java.math.BigInteger;
 import java.util.*;
 
-import commonj.timers.TimerListener;
-import commonj.timers.Timer;
-import commonj.timers.TimerManager;
-
 /**
  * A PrinterPort WS-Resource.
  * <p/>
@@ -128,12 +126,25 @@
        {
         if (m_timer == null) {
            resetTimer();
+           setPrinterStateProcessing();
         }
        }
         //LOG.debug( MSG.getMessage( Keys.QUEUING_JOB, job.m_id ) );
         m_printQueue.add(job);
     }
 
+    private void setPrinterStateProcessing()
+    {
+        setPrinterState(PrinterStateType.PROCESSING);
+    }
+
+    private void setPrinterState(PrinterStateType.Enum printerState)
+    {
+        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.PRINTER_STATE);
+        PrinterStateType state = (PrinterStateType) resourceProperty.get(0);
+        state.set(printerState);
+    }
+
     public void resetTimer() {
         //scale and translate the random to get a number between 1 and 3 mins
        // double doubleLength = m_random.nextDouble() * 120000.0 + 60000.0;
@@ -147,20 +158,60 @@
 
         //make sure we have something in queue, remove the 0th print job
         if (m_printQueue.size() > 0) {
+            if( !isPrinterStopped())
+            {
             JobPortResource job = (JobPortResource) m_printQueue.remove(0);
-            //LOG.debug( MSG.getMessage( Keys.PRINTING_JOB, job.m_id ) );
-            //set termination time to now to make it be removed.
-            job.setTerminationTime(Calendar.getInstance());
-            //todo set job status
-            //todo remove jobprops from printer props
-            XmlBeansResourcePropertySet jobPropSet = (XmlBeansResourcePropertySet) job.getResourcePropertySet();
-                        
-            ResourceProperty  printerJobProperties = getResourcePropertySet(  ).get( PrinterPortPropertyQNames.JOB_PROPERTIES );
-            printerJobProperties.remove(jobPropSet.toXmlObject());
 
-            decrementQueueCount();
+                if ( !isJobCancelledOrAborted(job))
+                {
+                    setJobState(job, JobStateType.PROCESSING);
+                    //LOG.debug( MSG.getMessage( Keys.PRINTING_JOB, job.m_id ) );
+                    //set termination time to now to make it be removed.
+                    job.setTerminationTime(Calendar.getInstance());
+                    //todo set job status
+                    //todo remove jobprops from printer props
+                    XmlBeansResourcePropertySet jobPropSet = (XmlBeansResourcePropertySet) job.getResourcePropertySet();
+
+                    ResourceProperty  printerJobProperties = getResourcePropertySet(  ).get( PrinterPortPropertyQNames.JOB_PROPERTIES );
+                    printerJobProperties.remove(jobPropSet.toXmlObject());
+
+                    decrementQueueCount();
+                    setJobState(job, JobStateType.COMPLETED);
+                }
+            }
+        }
+        else
+        {
+           setPrinterStateIdleProcessing();
         }
         resetTimer();//restart timer
+    }
+
+    private boolean isJobCancelledOrAborted(JobPortResource job)
+    {
+        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) job.getResourcePropertySet().get(JobPortPropertyQNames.JOB_STATE);
+        JobStateType o = (JobStateType) resourceProperty.get(0);
+        org.apache.xmlbeans.StringEnumAbstractBase stateVal = o.enumValue();
+        return stateVal == JobStateType.ABORTED || stateVal == JobStateType.CANCELED || stateVal == JobStateType.COMPLETED;
+    }
+
+    private void setJobState(JobPortResource job, JobStateType.Enum state)
+    {
+        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) job.getResourcePropertySet().get(JobPortPropertyQNames.JOB_STATE);
+        JobStateType o = (JobStateType) resourceProperty.get(0);
+        o.set(state);
+    }
+
+    private void setPrinterStateIdleProcessing()
+    {
+        setPrinterState(PrinterStateType.IDLE);
+    }
+
+    private boolean isPrinterStopped()
+    {
+        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.PRINTER_STATE);
+        PrinterStateType state = (PrinterStateType) resourceProperty.get(0);
+        return state.enumValue() == PrinterStateType.STOPPED;
     }
 
     private void decrementQueueCount() {

Modified: incubator/apollo/trunk/src/site/content/example/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java?view=diff&r1=155819&r2=155820
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java (original)
+++ incubator/apollo/trunk/src/site/content/example/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java Tue Mar  1 12:26:55 2005
@@ -17,7 +17,8 @@
  * Time: 10:20:29 AM
  * To change this template use File | Settings | File Templates.
  */
-public class InteropTestCase extends AbstractOneAxisTestCase {
+public class InteropTestCase extends AbstractOneAxisTestCase
+{
     //this makes the test case not start the axis server...
     private static boolean m_runAxisServer = true;
     private static String PRINTER_FACTORY_PORT = "PrinterFactory";
@@ -37,15 +38,18 @@
     private static final String SOAP_REQ_CREATE_PRINTER = "CreatePrinter.soap";
 
 
-    public InteropTestCase() {
+    public InteropTestCase()
+    {
         super(m_runAxisServer);
 
     }
 
-    protected void setUp() throws Exception {
+    protected void setUp() throws Exception
+    {
         super.setUp();
         //set the base url to the Axis one if running server embedded in unit test
-        if (m_runAxisServer) {
+        if (m_runAxisServer)
+        {
             m_baseURL = getAxisBaseUrl().toString();
 
             //reinit urls for axis path
@@ -56,146 +60,214 @@
             XmlBeanJndiUtils.initializeFromInputStream(Thread.currentThread().getContextClassLoader().getResourceAsStream(XmlBeanJndiUtils.JNDI_CONFIG_FILENAME));
         }
 
-        //init the printer so its ready///todo not sure if should do it here...
+        //init the printer so its ready///todo not sure if should do it here...maybe in scenarios...
         createPrinter();
     }
 
-    protected FileProvider getFileProvider() throws ConfigurationException {
+    protected FileProvider getFileProvider() throws ConfigurationException
+    {
         return new FileProvider(InteropTestCase.class.getResourceAsStream("/server-config.wsdd"));
     }
 
     //*****  tests ********
-    public void createPrinter() throws IOException {
+    public void createPrinter() throws IOException
+    {
         String response = sendRequest(m_printerFactoryURL, SOAP_REQ_CREATE_PRINTER);
         assertTrue(response.indexOf("CreatePrinterResponse") > -1);
     }
 
-    public void testValidatePrinterInitialState() throws IOException {
+    public void testValidatePrinterInitialState() throws IOException
+    {
         String response = sendRequest(m_printerURL, "GetPrinterPropertiesDoc.soap");
         assertTrue(response.indexOf("printer_properties") > -1);
         assertTrue(response.indexOf("job_count>0") > -1);
         assertTrue(response.indexOf("accepting_jobs>false") > -1);
     }
 
-    public void testGetPrinterQueueCount_SCENARIO_A1() throws IOException {
+    public void testGetPrinterQueueCount_SCENARIO_A1() throws IOException
+    {
         String response = sendRequest(m_printerURL, "GetQueuedJobCount.soap");
         assertTrue(response.indexOf("GetResourcePropertyResponse") > -1);
         assertTrue(response.indexOf("draft-03.xsd\">0") > -1);
     }
 
-    public void testGetPrinterStateAndQueueCount_SCENARIO_A2() throws IOException {
+    public void testGetPrinterStateAndQueueCount_SCENARIO_A2() throws IOException
+    {
         String response = sendRequest(m_printerURL, "GetMulti.soap");
         assertTrue(response.indexOf("GetMultipleResourcePropertiesResponse") > -1);
         assertTrue(response.indexOf("Idle") > -1);
         assertTrue(response.indexOf("raft-03.xsd\">0") > -1);
     }
 
-    public void testGetPrinterResourcePropertiesDocument_SCENARIO_A3() throws IOException {
+    public void testGetPrinterResourcePropertiesDocument_SCENARIO_A3() throws IOException
+    {
         String response = sendRequest(m_printerURL, "GetPrinterPropertiesDoc.soap");
-        assertTrue(response.indexOf("GetResourcePropertyDocumentResponse")> -1);
+        assertTrue(response.indexOf("GetResourcePropertyDocumentResponse") > -1);
         assertTrue(response.indexOf("printer_properties") > -1);
         assertTrue(response.indexOf("operations_supported") > -1);
     }
 
-    public void testQueryResourceProperties_SCENARIO_A4() throws IOException {
+    public void testQueryResourceProperties_SCENARIO_A4() throws IOException
+    {
         String response = sendRequest(m_printerURL, "QueryPropertiesDoc.soap");
         assertTrue(response.indexOf("QueryResourcePropertiesResponse") > -1);
         assertTrue(response.indexOf("true") > -1);
     }
 
-    public void testQueryCompletedJobs_SCENARIO_A4_VARIANT() throws IOException {
-        //job_properties[contains(job_state,"completed")]/*
-        //todo ensure job state is set to completed      QueryJobsCompleted.soap
+    public void testQueryCompletedJobs_SCENARIO_A4_VARIANT() throws IOException
+    {
         String response = sendRequest(m_printerURL, "QueryJobsCompleted.soap");
         assertTrue(response.indexOf("QueryResourcePropertiesResponse") > -1);
-        //assertTrue(response.indexOf("true") > -1);
+        //todo look at response to see how to validate
+        //assertTrue(response.indexOf("true") > -1);//check further once understand issue
     }
 
-    public void testUpdateResourceProperties_SCENARIO_B1() {
+    public void testUpdateResourceProperties_SCENARIO_B1() throws IOException
+    {
+        String response = sendRequest(m_printerURL, "UpdateProps.soap");
+        assertTrue(response.indexOf("UpdateResourcePropertiesResponse") > -1);
+    }
 
+    public void testFailInsertResourceProps_SCENARIO_B1_FAIL() throws IOException
+    {
+        String response = sendRequest(m_printerURL, "InsertProps.soap");
+        assertTrue(response.indexOf("InvalidInsertResourcePropertiesRequestContent") > -1);
     }
 
-    public void testFailInsertResourceProps_SCENARIO_B1_FAIL() {
+    public void testSetResourceProperties_SCENARIO_B2() throws IOException
+    {
+        String response = sendRequest(m_printerURL, "Set_UpdateDocFormat.soap");
+        assertTrue(response.indexOf("SetResourcePropertiesResponse") > -1);
+        response = sendRequest(m_printerURL, "GetPrinterPropertiesDoc.soap");
+        assertTrue(response.indexOf("text/plain") > -1);
+        assertTrue(response.indexOf("application/postscript") > -1);
 
-    }
+        //todo document_format_supported insert/delete should fail
+        response = sendRequest(m_printerURL, "Set_DeleteDocFormat.soap");
+        assertTrue(response.indexOf("fault") > -1);
+        response = sendRequest(m_printerURL, "Set_InsertDocFormat.soap");
+        assertTrue(response.indexOf("fault") > -1);
 
-    public void testSetResourceProperties_SCENARIO_B2() {
-        //validate printer props are updated
     }
 
-    public void testMultiSetResourceProps_SCENARIO_B3() {
+    public void testMultiSetResourceProps_SCENARIO_B3() throws IOException
+    {
         //there are 2 calls in the spec
-    }
-
-    public void testFailMultiSetResourceProps_SCENARIO_B3_VARIANT() {
+        String response = sendRequest(m_printerURL, "Set_MultiInsertJobHold.soap");
+        assertTrue(response.indexOf("SetResourcePropertiesResponse") > -1);
 
+        //insert Overnight
+        response = sendRequest(m_printerURL, "Set_InsertJobHoldOvernight.soap");
+        assertTrue(response.indexOf("SetResourcePropertiesResponse") > -1);
+        response = sendRequest(m_printerURL, "GetPrinterPropertiesDoc.soap");
+        assertTrue(response.indexOf("Overnight") > -1);
     }
 
-    public void testResetToInitialState_SCENARIO_B3_RESET() {
+    public void testFailMultiSetResourceProps_SCENARIO_B3_VARIANT() throws IOException
+    {
+        String response = sendRequest(m_printerURL, "Set_Should_Fail.soap");
+        assertTrue(response.indexOf("fault") > -1);
+    }
 
+    public void testResetToInitialState_SCENARIO_B3_RESET() throws IOException
+    {
+        String response = sendRequest(m_printerURL, "Set_MultiDelete.soap");
+        assertTrue(response.indexOf("SetResourcePropertiesResponse") > -1);
+        response = sendRequest(m_printerURL, "GetPrinterPropertiesDoc.soap");
+        assertTrue(response.indexOf("job_hold_until_default") > -1);
+        assertTrue(response.indexOf("_hold_until_supported") > -1);
     }
 
-    public void testPrintJob_SCENARIO_C() {
+    public void testPrintJob_SCENARIO_C() throws IOException
+    {
+        String response = sendRequest(m_printerURL, "PrintJobRequest.soap");
+        assertTrue(response.indexOf("CreationResponse") > -1);
+        assertTrue(response.indexOf("successful-ok") > -1);
 
     }
 
-    public void testValidatePrinterJobProperties() {
-        //job_state pending until printing starts
-        //todo look at job states
+    public void testValidatePrinterJobProperties() throws IOException
+    {
+        String response = sendRequest(m_printerURL, "GetPrinterPropertiesDoc.soap");
+        assertTrue(response.indexOf("job_properties") > -1);
+        assertTrue(response.indexOf("job_reference") > -1);
+        assertTrue(response.indexOf("pending") > -1);
     }
 
-    public void testDestroy_SCENARIO_D() {
-
+    public void testDestroy_SCENARIO_D() throws IOException
+    {
         //note a second destroy should fail
-
+        String response = sendRequest(m_jobURL, "Destroy_Job.soap");
+        assertTrue(response.indexOf("DestroyResponse") > -1);
     }
 
-    public void testFailDestroy_SCENARIO_D_FAIL() {
-
+    public void testFailDestroy_SCENARIO_D_FAIL() throws IOException
+    {
         //note a second destroy should fail
-
+        String response = sendRequest(m_jobURL, "Destroy_Job.soap");
+        assertTrue(response.indexOf("fault") > -1);
     }
 
-    public void testScheduledTermination_SCENARIO_E() {
+    public void testScheduledTermination_SCENARIO_E() throws IOException
+    {
+        String response = sendRequest(m_jobURL, "Create_Job.soap");
+        assertTrue(response.indexOf("CreationResponse") > -1);
+        assertTrue(response.indexOf("successful-ok") > -1);
 
-        //validateprinterjobprops
+        response = sendRequest(m_printerURL, "GetPrinterPropertiesDoc.soap");
+        assertTrue(response.indexOf("<job_id>2") > -1);
     }
 
-    public void testSetTerminationTime_SCENARIO_E_CONTINUED() {
-
+    public void testSetTerminationTime_SCENARIO_E_CONTINUED() throws IOException
+    {
+        //may need to do this in code to account for date time change
+        String response = sendRequest(m_jobURL, "SetTerminationTime.soap");
+        assertTrue(response.indexOf("GetResourcePropertyResponse") > -1);
+        //todo check this one
     }
 
-    public void testSendDocument_SCENARIO_E_CONTINUED() {
+    public void testSendDocument_SCENARIO_E_CONTINUED() throws IOException
+    {
+        String response = sendRequest(m_jobURL, "SendDocument.soap");
+        assertTrue(response.indexOf("CreationResponse") > -1);
+        assertTrue(response.indexOf("successful-ok") > -1);
 
     }
 
     //***** end tests ********
 
-    public void setRunAxisServer(boolean RUN_AXIS_SERVER) {
+    public void setRunAxisServer(boolean RUN_AXIS_SERVER)
+    {
         this.RUN_AXIS_SERVER = RUN_AXIS_SERVER;
     }
 
-    public void setBaseURL(String m_baseURL) {
+    public void setBaseURL(String m_baseURL)
+    {
         this.m_baseURL = m_baseURL;
     }
 
-    public void setPrinterFactoryURL(String m_printerFactoryURL) {
+    public void setPrinterFactoryURL(String m_printerFactoryURL)
+    {
         this.m_printerFactoryURL = m_printerFactoryURL;
     }
 
-    public void setPrinterURL(String m_printerURL) {
+    public void setPrinterURL(String m_printerURL)
+    {
         this.m_printerURL = m_printerURL;
     }
 
-    public void setJobURL(String m_jobURL) {
+    public void setJobURL(String m_jobURL)
+    {
         this.m_jobURL = m_jobURL;
     }
 
-    public void setRequestsDir(String requestsDir) {
+    public void setRequestsDir(String requestsDir)
+    {
         m_requestsDir = new File(requestsDir);
     }
 
-    public String sendRequest(String requestURL, String requestFileName) throws IOException {
+    public String sendRequest(String requestURL, String requestFileName) throws IOException
+    {
         return SoapClient.sendRequest(new URL(requestURL), new File(m_requestsDir, requestFileName), null);
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: apollo-dev-help@ws.apache.org