Testing MCS policies

When you develop for MCS in Mobile Portal Toolkit, the XML repository provides a suitable test environment for your policies and the related XDIME pages. However, there are some temporary settings you should make to configure MCS for testing and debugging. You can also add markup to XDIME pages to help debug pipeline operations.

When you develop for MCS in Mobile Portal Toolkit, the XML repository provides a suitable test environment for your policies and the related XDIME pages. However, there are some temporary settings you should make to configure MCS for testing and debugging. You can also add markup to XDIME pages to help debug pipeline operations.

Working from a local repository

If you are adding new policy information to your project, or updating existing policies, you will already be using a local XML repository. However your MCS runtime may be set up to use a JDBC version of the repository at runtime, and MCS will need to be reconfigured to use the policies in the Mobile Portal Toolkit workbench.

To set up the XML repository for testing, go to the local-repository section in the mcs-config.xml file and use this setting.

<local-repository>
  <xml-repository/>
</local-repository>

Setting policy caching

MCS can be configured to cache policies at runtime, which can improve performance when the information is requested frequently. However to test your policies you will want to see any changes immediately, so you'll need to disable caching by temporarily changing the settings in the MCS configuration file.

Go to the policy-cache section of the mcs-config.xml file, and set the enabled attribute to false for each policy type that you want to test. The example shows just one of several cache elements.

<policy-cache>
  <asset-group-cache
    enabled="false"
    strategy="least-recently-used"
    max-entries="25"
    timeout="3600"/>
</policy-cache>

Debug configuration

To configure MCS debugging features you edit the debug and debug-output sections of the mcs-config.xml file.

You can enable comments in your output and send output to the log file by setting the comments and logPageOutput attributes on the debug to 'true'.

<debug
  comments="false"
  logPageOutput="false"/>

The directory for debug output of pipeline events is defined in the debug-output element by setting the value of the directory attribute. It specifies the directory into which debugging pipeline operations will write their output.

<debug-output directory="/pipeline_debug"/>

See Debugging the pipeline and Debugging features for further information.

Related topics