Testing cross-functionalities between plugins

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Testing cross-functionalities between plugins

Daniel Schnurr
Re-implementing the wholesale market according to the new server architecture I am challenged how to test cross-functionalities between the plugins. This especially includes the settlement after a clearing takes place.

A major advantage of the message-driven (MD) architecture was the loose coupling between the entities/plugins. By this means you could easily test the list of objects that were sent to the other plugins in a local, isolated manner without relying on the other entities.

For Example: Settelement after a cleared trade

MD model: test if the list of objects sent to the accounting service equal the expected number of PositionUpdates and CashUpdates.

New model: The accounting service method is called directly from the auctioneer plugin. Now as a auctioneer developer i have to deal with accounting service functionalities to ensure testing?!

Is there a best practice how to accomplish this cross-testing in a reasonable way? Are there already code examples for the tariff market that deal with the same problem?

Thank's for your help!
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Testing cross-functionalities between plugins

grampajohn
Administrator
Daniel Schnurr wrote
Re-implementing the wholesale market according to the new server architecture I am challenged how to test cross-functionalities between the plugins. This especially includes the settlement after a clearing takes place.

A major advantage of the message-driven (MD) architecture was the loose coupling between the entities/plugins. By this means you could easily test the list of objects that were sent to the other plugins in a local, isolated manner without relying on the other entities.
Perhaps, but I tried hard to use that structure in a testing mode, and could not figure out how to send and receive messages from the test environment. I asked you and David about that, and I combed through the documentation and forums. I became convinced that the combination of Grails and Spring Integration is not used or supported in any useful way, and did not feel it made sense for us to put our resources into solving the problem.
Daniel Schnurr wrote
For Example: Settlement after a cleared trade

MD model: test if the list of objects sent to the accounting service equal the expected number of PositionUpdates and CashUpdates.

New model: The accounting service method is called directly from the auctioneer plugin. Now as a auctioneer developer i have to deal with accounting service functionalities to ensure testing?!

Is there a best practice how to accomplish this cross-testing in a reasonable way? Are there already code examples for the tariff market that deal with the same problem?
Yes, it was while trying to get the MD model to work with the TariffMarket and TariffSubscriptions that I encountered the problems in testing the MD approach and decided to abandon it. It sounds good in the abstract, but the support is just not there. Maybe you know something now that I don't, but it's too late, and there are other reasons why the MD model is not ideal for our simulator.

There are two possible ways to solve the problem. The simplest would be to make your market plugin depend directly on accounting-service. The best-practice approach is to mock the AccountingService, and it's actually quite easy to do. For a couple of simple examples, see accounting-service/.../TariffMarketServiceTests.testBatchPublication(). If this is not enough to go on, please let me know and I'll help you work through it.

Cheers -

John