-
Notifications
You must be signed in to change notification settings - Fork 2
Home
The 'imixs-adapers' project contains different technolgies to adapt services and software platforms into the imixs-workflow. The project is split into severals modules. Each modul provides differnt connectors and technolgies. The common-adapers provide some general technologies to be used for defelopment.
The 'imixs-adapters' project provides several default settings for an easy setup of junit tests. The parent pom.xml contains the JUnit and Mockito Dependencies.
The module 'imixs-adapters-testing' provides additional basic classes to be used for junit tests.
To test a Imixs Workflow Plugin for the imixs-marty project in most cases it is necessary to mock some of the marty service EJBs. To simplify the setup the class 'MartyInitialContextFactory' provides a mock for the EJB inital context used by most plugins. To activate this class add the following VM argument:
-Djava.naming.factory.initial=org.imixs.workflow.marty.test.MartyInitialContextFactory
Using Eclipse IDE this can be done by defining a Run-Configuration for each test case.
The module 'imixs-adapters-magento-ejb' provides several classes to connect to magento. The module uses the magento Rest API with the oAuth authentification.
The imixs.properties file contains sections to configure the magento plugin.
##############################
# Magent REST Service Configuration
##############################
magento.uri-basis=http://localhost/magento/index.php/
magento.uri-api=http://localhost/magento/api/rest
# api token
magento.token.api-key=9abde0f96ce9a38899.....
magento.token.api-secret=34aa69d7ee0782f9a6....
# access token... (use testRequestNewToken to generate a new one)
magento.token.access-key=7ec2d5c3ef2ad29d.......
magento.token.access-secret=19002a261f4b4........
For testing the Magento Adapter it is necessary to generate a Access Tocken first. The junit Test 'org.imixs.workflow.magento.test.TestMagentoPlugin' provides a separate test case called 'testRequestNewToken'. If you run this test the MagentoPlugin requests a new access token in an interactive way. Running the test will print a request URL to call from a web Browser. Then you can authenticate into magento and gain the access. The verifier need to be entered into the live console:
Open Browser Window and authorize the Imixs MagentoPlugin here:
http://localhost/magento/index.php/admin/oauth_authorize?oauth_token=261a3514776fbaeef5638efd01c908ab
And paste the verifier here
>>949775df82a747d09b72e85a96514ed3
Got the Access Token!
key=7ec2d5c3ef2ad29d5519773dd0537a44
secret=19002a261f4b42a0d4b86388757fa2b4
The access-key and access-secret need to be entered into the imixs.porperties file to run further tests.