Hello,

I fail to run the sample MTS STAX jobs bundled with MTS (attached too), I
get the following error for all of them:

> RC:4001
> Caught com.ibm.staf.service.stax.STAXInvalidXMLAttributeException:
> manual-test: _ln
> EXECUTE file :44:C:\STAF\services\mts\samples\mts_sample3.xml TEST
>

Here are the relevant lines of my STAF.cfg file:

> # Register the MTS service
> service mts library JSTAF execute C:/STAF/services/mts/MTS.jar
>
> # Register the STAX service
> service stax library JSTAF execute c:/staf/services/stax/STAX.jar \
>     PARMS  "PythonOutput    JobUserLogAndMsg \
>             ClearLogs        Enabled \
>             EXTENSION        C:/STAF/services/extensions/ExtDelay.jar \
>             EXTENSION        C:/STAF/services/mts/ManualTestExt.jar"
>

So what is the problem with the STAX jobs?

Thanks
-- 
Ahmed Mostafa
0123919750
Software Developer
IBM Egypt, Cairo Technology Development Center
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">

<stax>
	<defaultcall function="Main"/>
	<script>
		# Set to the machine where the manual test should be displayed
		testMach = 'local'
		
		# Set to the machine where the MTS service is running
		serviceMach = 'local'
	</script>
	<function name="Main">
		<sequence>
			<script>
				manualTestName = 'Scenario XYZ'
			</script>
			<message>
				'Starting manual test %s on machine %s' % (manualTestName, testMach)
			</message>
			<block name="'Manual Test %s on Machine %s' % (manualTestName, testMach)">
				<sequence>
					<manual-test title = "'Scenario XYZ CD Verification Title'" machine="testMach">
						<manual-test-description>
							'Scenario XYZ CD Verification Manual Sequence'
						</manual-test-description>
						<manual-test-choice>
							<manual-test-choice-text>
								'Select the platform you are running this test on:'
							</manual-test-choice-text>
							<manual-test-choice-list>
								['AIX', 'HP/UX', 'Linux', 'Solaris', 'Windows 2000', 'other']
							</manual-test-choice-list>
						</manual-test-choice>
						<manual-test-entry>
							'Enter your name:'
						</manual-test-entry>
						<manual-test-instruction>
							"Enter this command: mount /cdrom (if Unix/Linux) OR do nothing (if Windows)"
						</manual-test-instruction>
						<manual-test-entry>
							'Paste the output from the above command into this field:'
						</manual-test-entry>
						<manual-test-decision>
							'Are there any files present other than those listed above?'
						</manual-test-decision>
					</manual-test>
					
					<if expr="RC == 0">
						<message>
							"Manual Test %s on machine %s completed successfully STAXResult=%s" % (manualTestName, testMach, STAXResult)
						</message>
						<else>
							<message>
								"Manual Test %s on machine %s failed with RC=%s STAFResult=%s STAXResult=%s" % (manualTestName, testMach, RC, STAFResult, STAXResult)
							</message>
						</else>
					</if>
				</sequence>
			</block>
		</sequence>
	</function>
</stax>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">

<stax>

  <defaultcall function="Main"/>

  <function name="Main">
    <testcase name="'Scenario XYZ'">
      <sequence>

        <script>
          # Set to the machine where the manual test should be displayed
          testMach = 'local'     

          # Set to the machine where the MTS service is running
          serviceMach = 'local'  

          manualTestName = 'Scenario XYZ'
          manualTestTitle = 'Scenario XYZ CD Verification Title'
          manualTestDesc = 'Scenario XYZ CD Verification Manual Sequence'

          step1 = ManualTestChoice(
                  'Select the platform you are running this test on:',
                  ['AIX', 'HP/UX', 'Linux', 'Solaris', 'Windows 2000', 'other'])

          step2 = ManualTestEntry('Enter your name:')
  
          step3 = ManualTestInstruction(
          """Enter this command:
            mount /cdrom (if Unix/Linux)
          OR
            do nothing (if Windows)""")

          step4 = ManualTestEntry(
                  'Paste the output from the above command into this field:')

          step5 = ManualTestDecision(
                  'Are there any files present other than those listed above?')
       
          stepList = [step1, step2, step3, step4, step5]
        </script>

        <call function="'RunManualTest'">
           { 'name': manualTestName, 'testMach': testMach,
             'title': manualTestTitle, 'description': manualTestDesc,
             'serviceMach': serviceMach, 'stepList': stepList } 
        </call>
  
      </sequence>
    </testcase>
  </function>

  <function name="RunManualTest" scope="local">

    <function-map-args>
      <function-required-arg name="name"/>
      <function-required-arg name="testMach"/>
      <function-required-arg name="title"/>
      <function-required-arg name="description"/>
      <function-required-arg name="stepList"/>
      <function-optional-arg name="serviceMach" default="'local'"/>
    </function-map-args>

    <block name="'Manual Test %s on Machine %s' % (name, testMach)">
      <sequence>

        <message>
          'Starting manual test %s on machine %s' % \
            (manualTestName, testMach)
        </message>

        <manual-test name="manualTestName" title = "title"
                     machine="testMach" servicemachine="serviceMach">
 
          <manual-test-description>description</manual-test-description>

          <manual-test-step-list>stepList</manual-test-step-list>

        </manual-test>

        <if expr="RC == 0">
          <sequence>

            <script>
              # Check the manual test results in STAXResult
              # For this manual test, it is successful if:
              #  - all steps were checked
              #  - all expected input was provided
              #  - and the positive radio button was selected for step 5

              result = 'pass'
              msg = ("""Manual Test %s on machine %s completed successfully.
                STAXResult=%s""" % (manualTestName, testMach, STAXResult))

              for step in STAXResult:
                if step['isChecked'] == '1' and step['isAnswered'] == '1':
                  if step['stepNumber'] == '5':
                    if step['answer'] != '1':
                      result = 'fail'
                      msg = ("""Manual Test %s on machine %s:  
                        Step 5 decision was 'No'
                        STAXResult=%s""" % (manualTestName, testMach, STAXResult))
                      break
                else:
                  result = 'fail'
                  msg = ("""Manual Test %s on machine %s:
                    Step %s is not checked and/or not answered
                    STAXResult=%s""" % \
                    (manualTestName, testMach, step['stepNumber'], STAXResult))
                  break

            </script>

            <tcstatus result="result">msg</tcstatus>

            <message>msg</message>

          </sequence>

          <else>
            <tcstatus result="'fail'">
              ("""Manual Test %s on machine %s failed with RC=%s STAFResult=%s
                STAXResult=%s""" % \
                (manualTestName, testMach, RC, STAFResult, STAXResult))
            </tcstatus>
          </else>

        </if>

      </sequence>
    </block>
  </function>

</stax>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">

<stax>

  <defaultcall function="Main"/>

  <function name="Main">
    <testcase name="'Scenario XYZ'">
      <sequence>

        <script>
          # Set to the machine where the manual test should be displayed
          testMach = 'local'     

          # Set to the machine where the MTS service is running
          serviceMach = 'local'  

          manualTestName = 'Scenario XYZ'
          manualTestTitle = 'Scenario XYZ CD Verification Title'
          manualTestDesc = 'Scenario XYZ CD Verification Manual Sequence'

          step1 = ManualTestChoice(
                  'Select the platform you are running this test on:',
                  ['AIX', 'HP/UX', 'Linux', 'Solaris', 'Windows 2000', 'other'])

          step2 = ManualTestEntry('Enter your name:')
  
          step3 = ManualTestInstruction(
          """Enter this command:
            mount /cdrom (if Unix/Linux)
          OR
            do nothing (if Windows)""")

          step4 = ManualTestEntry(
                  'Paste the output from the above command into this field:')

          step5 = ManualTestDecision(
                  'Are there any files present other than those listed above?')
       
          stepList = [step1, step2, step3, step4, step5]
        </script>

        <call function="'RunManualTest'">
           { 'name': manualTestName, 'testMach': testMach,
             'title': manualTestTitle, 'description': manualTestDesc,
             'serviceMach': serviceMach, 'stepList': stepList } 
        </call>
  
      </sequence>
    </testcase>
  </function>

  <function name="RunManualTest" scope="local">

    <function-map-args>
      <function-required-arg name="name"/>
      <function-required-arg name="testMach"/>
      <function-required-arg name="title"/>
      <function-required-arg name="description"/>
      <function-required-arg name="stepList"/>
      <function-optional-arg name="serviceMach" default="'local'"/>
    </function-map-args>

    <block name="'Manual Test %s on Machine %s' % (name, testMach)">
      <sequence>

        <message>
          'Starting manual test %s on machine %s' % \
            (manualTestName, testMach)
        </message>

        <manual-test name="manualTestName" title = "title"
                     machine="testMach" servicemachine="serviceMach">
 
          <manual-test-description>description</manual-test-description>

          <manual-test-step-list>stepList</manual-test-step-list>

        </manual-test>

        <if expr="RC == 0">
          <sequence>

            <script>
              # Check if all steps were checked and if all expected
              # input was provided
              theResults = manualTestCheckResults(STAXResult)
              [manualTestRC, unCheckedStepList, unAnsweredStepList] = theResults

              if manualTestRC == 0:
                result = 'pass'
                msg = ("""Manual Test %s on machine %s completed successfully.
                       STAXResult=%s""" % (manualTestName, testMach, STAXResult))
              else:
                result = 'fail'
                msg = 'Manual Test %s on machine %s' % (manualTestName, testMach)
                msg = '%s has unchecked and/or unanswered steps:\n' % (msg)
                if len(unCheckedStepList) != 0:
                  msg = '%s  Unchecked step list:  %s\n' % (msg, unCheckedStepList)
                if len(unAnsweredStepList) != 0:
                  msg = '%s  Unanswered step list: %s\n' % (msg, unAnsweredStepList)
                msg = '%s  STAXResult: %s' % (msg, STAXResult)
            </script>

            <tcstatus result="result">msg</tcstatus>

            <message>msg</message>

          </sequence>

          <else>
            <tcstatus result="'fail'">
              ("""Manual Test %s on machine %s failed with RC=%s STAFResult=%s""" % \
                (manualTestName, testMach, RC, STAFResult))
            </tcstatus>
          </else>

        </if>

      </sequence>
    </block>
  </function>

</stax>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to