Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2021.1

...

  1. Right-click the project from the previous exercises, then choose Add New> Test (.tst) File from the shortcut menu.
  2. Enter a name for the file (e.g., Policy Enforcement), then click Next.
  3. Select SOA>  WSDL, and click Next to advance to the WSDL dialog.
  4. Select http://localhost:8080/parabank/services/store-01?wsdl from the WSDL URL field.
  5. Check the Create tests Tests to validate Validate and enforce policies Enforce Policies on the WSDL check box and make sure the Create Functional Tests from the WSDL check box is also checked.



  6. Click Next until you advance to the Policy Enforcement dialog.
    • Select the Apply Policy Configuration check box. This will create WSDL and functional tests that will enforce the assertions defined in the specified policy configuration.



      The default policy configuration, defaultsoa.soapolicypolicy, is a collection of industry-wide best practices. To use a custom policy configuration, you can either use the Browse button to select a policy configuration or the policy configuration's path can be entered in the text field. For details on policy enforcement, see SOA Policy Enforcement: Overview.
  7. Click the Finish button.
  8. Double-click the new Test Suite: Test Suite node added to the test case tree, enter Policy Configuration in the Name field in the test configuration panel, and click the Save toolbar button.
  9. Expand Test Suite: Policy Configuration then Test Suite: WSDL Tests. Notice that Test 4: Policy Enforcement has been added to Test Suite: WSDL Tests.



  10. Expand the Test 4: Policy Enforcement test to view its chained tools. You will see two Coding Standards tools, one for enforcing rules on the WSDLs and one for enforcing rules on the schemas


    • The first tool, WSDL> WSDL Policy Enforcer, is chained to the WSDL Output of the Test 4: Policy Enforcement test and thus is passed the base WSDL and all imported WSDLs for rule enforcement.
    • The second Coding Standards tool titled Schema> Schema Policy Enforcer is chained to Test 4: Policy Enforcement's Schema Output and thus is passed all schema files referenced in the WSDL for rule enforcement.
  11. Expand one of the tests in the Test Suite: CartServicePort node and notice that a referenced Coding Standards tool titled Response SOAP Envelope> SOAP Policy Enforcer has been chained to the Test.



    This tool will apply its contained policy configuration on the messages received by this test client. The tool is a reference to a Global Tool in the Tools Test Suite under the root Test Suite.



    For more information on Global Tools see Global Tools.
  12. Select the Test 4: Policy Enforcement Test and click the Test toolbar button. This will run policy enforcement tests on the WSDL and schema files. If any errors occur, they will be reported in the Quality Tasks view.

...