-
Notifications
You must be signed in to change notification settings - Fork 1
Motech Delivery Tools Setup For Testing
To use Motech Delivery Tools in the implementation.
Assumptions and Requirements
- It is assumed that the implementer is using Apache-Tomcat.
- The basic set of software to run Motech are installed.
- 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
- motech-datetime-simulator
- motech-deliverytools-common
- motech-job-handler-invoker
- motech-kookoo-automation
- motech-outbound-endpoint
- motech-seed
Procedure
Setup
- Clone Motech-Delivery Project
- cd to motech-delivery folder.
- run mvn clean install.
- Copy the jars of all modules inside motech-delivery-tools sub folder to <YOUR_TOMCAT_HOME>/lib folder
Usage in the application
-
Create a placeholderPluginContext.xml
-
Import the application contexts of the tools that you need into placeholderPluginContext eg.
<import resource="classpath*:applicationJobHandlerInvokerContext.xml"/> -
NOTE: THE placeHolderPluginContext.xml SHOULD BE REPLACED BY A BLANK FILE IN THE PRODUCTION DEPLOYMENT ARTIFACT.
-
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> -
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.
-
Deploy your application to Tomcat.
Now, it is possible to use all the http end points of motech-delivery tools.
NOTE
- 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.