Skip to content

Motech Delivery Tools Setup For Testing

balajin edited this page Jan 4, 2012 · 2 revisions

To use Motech Delivery Tools in the implementation.

Assumptions and Requirements

  1. It is assumed that the implementer is using Apache-Tomcat.
  2. The basic set of software to run Motech are installed.
  3. It is assumed that all application contexts of the implementation follow the pattern application*Context.xml

Structure of motech-delivery-tools

motech-delivery-tools contain The following sub-modules

  1. motech-datetime-simulator
  2. motech-deliverytools-common
  3. motech-job-handler-invoker
  4. motech-kookoo-automation
  5. motech-outbound-endpoint
  6. motech-seed

Procedure

Setup

  1. Clone Motech-Delivery Project
  2. cd to motech-delivery folder.
  3. run mvn clean install.
  4. Copy the jars of all modules inside motech-delivery-tools sub folder to <YOUR_TOMCAT_HOME>/lib folder

Usage in the application

  1. Create a placeholderPluginContext.xml

  2. Import the application contexts of the tools that you need into placeholderPluginContext eg.

    <import resource="classpath*:applicationJobHandlerInvokerContext.xml"/>

  3. NOTE: THE placeHolderPluginContext.xml SHOULD BE REPLACED BY A BLANK FILE IN THE PRODUCTION DEPLOYMENT ARTIFACT.

  4. In the webmvc-config.xml, enter the following component scan.

    <context:component-scan base-package="org.motechproject.deliverytools" use-default- filters="false"> <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/> </context:component-scan>

  5. NOTE: STEP:4 WAS A EASY WAY TO COMPONENT-SCAN THE CONTROLLERS INSIDE MOTECH-DELIVERY TOOLS. IT IS RECOMMENDED THAT SUCH SPURIOUS COMPONENT SCANS ARE NOT INCLUDED IN THE PRODUCTION DEPLOYMENT ARTIFACT.

  6. Deploy your application to Tomcat.

Now, it is possible to use all the http end points of motech-delivery tools.

NOTE

  1. motech-delivery-tools components, should be included in the applicationContext of the implementation. It is not possible to deploy them with a different context and use them in the implementation.

Clone this wiki locally